Merge inbound to mozilla-central a=merge

This commit is contained in:
Coroiu Cristina 2019-06-27 12:36:00 +03:00
Родитель aa2d0d75c6 8b27a136fc
Коммит f91bd38732
151 изменённых файлов: 1533 добавлений и 665 удалений

Просмотреть файл

@ -30,7 +30,6 @@ window {
min-width: 125px;
display: flex;
flex-direction: column;
flex: 1 1 auto;
}
/* Inspector Panel Splitter */

Просмотреть файл

@ -28,8 +28,8 @@ const { getComputedStyle } = require("./markup");
// This canvas size value is the safest we can use because most GPUs can handle it.
// It's also far from the maximum canvas memory allocation limit (4096x4096x4 is
// 67.108.864 bytes, where the limit is 500.000.000 bytes, see
// MaxAllocSizeDoNotUseDirectly in:
// https://searchfox.org/mozilla-central/source/modules/libpref/init/StaticPrefList.h).
// gfx_max_alloc_size_do_not_use_directly in:
// modules/libpref/init/StaticPrefList.h.
//
// Note:
// Once bug 1232491 lands, we could try to refactor this code to use the values from

Просмотреть файл

@ -9594,7 +9594,8 @@ nsViewportInfo Document::GetViewportInfo(const ScreenIntSize& aDisplaySize) {
// Special behaviour for desktop mode, provided we are not on an about: page
nsPIDOMWindowOuter* win = GetWindow();
if (win && win->IsDesktopModeViewport() && !IsAboutPage()) {
CSSCoord viewportWidth = StaticPrefs::DesktopViewportWidth() / fullZoom;
CSSCoord viewportWidth =
StaticPrefs::browser_viewport_desktopWidth() / fullZoom;
CSSToScreenScale scaleToFit(aDisplaySize.width / viewportWidth);
float aspectRatio = (float)aDisplaySize.height / aDisplaySize.width;
CSSSize viewportSize(viewportWidth, viewportWidth * aspectRatio);
@ -9688,14 +9689,15 @@ nsViewportInfo Document::GetViewportInfo(const ScreenIntSize& aDisplaySize) {
nsViewportInfo::ZoomFlag effectiveZoomFlag =
mAllowZoom ? nsViewportInfo::ZoomFlag::AllowZoom
: nsViewportInfo::ZoomFlag::DisallowZoom;
if (StaticPrefs::ForceUserScalable()) {
if (StaticPrefs::browser_ui_zoom_force_user_scalable()) {
// If the pref to force user-scalable is enabled, we ignore the values
// from the meta-viewport tag for these properties and just assume they
// allow the page to be scalable. Note in particular that this code is
// in the "Specified" branch of the enclosing switch statement, so that
// calls to GetViewportInfo always use the latest value of the
// ForceUserScalable pref. Other codepaths that return nsViewportInfo
// instances are all consistent with ForceUserScalable() already.
// browser_ui_zoom_force_user_scalable pref. Other codepaths that
// return nsViewportInfo instances are all consistent with
// browser_ui_zoom_force_user_scalable() already.
effectiveMinScale = kViewportMinScale;
effectiveMaxScale = kViewportMaxScale;
effectiveValidMaxScale = true;
@ -9801,7 +9803,7 @@ nsViewportInfo Document::GetViewportInfo(const ScreenIntSize& aDisplaySize) {
// Divide by fullZoom to stretch CSS pixel size of viewport in order
// to keep device pixel size unchanged after full zoom applied.
// See bug 974242.
width = StaticPrefs::DesktopViewportWidth() / fullZoom;
width = StaticPrefs::browser_viewport_desktopWidth() / fullZoom;
} else {
// Some viewport information was provided; follow the spec.
width = displaySize.width;

Просмотреть файл

@ -528,7 +528,7 @@ void nsImageLoadingContent::MaybeForceSyncDecoding(
// attribute on a timer.
TimeStamp now = TimeStamp::Now();
TimeDuration threshold = TimeDuration::FromMilliseconds(
StaticPrefs::ImageInferSrcAnimationThresholdMS());
StaticPrefs::image_infer_src_animation_threshold_ms());
// If the length of time between request changes is less than the threshold,
// then force sync decoding to eliminate flicker from the animation.

Просмотреть файл

@ -1231,8 +1231,9 @@ bool CanvasRenderingContext2D::EnsureTarget(const gfx::Rect* aCoveredRect,
}
// Check that the dimensions are sane
if (mWidth > StaticPrefs::MaxCanvasSize() ||
mHeight > StaticPrefs::MaxCanvasSize() || mWidth < 0 || mHeight < 0) {
if (mWidth > StaticPrefs::gfx_canvas_max_size() ||
mHeight > StaticPrefs::gfx_canvas_max_size() || mWidth < 0 ||
mHeight < 0) {
SetErrorState();
return false;
}
@ -5667,7 +5668,8 @@ size_t BindingJSObjectMallocBytes(CanvasRenderingContext2D* aContext) {
int32_t height = aContext->GetHeight();
// TODO: Bug 1552137: No memory will be allocated if either dimension is
// greater than gfxPrefs::MaxCanvasSize(). We should check this here too.
// greater than gfxPrefs::gfx_canvas_max_size(). We should check this here
// too.
CheckedInt<uint32_t> bytes = CheckedInt<uint32_t>(width) * height * 4;
if (!bytes.isValid()) {

Просмотреть файл

@ -313,14 +313,14 @@ PluginInstanceParent::AnswerNPN_GetValue_NPNVdocumentOrigin(nsCString* value,
}
static inline bool AllowDirectBitmapSurfaceDrawing() {
if (!StaticPrefs::PluginAsyncDrawingEnabled()) {
if (!StaticPrefs::dom_ipc_plugins_asyncdrawing_enabled()) {
return false;
}
return gfxPlatform::GetPlatform()->SupportsPluginDirectBitmapDrawing();
}
static inline bool AllowDirectDXGISurfaceDrawing() {
if (!StaticPrefs::PluginAsyncDrawingEnabled()) {
if (!StaticPrefs::dom_ipc_plugins_asyncdrawing_enabled()) {
return false;
}
#if defined(XP_WIN)

Просмотреть файл

@ -11,7 +11,7 @@ function boom()
animate.setAttribute("dur", "2s");
document.documentElement.appendChild(animate);
animate.targetElement;
animate.requiredFeatures.insertItemBefore(0, 0);
animate.requiredExtensions.insertItemBefore(0, 0);
document.documentElement.setCurrentTime(4);
document.documentElement.setCurrentTime(0);
document.documentElement.removeAttribute("class");

До

Ширина:  |  Высота:  |  Размер: 608 B

После

Ширина:  |  Высота:  |  Размер: 610 B

Просмотреть файл

@ -16,8 +16,7 @@
namespace mozilla {
namespace dom {
nsStaticAtom* const SVGTests::sStringListNames[3] = {
nsGkAtoms::requiredFeatures,
nsStaticAtom* const SVGTests::sStringListNames[2] = {
nsGkAtoms::requiredExtensions,
nsGkAtoms::systemLanguage,
};
@ -26,11 +25,6 @@ SVGTests::SVGTests() {
mStringListAttributes[LANGUAGE].SetIsCommaSeparated(true);
}
already_AddRefed<DOMSVGStringList> SVGTests::RequiredFeatures() {
return DOMSVGStringList::GetDOMWrapper(&mStringListAttributes[FEATURES],
AsSVGElement(), true, FEATURES);
}
already_AddRefed<DOMSVGStringList> SVGTests::RequiredExtensions() {
return DOMSVGStringList::GetDOMWrapper(&mStringListAttributes[EXTENSIONS],
AsSVGElement(), true, EXTENSIONS);

Просмотреть файл

@ -93,7 +93,6 @@ class SVGTests : public nsISupports {
void MaybeInvalidate();
// WebIDL
already_AddRefed<DOMSVGStringList> RequiredFeatures();
already_AddRefed<DOMSVGStringList> RequiredExtensions();
already_AddRefed<DOMSVGStringList> SystemLanguage();
@ -109,9 +108,9 @@ class SVGTests : public nsISupports {
virtual ~SVGTests() = default;
private:
enum { FEATURES, EXTENSIONS, LANGUAGE };
SVGStringList mStringListAttributes[3];
static nsStaticAtom* const sStringListNames[3];
enum { EXTENSIONS, LANGUAGE };
SVGStringList mStringListAttributes[2];
static nsStaticAtom* const sStringListNames[2];
};
NS_DEFINE_STATIC_IID_ACCESSOR(SVGTests, MOZILLA_DOMSVGTESTS_IID)

Просмотреть файл

@ -11,7 +11,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=724993-->
<p id="display"></p>
<div id="content" style="display:none;">
<svg id="svg" xmlns="http://www.w3.org/2000/svg" width="100" height="100">
<g id="g" requiredFeatures="foo bar baz"/>
<g id="g" requiredExtensions="foo bar baz"/>
</svg>
</div>
<pre id="test">
@ -64,7 +64,7 @@ function appendItemThrowsFor(stringList, value) {
function run_tests() {
var g = document.getElementById("g");
var strings = g.requiredFeatures;
var strings = g.requiredExtensions;
// sanity check:
is(strings.numberOfItems, 3, "numberOfItems should be 3");

Просмотреть файл

@ -225,9 +225,9 @@ var tests = [
{
// SVGStringList test:
target_element_id: "g",
attr_name: "requiredFeatures", // requiredExtensions, systemLanguage, viewTarget
attr_name: "requiredExtensions", // systemLanguage, viewTarget
prop_name: null, // SVGStringList attributes are not animatable
bv_name: "requiredFeatures",
bv_name: "requiredExtensions",
av_name: null,
el_type: "SVGGElement",
prop_type: null,

Просмотреть файл

@ -14,7 +14,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=631437
<path id="path" d="M0,0 L100,100"/>
<polygon id="poly" points="50,50 70,70 90,50"/>
<g id="g" transform="translate(20 30) rotate(50 60 70) scale(2)"
requiredFeatures="foo bar baz"/>
requiredExtensions="foo bar baz"/>
</svg>
<script type="text/javascript"><![CDATA[
@ -64,8 +64,8 @@ var tests = [
{ values: "translate(1 2) rotate(3) scale(4) skewY(5) skewX(6)",
length: 5 } ] },
{ element: g,
attribute: "requiredFeatures",
listProperty: "requiredFeatures",
attribute: "requiredExtensions",
listProperty: "requiredExtensions",
type: "SVGStringList",
subtests: [ { values: null, length: 3 },
{ values: "foo", length: 1 },

Просмотреть файл

@ -445,7 +445,7 @@ void VRDisplay::StartHandlingVRNavigationEvent() {
mHandlingVRNavigationEventStart = TimeStamp::Now();
++mVRNavigationEventDepth;
TimeDuration timeout =
TimeDuration::FromMilliseconds(StaticPrefs::VRNavigationTimeout());
TimeDuration::FromMilliseconds(StaticPrefs::dom_vr_navigation_timeout());
// A 0 or negative TimeDuration indicates that content may take
// as long as it wishes to respond to the event, as long as
// it happens before the event exits.
@ -470,7 +470,7 @@ bool VRDisplay::IsHandlingVRNavigationEvent() {
return false;
}
TimeDuration timeout =
TimeDuration::FromMilliseconds(StaticPrefs::VRNavigationTimeout());
TimeDuration::FromMilliseconds(StaticPrefs::dom_vr_navigation_timeout());
return timeout.ToMilliseconds() <= 0 ||
(TimeStamp::Now() - mHandlingVRNavigationEventStart) <= timeout;
}
@ -494,7 +494,7 @@ already_AddRefed<Promise> VRDisplay::RequestPresent(
isChromePresentation ? gfx::kVRGroupChrome : gfx::kVRGroupContent;
if (!EventStateManager::IsHandlingUserInput() && !isChromePresentation &&
!IsHandlingVRNavigationEvent() && StaticPrefs::VRRequireGesture() &&
!IsHandlingVRNavigationEvent() && StaticPrefs::dom_vr_require_gesture() &&
!IsPresenting()) {
// The WebVR API states that if called outside of a user gesture, the
// promise must be rejected. We allow VR presentations to start within

Просмотреть файл

@ -13,7 +13,6 @@
[NoInterfaceObject]
interface SVGTests {
readonly attribute SVGStringList requiredFeatures;
readonly attribute SVGStringList requiredExtensions;
readonly attribute SVGStringList systemLanguage;
};

Просмотреть файл

@ -221,8 +221,8 @@ mozilla::gfx::Config* Factory::sConfig = nullptr;
static void PrefChanged(const char* aPref, void*) {
mozilla::gfx::LoggingPrefs::sGfxLogLevel =
Preferences::GetInt(StaticPrefs::GetGfxLoggingLevelPrefName(),
StaticPrefs::GetGfxLoggingLevelPrefDefault());
Preferences::GetInt(StaticPrefs::Getgfx_logging_levelPrefName(),
StaticPrefs::Getgfx_logging_levelPrefDefault());
}
void Factory::Init(const Config& aConfig) {
@ -230,7 +230,7 @@ void Factory::Init(const Config& aConfig) {
sConfig = new Config(aConfig);
Preferences::RegisterCallback(
PrefChanged,
nsDependentCString(StaticPrefs::GetGfxLoggingLevelPrefName()));
nsDependentCString(StaticPrefs::Getgfx_logging_levelPrefName()));
}
void Factory::ShutDown() {

Просмотреть файл

@ -15,7 +15,7 @@ static BYTE GetSystemTextQuality() { return sSystemTextQuality; }
static AntialiasMode GetSystemDefaultAAMode() {
AntialiasMode defaultMode = AntialiasMode::SUBPIXEL;
if (StaticPrefs::DisableAllTextAA()) {
if (StaticPrefs::gfx_text_disable_aa()) {
return AntialiasMode::NONE;
}

Просмотреть файл

@ -36,7 +36,7 @@ Atomic<uint32_t> ScaledFont::sDeletionCounter(0);
ScaledFont::~ScaledFont() { sDeletionCounter++; }
AntialiasMode ScaledFont::GetDefaultAAMode() {
if (StaticPrefs::DisableAllTextAA()) {
if (StaticPrefs::gfx_text_disable_aa()) {
return AntialiasMode::NONE;
}

Просмотреть файл

@ -208,9 +208,11 @@ static const char* const sExtensionNames[] = {
"GL_OVR_multiview2"};
static bool ShouldUseTLSIsCurrent(bool useTLSIsCurrent) {
if (StaticPrefs::UseTLSIsCurrent() == 0) return useTLSIsCurrent;
if (StaticPrefs::gl_use_tls_is_current() == 0) {
return useTLSIsCurrent;
}
return StaticPrefs::UseTLSIsCurrent() > 0;
return StaticPrefs::gl_use_tls_is_current() > 0;
}
static bool ParseVersion(const std::string& versionStr,
@ -275,7 +277,7 @@ GLContext::GLContext(CreateContextFlags flags, const SurfaceCaps& caps,
mDebugFlags(ChooseDebugFlags(flags)),
mSharedContext(sharedContext),
mCaps(caps),
mWorkAroundDriverBugs(StaticPrefs::WorkAroundDriverBugs()) {
mWorkAroundDriverBugs(StaticPrefs::gfx_work_around_driver_bugs()) {
mOwningThreadId = PlatformThread::CurrentId();
MOZ_ALWAYS_TRUE(sCurrentContext.init());
sCurrentContext.set(0);

Просмотреть файл

@ -202,7 +202,7 @@ already_AddRefed<GLContext> GLContextProviderCGL::CreateForWindow(nsIWidget* aWi
return nullptr;
}
GLint opaque = StaticPrefs::CompositorGLContextOpaque();
GLint opaque = StaticPrefs::gfx_compositor_glcontext_opaque();
[context setValues:&opaque forParameter:NSOpenGLCPSurfaceOpacity];
RefPtr<GLContextCGL> glContext =
@ -226,7 +226,7 @@ static already_AddRefed<GLContextCGL> CreateOffscreenFBOContext(CreateContextFla
std::vector<NSOpenGLPixelFormatAttribute> attribs;
if (!StaticPrefs::GLAllowHighPower()) {
if (!StaticPrefs::gl_allow_high_power()) {
flags &= ~CreateContextFlags::HIGH_POWER;
}
if (flags & CreateContextFlags::ALLOW_OFFLINE_RENDERER ||
@ -236,7 +236,7 @@ static already_AddRefed<GLContextCGL> CreateOffscreenFBOContext(CreateContextFla
attribs.push_back(NSOpenGLPFAAllowOfflineRenderers);
}
if (StaticPrefs::RequireHardwareGL()) {
if (StaticPrefs::gl_require_hardware()) {
attribs.push_back(NSOpenGLPFAAccelerated);
}
@ -260,7 +260,7 @@ static already_AddRefed<GLContextCGL> CreateOffscreenFBOContext(CreateContextFla
RefPtr<GLContextCGL> glContext = new GLContextCGL(flags, SurfaceCaps::Any(), context, true);
if (StaticPrefs::GLMultithreaded()) {
if (StaticPrefs::gl_multithreaded()) {
CGLEnable(glContext->GetCGLContext(), kCGLCEMPEngine);
}
return glContext.forget();

Просмотреть файл

@ -185,7 +185,7 @@ bool GLXLibrary::EnsureInitialized() {
if (HasExtension(extensionsStr, "GLX_EXT_texture_from_pixmap") &&
fnLoadSymbols(symbols_texturefrompixmap)) {
mUseTextureFromPixmap = StaticPrefs::UseGLXTextureFromPixmap();
mUseTextureFromPixmap = StaticPrefs::gfx_use_glx_texture_from_pixmap();
} else {
mUseTextureFromPixmap = false;
NS_WARNING("Texture from pixmap disabled");

Просмотреть файл

@ -215,7 +215,7 @@ bool WGLLibrary::EnsureInitialized() {
bool hasDXInterop2 = HasExtension(extString, "WGL_NV_DX_interop2");
if (gfxVars::DXInterop2Blocked() &&
!StaticPrefs::IgnoreDXInterop2Blacklist()) {
!StaticPrefs::gl_ignore_dx_interop2_blacklist()) {
hasDXInterop2 = false;
}

Просмотреть файл

@ -85,7 +85,7 @@ PRLibrary* LoadApitraceLibrary() {
if (!path) return nullptr;
// Initialization of gfx prefs here is only needed during the unit tests...
if (!StaticPrefs::UseApitrace()) {
if (!StaticPrefs::gfx_apitrace_enabled()) {
return nullptr;
}

Просмотреть файл

@ -59,7 +59,7 @@ void GfxTexturesReporter::UpdateAmount(MemoryUse action, size_t amount) {
"GFX: Current texture usage greater than update amount.");
sAmount -= amount;
if (StaticPrefs::GfxLoggingTextureUsageEnabled()) {
if (StaticPrefs::gfx_logging_texture_usage_enabled()) {
printf_stderr("Current texture usage: %s\n",
FormatBytes(sAmount).c_str());
}
@ -67,7 +67,7 @@ void GfxTexturesReporter::UpdateAmount(MemoryUse action, size_t amount) {
sAmount += amount;
if (sAmount > sPeakAmount) {
sPeakAmount.exchange(sAmount);
if (StaticPrefs::GfxLoggingPeakTextureUsageEnabled()) {
if (StaticPrefs::gfx_logging_peak_texture_usage_enabled()) {
printf_stderr("Peak texture usage: %s\n",
FormatBytes(sPeakAmount).c_str());
}

Просмотреть файл

@ -142,7 +142,7 @@ mozilla::ipc::IPCResult GPUChild::RecvInitCrashReporter(
mozilla::ipc::IPCResult GPUChild::RecvCreateVRProcess() {
// Make sure create VR process at the main process
MOZ_ASSERT(XRE_IsParentProcess());
if (StaticPrefs::VRProcessEnabled()) {
if (StaticPrefs::dom_vr_process_enabled()) {
VRProcessManager::Initialize();
VRProcessManager* vr = VRProcessManager::Get();
MOZ_ASSERT(vr, "VRProcessManager must be initialized first.");
@ -158,7 +158,7 @@ mozilla::ipc::IPCResult GPUChild::RecvCreateVRProcess() {
mozilla::ipc::IPCResult GPUChild::RecvShutdownVRProcess() {
// Make sure stopping VR process at the main process
MOZ_ASSERT(XRE_IsParentProcess());
if (StaticPrefs::VRProcessEnabled()) {
if (StaticPrefs::dom_vr_process_enabled()) {
VRProcessManager::Shutdown();
}

Просмотреть файл

@ -264,7 +264,8 @@ mozilla::ipc::IPCResult GPUParent::RecvInit(
}
#ifdef XP_WIN
else {
if (StaticPrefs::Direct3D11UseDoubleBuffering() && IsWin10OrLater()) {
if (StaticPrefs::gfx_direct3d11_use_double_buffering() &&
IsWin10OrLater()) {
// This is needed to avoid freezing the window on a device crash on double
// buffering, see bug 1549674.
widget::WinCompositorWindowThread::Start();
@ -478,7 +479,7 @@ mozilla::ipc::IPCResult GPUParent::RecvRequestMemoryReport(
}
mozilla::ipc::IPCResult GPUParent::RecvShutdownVR() {
if (StaticPrefs::VRProcessEnabled()) {
if (StaticPrefs::dom_vr_process_enabled()) {
VRGPUChild::Shutdown();
}
return IPC_OK();

Просмотреть файл

@ -384,8 +384,8 @@ void GPUProcessManager::OnProcessLaunchComplete(GPUProcessHost* aHost) {
static bool ShouldLimitDeviceResets(uint32_t count, int32_t deltaMilliseconds) {
// We decide to limit by comparing the amount of resets that have happened
// and time since the last reset to two prefs.
int32_t timeLimit = StaticPrefs::DeviceResetThresholdMilliseconds();
int32_t countLimit = StaticPrefs::DeviceResetLimitCount();
int32_t timeLimit = StaticPrefs::gfx_device_reset_threshold_ms();
int32_t countLimit = StaticPrefs::gfx_device_reset_limit();
bool hasTimeLimit = timeLimit >= 0;
bool hasCountLimit = countLimit >= 0;

Просмотреть файл

@ -1420,7 +1420,7 @@ LayerScopeWebSocketManager::LayerScopeWebSocketManager()
NS_NewNamedThread("LayerScope", getter_AddRefs(mDebugSenderThread));
mServerSocket = do_CreateInstance(NS_SERVERSOCKET_CONTRACTID);
int port = StaticPrefs::LayerScopePort();
int port = StaticPrefs::gfx_layerscope_port();
mServerSocket->Init(port, false, -1);
mServerSocket->AsyncListen(new SocketListener);
}
@ -1465,7 +1465,7 @@ NS_IMETHODIMP LayerScopeWebSocketManager::SocketListener::OnSocketAccepted(
// ----------------------------------------------
/*static*/
void LayerScope::Init() {
if (!StaticPrefs::LayerScopeEnabled() || XRE_IsGPUProcess()) {
if (!StaticPrefs::gfx_layerscope_enabled() || XRE_IsGPUProcess()) {
return;
}
@ -1563,7 +1563,7 @@ bool LayerScope::CheckSendable() {
// Only compositor threads check LayerScope status
MOZ_ASSERT(CompositorThreadHolder::IsInCompositorThread() || gIsGtest);
if (!StaticPrefs::LayerScopeEnabled()) {
if (!StaticPrefs::gfx_layerscope_enabled()) {
return false;
}
if (!gLayerScopeManager.GetSocketManager()) {

Просмотреть файл

@ -115,13 +115,13 @@ nsEventStatus APZInputBridge::ReceiveInputEvent(
if (Maybe<APZWheelAction> action = ActionForWheelEvent(&wheelEvent)) {
ScrollWheelInput::ScrollMode scrollMode =
ScrollWheelInput::SCROLLMODE_INSTANT;
if (StaticPrefs::SmoothScrollEnabled() &&
if (StaticPrefs::general_smoothScroll() &&
((wheelEvent.mDeltaMode ==
dom::WheelEvent_Binding::DOM_DELTA_LINE &&
StaticPrefs::WheelSmoothScrollEnabled()) ||
StaticPrefs::general_smoothScroll_mouseWheel()) ||
(wheelEvent.mDeltaMode ==
dom::WheelEvent_Binding::DOM_DELTA_PAGE &&
StaticPrefs::PageSmoothScrollEnabled()))) {
StaticPrefs::general_smoothScroll_pages()))) {
scrollMode = ScrollWheelInput::SCROLLMODE_SMOOTH;
}

Просмотреть файл

@ -200,11 +200,11 @@ nsEventStatus AndroidDynamicToolbarAnimator::ReceiveInputEvent(
}
mControllerLastDragDirection = direction;
}
// NOTE: StaticPrefs::ToolbarScrollThreshold() returns a percentage as
// an int32_t. So multiply it by 0.01f to convert.
const uint32_t dragThreshold =
Abs(std::lround(0.01f * StaticPrefs::ToolbarScrollThreshold() *
mControllerCompositionHeight));
// NOTE: StaticPrefs::browser_ui_scroll_toolbar_threshold() returns a
// percentage as an int32_t. So multiply it by 0.01f to convert.
const uint32_t dragThreshold = Abs(std::lround(
0.01f * StaticPrefs::browser_ui_scroll_toolbar_threshold() *
mControllerCompositionHeight));
if ((Abs(mControllerTotalDistance.value) > dragThreshold) &&
(delta != 0)) {
mControllerDragThresholdReached = true;

Просмотреть файл

@ -2012,7 +2012,7 @@ nsEventStatus AsyncPanZoomController::OnKeyboard(const KeyboardInput& aEvent) {
MaybeAdjustDestinationForScrollSnapping(aEvent, destination);
// If smooth scrolling is disabled, then scroll immediately to the destination
if (!StaticPrefs::SmoothScrollEnabled()) {
if (!StaticPrefs::general_smoothScroll()) {
CancelAnimation();
// CallDispatchScroll interprets the start and end points as the start and
@ -5089,7 +5089,8 @@ void AsyncPanZoomController::DispatchStateChangeNotification(
#if defined(XP_WIN) || defined(MOZ_WIDGET_GTK)
// Let the compositor know about scroll state changes so it can manage
// windowed plugins.
if (StaticPrefs::HidePluginsForScroll() && mCompositorController) {
if (StaticPrefs::gfx_e10s_hide_plugins_for_scroll() &&
mCompositorController) {
mCompositorController->ScheduleHideAllPluginWindows();
}
#endif
@ -5111,7 +5112,8 @@ void AsyncPanZoomController::DispatchStateChangeNotification(
controller->NotifyAPZStateChange(GetGuid(),
APZStateChange::eTransformEnd);
#if defined(XP_WIN) || defined(MOZ_WIDGET_GTK)
if (StaticPrefs::HidePluginsForScroll() && mCompositorController) {
if (StaticPrefs::gfx_e10s_hide_plugins_for_scroll() &&
mCompositorController) {
mCompositorController->ScheduleShowAllPluginWindows();
}
#endif

Просмотреть файл

@ -20,7 +20,7 @@ GenericScrollAnimation::GenericScrollAnimation(
AsyncPanZoomController& aApzc, const nsPoint& aInitialPosition,
const ScrollAnimationBezierPhysicsSettings& aSettings)
: mApzc(aApzc), mFinalDestination(aInitialPosition) {
if (StaticPrefs::SmoothScrollMSDPhysicsEnabled()) {
if (StaticPrefs::general_smoothScroll_msdPhysics_enabled()) {
mAnimationPhysics = MakeUnique<ScrollAnimationMSDPhysics>(aInitialPosition);
} else {
mAnimationPhysics =

Просмотреть файл

@ -18,25 +18,32 @@ static ScrollAnimationBezierPhysicsSettings SettingsForType(
switch (aType) {
case KeyboardScrollAction::eScrollCharacter:
case KeyboardScrollAction::eScrollLine: {
maxMS = clamped(StaticPrefs::LineSmoothScrollMaxDurationMs(), 0, 10000);
minMS = clamped(StaticPrefs::LineSmoothScrollMinDurationMs(), 0, maxMS);
maxMS = clamped(StaticPrefs::general_smoothScroll_lines_durationMaxMS(),
0, 10000);
minMS = clamped(StaticPrefs::general_smoothScroll_lines_durationMinMS(),
0, maxMS);
break;
}
case KeyboardScrollAction::eScrollPage: {
maxMS = clamped(StaticPrefs::PageSmoothScrollMaxDurationMs(), 0, 10000);
minMS = clamped(StaticPrefs::PageSmoothScrollMinDurationMs(), 0, maxMS);
maxMS = clamped(StaticPrefs::general_smoothScroll_pages_durationMaxMS(),
0, 10000);
minMS = clamped(StaticPrefs::general_smoothScroll_pages_durationMinMS(),
0, maxMS);
break;
}
case KeyboardScrollAction::eScrollComplete: {
maxMS = clamped(StaticPrefs::OtherSmoothScrollMaxDurationMs(), 0, 10000);
minMS = clamped(StaticPrefs::OtherSmoothScrollMinDurationMs(), 0, maxMS);
maxMS = clamped(StaticPrefs::general_smoothScroll_other_durationMaxMS(),
0, 10000);
minMS = clamped(StaticPrefs::general_smoothScroll_other_durationMinMS(),
0, maxMS);
break;
}
}
// The pref is 100-based int percentage, while mIntervalRatio is 1-based ratio
double intervalRatio =
((double)StaticPrefs::SmoothScrollDurationToIntervalRatio()) / 100.0;
((double)StaticPrefs::general_smoothScroll_durationToIntervalRatio()) /
100.0;
intervalRatio = std::max(1.0, intervalRatio);
return ScrollAnimationBezierPhysicsSettings{minMS, maxMS, intervalRatio};
}

Просмотреть файл

@ -21,22 +21,31 @@ static ScrollAnimationBezierPhysicsSettings SettingsForDeltaType(
switch (aDeltaType) {
case ScrollWheelInput::SCROLLDELTA_PAGE:
maxMS = clamped(StaticPrefs::PageSmoothScrollMaxDurationMs(), 0, 10000);
minMS = clamped(StaticPrefs::PageSmoothScrollMinDurationMs(), 0, maxMS);
maxMS = clamped(StaticPrefs::general_smoothScroll_pages_durationMaxMS(),
0, 10000);
minMS = clamped(StaticPrefs::general_smoothScroll_pages_durationMinMS(),
0, maxMS);
break;
case ScrollWheelInput::SCROLLDELTA_PIXEL:
maxMS = clamped(StaticPrefs::PixelSmoothScrollMaxDurationMs(), 0, 10000);
minMS = clamped(StaticPrefs::PixelSmoothScrollMinDurationMs(), 0, maxMS);
maxMS = clamped(StaticPrefs::general_smoothScroll_pixels_durationMaxMS(),
0, 10000);
minMS = clamped(StaticPrefs::general_smoothScroll_pixels_durationMinMS(),
0, maxMS);
break;
case ScrollWheelInput::SCROLLDELTA_LINE:
maxMS = clamped(StaticPrefs::WheelSmoothScrollMaxDurationMs(), 0, 10000);
minMS = clamped(StaticPrefs::WheelSmoothScrollMinDurationMs(), 0, maxMS);
maxMS =
clamped(StaticPrefs::general_smoothScroll_mouseWheel_durationMaxMS(),
0, 10000);
minMS =
clamped(StaticPrefs::general_smoothScroll_mouseWheel_durationMinMS(),
0, maxMS);
break;
}
// The pref is 100-based int percentage, while mIntervalRatio is 1-based ratio
double intervalRatio =
((double)StaticPrefs::SmoothScrollDurationToIntervalRatio()) / 100.0;
((double)StaticPrefs::general_smoothScroll_durationToIntervalRatio()) /
100.0;
intervalRatio = std::max(1.0, intervalRatio);
return ScrollAnimationBezierPhysicsSettings{minMS, maxMS, intervalRatio};
}

Просмотреть файл

@ -312,7 +312,7 @@ bool ClientLayerManager::EndTransactionInternal(
// Skip the painting if the device is in device-reset status.
if (!gfxPlatform::GetPlatform()->DidRenderingDeviceReset()) {
if (StaticPrefs::AlwaysPaint() && XRE_IsContentProcess()) {
if (StaticPrefs::gfx_content_always_paint() && XRE_IsContentProcess()) {
TimeStamp start = TimeStamp::Now();
root->RenderLayer();
mLastPaintTime = TimeStamp::Now() - start;
@ -700,7 +700,7 @@ void ClientLayerManager::ForwardTransaction(bool aScheduleComposite) {
refreshStart = mTransactionStart;
}
if (StaticPrefs::AlwaysPaint() && XRE_IsContentProcess()) {
if (StaticPrefs::gfx_content_always_paint() && XRE_IsContentProcess()) {
mForwarder->SendPaintTime(mLatestTransactionId, mLastPaintTime);
}

Просмотреть файл

@ -295,13 +295,13 @@ GetTextureType(gfx::SurfaceFormat aFormat, gfx::IntSize aSize,
#endif
#ifdef XP_MACOSX
if (StaticPrefs::UseIOSurfaceTextures()) {
if (StaticPrefs::gfx_use_iosurface_textures()) {
return TextureType::MacIOSurface;
}
#endif
#ifdef MOZ_WIDGET_ANDROID
if (StaticPrefs::UseSurfaceTextureTextures()) {
if (StaticPrefs::gfx_use_surfacetexture_textures()) {
return TextureType::AndroidNativeWindow;
}
#endif

Просмотреть файл

@ -789,7 +789,7 @@ static bool SampleAnimations(Layer* aLayer,
}
void AsyncCompositionManager::RecordShadowTransforms(Layer* aLayer) {
MOZ_ASSERT(StaticPrefs::CollectScrollTransforms());
MOZ_ASSERT(StaticPrefs::gfx_vsync_collect_scroll_transforms());
MOZ_ASSERT(CompositorThreadHolder::IsInCompositorThread());
ForEachNodePostOrder<ForwardIterator>(aLayer, [this](Layer* layer) {
@ -1472,7 +1472,7 @@ bool AsyncCompositionManager::TransformShadowTree(
trans *= gfx::Matrix4x4::From2D(mWorldTransform);
rootComposite->SetShadowBaseTransform(trans);
if (StaticPrefs::CollectScrollTransforms()) {
if (StaticPrefs::gfx_vsync_collect_scroll_transforms()) {
RecordShadowTransforms(root);
}

Просмотреть файл

@ -623,7 +623,7 @@ LayerComposite* LayerManagerComposite::RootLayer() const {
void LayerManagerComposite::InvalidateDebugOverlay(nsIntRegion& aInvalidRegion,
const IntRect& aBounds) {
bool drawFps = StaticPrefs::LayersDrawFPS();
bool drawFrameColorBars = StaticPrefs::CompositorDrawColorBars();
bool drawFrameColorBars = StaticPrefs::gfx_draw_color_bars();
if (drawFps) {
aInvalidRegion.Or(aInvalidRegion, nsIntRect(0, 0, 650, 400));
@ -633,7 +633,7 @@ void LayerManagerComposite::InvalidateDebugOverlay(nsIntRegion& aInvalidRegion,
}
#ifdef USE_SKIA
bool drawPaintTimes = StaticPrefs::AlwaysPaint();
bool drawPaintTimes = StaticPrefs::gfx_content_always_paint();
if (drawPaintTimes) {
aInvalidRegion.Or(aInvalidRegion, nsIntRect(PaintCounter::GetPaintRect()));
}
@ -654,7 +654,7 @@ void LayerManagerComposite::DrawPaintTimes(Compositor* aCompositor) {
static uint16_t sFrameCount = 0;
void LayerManagerComposite::RenderDebugOverlay(const IntRect& aBounds) {
bool drawFps = StaticPrefs::LayersDrawFPS();
bool drawFrameColorBars = StaticPrefs::CompositorDrawColorBars();
bool drawFrameColorBars = StaticPrefs::gfx_draw_color_bars();
// Don't draw diagnostic overlays if we want to snapshot the output.
if (mTarget) {
@ -764,7 +764,7 @@ void LayerManagerComposite::RenderDebugOverlay(const IntRect& aBounds) {
}
#ifdef USE_SKIA
bool drawPaintTimes = StaticPrefs::AlwaysPaint();
bool drawPaintTimes = StaticPrefs::gfx_content_always_paint();
if (drawPaintTimes) {
DrawPaintTimes(mCompositor);
}

Просмотреть файл

@ -109,7 +109,7 @@ CompositorD3D11::CompositorD3D11(CompositorBridgeParent* aParent,
mIsDoubleBuffered(false),
mVerifyBuffersFailed(false),
mUseMutexOnPresent(false) {
mUseMutexOnPresent = StaticPrefs::UseMutexOnPresent();
mUseMutexOnPresent = StaticPrefs::gfx_use_mutex_on_present();
}
CompositorD3D11::~CompositorD3D11() {}
@ -201,7 +201,7 @@ bool CompositorD3D11::Initialize(nsCString* const out_failureReason) {
(IDXGIFactory2**)getter_AddRefs(dxgiFactory2));
#if (_WIN32_WINDOWS_MAXVER >= 0x0A00)
if (StaticPrefs::Direct3D11UseDoubleBuffering() && SUCCEEDED(hr) &&
if (StaticPrefs::gfx_direct3d11_use_double_buffering() && SUCCEEDED(hr) &&
dxgiFactory2 && IsWindows10OrGreater()) {
// DXGI_SCALING_NONE is not available on Windows 7 with Platform Update.
// This looks awful for things like the awesome bar and browser window
@ -291,10 +291,10 @@ bool CompositorD3D11::Initialize(nsCString* const out_failureReason) {
}
bool CanUsePartialPresents(ID3D11Device* aDevice) {
if (StaticPrefs::PartialPresent() > 0) {
if (StaticPrefs::gfx_partialpresent_force() > 0) {
return true;
}
if (StaticPrefs::PartialPresent() < 0) {
if (StaticPrefs::gfx_partialpresent_force() < 0) {
return false;
}
if (DeviceManagerDx::Get()->IsWARP()) {
@ -1247,7 +1247,7 @@ void CompositorD3D11::EndFrame() {
if (oldSize == mSize) {
Present();
if (StaticPrefs::CompositorClearState()) {
if (StaticPrefs::gfx_compositor_clearstate()) {
mContext->ClearState();
}
} else {

Просмотреть файл

@ -234,7 +234,7 @@ bool MLGSwapChainD3D11::Initialize(CompositorWidget* aWidget) {
}
RefPtr<IDXGIFactory2> dxgiFactory2;
if (StaticPrefs::Direct3D11UseDoubleBuffering() &&
if (StaticPrefs::gfx_direct3d11_use_double_buffering() &&
SUCCEEDED(dxgiFactory->QueryInterface(dxgiFactory2.StartAssignment())) &&
dxgiFactory2 && IsWin10OrLater() && XRE_IsGPUProcess()) {
// DXGI_SCALING_NONE is not available on Windows 7 with the Platform Update:

Просмотреть файл

@ -288,7 +288,8 @@ static void DestroyDrawTarget(RefPtr<DrawTarget>& aDT,
D3D11TextureData::~D3D11TextureData() {
if (mDrawTarget) {
if (PaintThread::Get() && StaticPrefs::Direct2DDestroyDTOnPaintThread()) {
if (PaintThread::Get() &&
StaticPrefs::gfx_direct2d_destroy_dt_on_paintthread()) {
RefPtr<DrawTarget> dt = mDrawTarget;
RefPtr<ID3D11Texture2D> tex = mTexture;
RefPtr<Runnable> task = NS_NewRunnableFunction(

Просмотреть файл

@ -1553,7 +1553,7 @@ PLayerTransactionParent* CompositorBridgeParent::AllocPLayerTransactionParent(
#ifdef XP_WIN
// This is needed to avoid freezing the window on a device crash on double
// buffering, see bug 1549674.
if (StaticPrefs::Direct3D11UseDoubleBuffering() && IsWin10OrLater() &&
if (StaticPrefs::gfx_direct3d11_use_double_buffering() && IsWin10OrLater() &&
XRE_IsGPUProcess()) {
mWidget->AsWindows()->EnsureCompositorWindow();
}
@ -1792,7 +1792,7 @@ PWebRenderBridgeParent* CompositorBridgeParent::AllocPWebRenderBridgeParent(
return mWrBridge;
}
if (StaticPrefs::WebRenderSplitRenderRoots()) {
if (StaticPrefs::gfx_webrender_split_render_roots()) {
apis.AppendElement(
apis[0]->CreateDocument(aSize, 1, wr::RenderRoot::Content));
}

Просмотреть файл

@ -255,7 +255,7 @@ void CompositorVsyncScheduler::Composite(VsyncId aId,
mozilla::Telemetry::COMPOSITE_FRAME_ROUNDTRIP_TIME,
compositeFrameTotal.ToMilliseconds());
} else if (mVsyncNotificationsSkipped++ >
StaticPrefs::CompositorUnobserveCount()) {
StaticPrefs::gfx_vsync_compositor_unobserve_count()) {
UnobserveVsync();
}
}

Просмотреть файл

@ -512,7 +512,7 @@ void SharedSurfacesAnimation::Destroy() {
for (const auto& entry : mKeys) {
MOZ_ASSERT(!entry.mManager->IsDestroyed());
if (StaticPrefs::ImageAnimatedDecodeOnDemandRecycle()) {
if (StaticPrefs::image_animated_decode_on_demand_recycle()) {
entry.mManager->DeregisterAsyncAnimation(entry.mImageKey);
}
entry.mManager->AddImageKeyForDiscard(entry.mImageKey);
@ -528,7 +528,7 @@ void SharedSurfacesAnimation::HoldSurfaceForRecycling(
return;
}
MOZ_ASSERT(StaticPrefs::ImageAnimatedDecodeOnDemandRecycle());
MOZ_ASSERT(StaticPrefs::image_animated_decode_on_demand_recycle());
aEntry.mPendingRelease.AppendElement(aParentSurface);
}
@ -617,7 +617,7 @@ nsresult SharedSurfacesAnimation::UpdateKey(
if (!found) {
aKey = aManager->WrBridge()->GetNextImageKey();
if (StaticPrefs::ImageAnimatedDecodeOnDemandRecycle()) {
if (StaticPrefs::image_animated_decode_on_demand_recycle()) {
aManager->RegisterAsyncAnimation(aKey, this);
}

Просмотреть файл

@ -805,10 +805,11 @@ void CompositorOGL::BeginFrame(const nsIntRegion& aInvalidRegion,
#if defined(MOZ_WIDGET_ANDROID)
if ((mSurfaceOrigin.x > 0) || (mSurfaceOrigin.y > 0)) {
mGLContext->fClearColor(StaticPrefs::CompositorOverrideClearColorR(),
StaticPrefs::CompositorOverrideClearColorG(),
StaticPrefs::CompositorOverrideClearColorB(),
StaticPrefs::CompositorOverrideClearColorA());
mGLContext->fClearColor(
StaticPrefs::gfx_compositor_override_clear_color_r(),
StaticPrefs::gfx_compositor_override_clear_color_g(),
StaticPrefs::gfx_compositor_override_clear_color_b(),
StaticPrefs::gfx_compositor_override_clear_color_a());
} else {
mGLContext->fClearColor(mClearColor.r, mClearColor.g, mClearColor.b,
mClearColor.a);
@ -1972,7 +1973,7 @@ GLuint CompositorOGL::GetTemporaryTexture(GLenum aTarget, GLenum aUnit) {
}
bool CompositorOGL::SupportsTextureDirectMapping() {
if (!StaticPrefs::AllowTextureDirectMapping()) {
if (!StaticPrefs::gfx_allow_texture_direct_mapping()) {
return false;
}

Просмотреть файл

@ -73,9 +73,9 @@ void WebRenderBridgeChild::DoDestroy() {
void WebRenderBridgeChild::AddWebRenderParentCommand(
const WebRenderParentCommand& aCmd, wr::RenderRoot aRenderRoot) {
MOZ_ASSERT(
aRenderRoot == wr::RenderRoot::Default ||
(XRE_IsParentProcess() && StaticPrefs::WebRenderSplitRenderRoots()));
MOZ_ASSERT(aRenderRoot == wr::RenderRoot::Default ||
(XRE_IsParentProcess() &&
StaticPrefs::gfx_webrender_split_render_roots()));
mParentCommands[aRenderRoot].AppendElement(aCmd);
}
@ -118,9 +118,9 @@ void WebRenderBridgeChild::EndTransaction(
TimeStamp fwdTime = TimeStamp::Now();
for (auto& renderRoot : aRenderRoots) {
MOZ_ASSERT(
renderRoot.mRenderRoot == wr::RenderRoot::Default ||
(XRE_IsParentProcess() && StaticPrefs::WebRenderSplitRenderRoots()));
MOZ_ASSERT(renderRoot.mRenderRoot == wr::RenderRoot::Default ||
(XRE_IsParentProcess() &&
StaticPrefs::gfx_webrender_split_render_roots()));
renderRoot.mCommands = std::move(mParentCommands[renderRoot.mRenderRoot]);
}
@ -156,9 +156,9 @@ void WebRenderBridgeChild::EndEmptyTransaction(
TimeStamp fwdTime = TimeStamp::Now();
for (auto& update : aRenderRootUpdates) {
MOZ_ASSERT(
update.mRenderRoot == wr::RenderRoot::Default ||
(XRE_IsParentProcess() && StaticPrefs::WebRenderSplitRenderRoots()));
MOZ_ASSERT(update.mRenderRoot == wr::RenderRoot::Default ||
(XRE_IsParentProcess() &&
StaticPrefs::gfx_webrender_split_render_roots()));
update.mCommands = std::move(mParentCommands[update.mRenderRoot]);
}
@ -187,7 +187,7 @@ void WebRenderBridgeChild::ProcessWebRenderParentCommands() {
for (auto renderRoot : wr::kRenderRoots) {
if (!mParentCommands[renderRoot].IsEmpty()) {
MOZ_ASSERT(renderRoot == wr::RenderRoot::Default ||
StaticPrefs::WebRenderSplitRenderRoots());
StaticPrefs::gfx_webrender_split_render_roots());
this->SendParentCommands(mParentCommands[renderRoot], renderRoot);
mParentCommands[renderRoot].Clear();
}

Просмотреть файл

@ -327,7 +327,7 @@ WebRenderBridgeParent::WebRenderBridgeParent(
}
if (!IsRootWebRenderBridgeParent() &&
StaticPrefs::WebRenderSplitRenderRoots()) {
StaticPrefs::gfx_webrender_split_render_roots()) {
mRenderRoot = wr::RenderRoot::Content;
}
@ -926,7 +926,7 @@ bool WebRenderBridgeParent::SetDisplayList(
}
LayoutDeviceIntSize widgetSize = mWidget->GetClientSize();
LayoutDeviceIntRect rect;
if (StaticPrefs::WebRenderSplitRenderRoots()) {
if (StaticPrefs::gfx_webrender_split_render_roots()) {
rect = RoundedToInt(aRect);
rect.SetWidth(
std::max(0, std::min(widgetSize.width - rect.X(), rect.Width())));
@ -1620,7 +1620,7 @@ mozilla::ipc::IPCResult WebRenderBridgeParent::RecvClearCachedResources() {
for (auto renderRoot : wr::kRenderRoots) {
if (renderRoot == wr::RenderRoot::Default ||
(IsRootWebRenderBridgeParent() &&
StaticPrefs::WebRenderSplitRenderRoots())) {
StaticPrefs::gfx_webrender_split_render_roots())) {
// Clear resources
wr::TransactionBuilder txn;
txn.SetLowPriority(true);
@ -1708,7 +1708,7 @@ void WebRenderBridgeParent::ScheduleForcedGenerateFrame() {
for (auto renderRoot : wr::kRenderRoots) {
if (renderRoot == wr::RenderRoot::Default ||
(IsRootWebRenderBridgeParent() &&
StaticPrefs::WebRenderSplitRenderRoots())) {
StaticPrefs::gfx_webrender_split_render_roots())) {
wr::TransactionBuilder fastTxn(/* aUseSceneBuilderThread */ false);
fastTxn.InvalidateRenderedFrame();
Api(renderRoot)->SendTransaction(fastTxn);
@ -1745,7 +1745,7 @@ mozilla::ipc::IPCResult WebRenderBridgeParent::RecvSetConfirmedTargetAPZC(
for (size_t i = 0; i < aTargets.Length(); i++) {
// Guard against bad data from hijacked child processes
if (aTargets[i].mRenderRoot > wr::kHighestRenderRoot ||
(!StaticPrefs::WebRenderSplitRenderRoots() &&
(!StaticPrefs::gfx_webrender_split_render_roots() &&
aTargets[i].mRenderRoot != wr::RenderRoot::Default)) {
NS_ERROR(
"Unexpected render root in RecvSetConfirmedTargetAPZC; dropping "
@ -2111,7 +2111,7 @@ void WebRenderBridgeParent::NotifyDidSceneBuild(
if (lastVsyncId == VsyncId() || !mMostRecentComposite ||
mMostRecentComposite >= lastVsync ||
((TimeStamp::Now() - lastVsync).ToMilliseconds() >
StaticPrefs::WebRenderLateSceneBuildThreshold())) {
StaticPrefs::gfx_webrender_late_scenebuild_threshold())) {
mCompositorScheduler->ScheduleComposition();
return;
}

Просмотреть файл

@ -1654,8 +1654,10 @@ void WebRenderCommandBuilder::BuildWebRenderCommands(
bool WebRenderCommandBuilder::ShouldDumpDisplayList(
nsDisplayListBuilder* aBuilder) {
return aBuilder != nullptr && aBuilder->IsInActiveDocShell() &&
((XRE_IsParentProcess() && StaticPrefs::WebRenderDLDumpParent()) ||
(XRE_IsContentProcess() && StaticPrefs::WebRenderDLDumpContent()));
((XRE_IsParentProcess() &&
StaticPrefs::gfx_webrender_dl_dump_parent()) ||
(XRE_IsContentProcess() &&
StaticPrefs::gfx_webrender_dl_dump_content()));
}
void WebRenderCommandBuilder::CreateWebRenderCommandsFromDisplayList(
@ -2114,10 +2116,10 @@ WebRenderCommandBuilder::GenerateFallbackData(
nsDisplayItem* aItem, wr::DisplayListBuilder& aBuilder,
wr::IpcResourceUpdateQueue& aResources, const StackingContextHelper& aSc,
nsDisplayListBuilder* aDisplayListBuilder, LayoutDeviceRect& aImageRect) {
bool useBlobImage =
StaticPrefs::WebRenderBlobImages() && !aItem->MustPaintOnContentSide();
bool useBlobImage = StaticPrefs::gfx_webrender_blob_images() &&
!aItem->MustPaintOnContentSide();
Maybe<gfx::Color> highlight = Nothing();
if (StaticPrefs::WebRenderHighlightPaintedLayers()) {
if (StaticPrefs::gfx_webrender_highlight_painted_layers()) {
highlight = Some(useBlobImage ? gfx::Color(1.0, 0.0, 0.0, 0.5)
: gfx::Color(1.0, 1.0, 0.0, 0.5));
}

Просмотреть файл

@ -406,8 +406,8 @@ bool D3D11LayersCrashGuard::UpdateEnvironment() {
bool changed = false;
// Feature status.
#if defined(XP_WIN)
bool d2dEnabled = StaticPrefs::Direct2DForceEnabled() ||
(!StaticPrefs::Direct2DDisabled() &&
bool d2dEnabled = StaticPrefs::gfx_direct2d_force_enabled() ||
(!StaticPrefs::gfx_direct2d_disabled() &&
FeatureEnabled(nsIGfxInfo::FEATURE_DIRECT2D));
changed |= CheckAndUpdateBoolPref("feature-d2d", d2dEnabled);

Просмотреть файл

@ -139,7 +139,7 @@ bool D3D11Checks::DoesDeviceWork() {
if (checked) return result;
checked = true;
if (StaticPrefs::Direct2DForceEnabled() ||
if (StaticPrefs::gfx_direct2d_force_enabled() ||
gfxConfig::IsForcedOnByUser(Feature::HW_COMPOSITING)) {
result = true;
return true;
@ -200,7 +200,7 @@ static bool DoesTextureSharingWorkInternal(ID3D11Device* device,
return false;
}
if (StaticPrefs::Direct2DForceEnabled() ||
if (StaticPrefs::gfx_direct2d_force_enabled() ||
gfxConfig::IsForcedOnByUser(Feature::HW_COMPOSITING)) {
return true;
}

Просмотреть файл

@ -183,7 +183,7 @@ bool DeviceManagerDx::CreateCompositorDevices() {
FeatureState& d3d11 = gfxConfig::GetFeature(Feature::D3D11_COMPOSITING);
MOZ_ASSERT(d3d11.IsEnabled());
if (int32_t sleepSec = StaticPrefs::Direct3D11SleepOnCreateDevice()) {
if (int32_t sleepSec = StaticPrefs::gfx_direct3d11_sleep_on_create_device()) {
printf_stderr("Attach to PID: %d\n", GetCurrentProcessId());
Sleep(sleepSec * 1000);
}
@ -442,7 +442,7 @@ bool DeviceManagerDx::CreateCompositorDeviceHelper(
FeatureState& aD3d11, IDXGIAdapter1* aAdapter, bool aAttemptVideoSupport,
RefPtr<ID3D11Device>& aOutDevice) {
// Check if a failure was injected for testing.
if (StaticPrefs::DeviceFailForTesting()) {
if (StaticPrefs::gfx_testing_device_fail()) {
aD3d11.SetFailed(FeatureStatus::Failed,
"Direct3D11 device failure simulated by preference",
NS_LITERAL_CSTRING("FEATURE_FAILURE_D3D11_SIM"));
@ -571,8 +571,8 @@ bool DeviceManagerDx::CreateDevice(IDXGIAdapter* aAdapter,
D3D_DRIVER_TYPE aDriverType, UINT aFlags,
HRESULT& aResOut,
RefPtr<ID3D11Device>& aOutDevice) {
if (StaticPrefs::Direct3D11EnableDebugLayer() ||
StaticPrefs::Direct3D11BreakOnError()) {
if (StaticPrefs::gfx_direct3d11_enable_debug_layer() ||
StaticPrefs::gfx_direct3d11_break_on_error()) {
aFlags |= D3D11_CREATE_DEVICE_DEBUG;
}
@ -584,7 +584,7 @@ bool DeviceManagerDx::CreateDevice(IDXGIAdapter* aAdapter,
}
MOZ_SEH_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { return false; }
if (StaticPrefs::Direct3D11BreakOnError()) {
if (StaticPrefs::gfx_direct3d11_break_on_error()) {
do {
if (!aOutDevice) break;
@ -745,13 +745,13 @@ RefPtr<ID3D11Device> DeviceManagerDx::CreateDecoderDevice() {
}
bool reuseDevice = false;
if (StaticPrefs::Direct3D11ReuseDecoderDevice() < 0) {
if (StaticPrefs::gfx_direct3d11_reuse_decoder_device() < 0) {
// Use the default logic, which is to allow reuse of devices on AMD, but
// create separate devices everywhere else.
if (isAMD) {
reuseDevice = true;
}
} else if (StaticPrefs::Direct3D11ReuseDecoderDevice() > 0) {
} else if (StaticPrefs::gfx_direct3d11_reuse_decoder_device() > 0) {
reuseDevice = true;
}
@ -1035,7 +1035,7 @@ bool DeviceManagerDx::GetAnyDeviceRemovedReason(DeviceResetReason* aOutReason) {
}
if (XRE_IsParentProcess() && NS_IsMainThread() &&
StaticPrefs::DeviceResetForTesting()) {
StaticPrefs::gfx_testing_device_reset()) {
Preferences::SetInt("gfx.testing.device-reset", 0);
*aOutReason = DeviceResetReason::FORCED_RESET;
return true;
@ -1143,7 +1143,7 @@ bool DeviceManagerDx::TextureSharingWorks() {
bool DeviceManagerDx::CanInitializeKeyedMutexTextures() {
MutexAutoLock lock(mDeviceLock);
return mDeviceStatus && StaticPrefs::Direct3D11AllowKeyedMutex() &&
return mDeviceStatus && StaticPrefs::gfx_direct3d11_allow_keyed_mutex() &&
gfxVars::AllowD3D11KeyedMutex();
}

Просмотреть файл

@ -93,7 +93,7 @@ gfxAndroidPlatform::gfxAndroidPlatform() {
mOffscreenFormat = GetScreenDepth() == 16 ? SurfaceFormat::R5G6B5_UINT16
: SurfaceFormat::X8R8G8B8_UINT32;
if (StaticPrefs::AndroidRGB16Force()) {
if (StaticPrefs::gfx_android_rgb16_force()) {
mOffscreenFormat = SurfaceFormat::R5G6B5_UINT16;
}
}

Просмотреть файл

@ -199,7 +199,7 @@ bool gfxMacFont::ShapeText(DrawTarget* aDrawTarget, const char16_t* aText,
// so we ignore RequiresAATLayout if vertical is requested.
auto macFontEntry = static_cast<MacOSFontEntry*>(GetFontEntry());
if (macFontEntry->RequiresAATLayout() && !aVertical &&
StaticPrefs::CoreTextEnabled()) {
StaticPrefs::gfx_font_rendering_coretext_enabled()) {
if (!mCoreTextShaper) {
mCoreTextShaper = MakeUnique<gfxCoreTextShaper>(this);
}

Просмотреть файл

@ -605,7 +605,8 @@ static uint32_t GetSkiaGlyphCacheSize() {
// We don't need to change the font cache count since we usually
// cache thrash due to asian character sets in talos.
// Only increase memory on the content process
uint32_t cacheSize = StaticPrefs::SkiaContentFontCacheSize() * 1024 * 1024;
uint32_t cacheSize =
StaticPrefs::gfx_content_skia_font_cache_size() * 1024 * 1024;
if (mozilla::BrowserTabsRemoteAutostart()) {
return XRE_IsContentProcess() ? cacheSize : kDefaultGlyphCacheSize;
}
@ -911,8 +912,8 @@ void gfxPlatform::Init() {
{
nsAutoCString forcedPrefs;
// D2D prefs
forcedPrefs.AppendPrintf("FP(D%d%d", StaticPrefs::Direct2DDisabled(),
StaticPrefs::Direct2DForceEnabled());
forcedPrefs.AppendPrintf("FP(D%d%d", StaticPrefs::gfx_direct2d_disabled(),
StaticPrefs::gfx_direct2d_force_enabled());
// Layers prefs
forcedPrefs.AppendPrintf(
"-L%d%d%d%d", StaticPrefs::LayersAMDSwitchableGfxEnabled(),
@ -927,7 +928,8 @@ void gfxPlatform::Init() {
StaticPrefs::WebGLForceEnabled(),
StaticPrefs::WebGLForceLayersReadback(), StaticPrefs::WebGLForceMSAA());
// Prefs that don't fit into any of the other sections
forcedPrefs.AppendPrintf("-T%d%d%d) ", StaticPrefs::AndroidRGB16Force(),
forcedPrefs.AppendPrintf("-T%d%d%d) ",
StaticPrefs::gfx_android_rgb16_force(),
0, // SkiaGL canvas no longer supported
StaticPrefs::ForceShmemTiles());
ScopedGfxFeatureReporter::AppNote(forcedPrefs);
@ -1133,7 +1135,8 @@ int32_t gfxPlatform::MaxTextureSize() {
// Make sure we don't completely break rendering because of a typo in the
// pref or whatnot.
const int32_t kMinSizePref = 2048;
return std::max(kMinSizePref, StaticPrefs::MaxTextureSizeDoNotUseDirectly());
return std::max(kMinSizePref,
StaticPrefs::gfx_max_texture_size_do_not_use_directly());
}
/* static */
@ -1141,14 +1144,15 @@ int32_t gfxPlatform::MaxAllocSize() {
// Make sure we don't completely break rendering because of a typo in the
// pref or whatnot.
const int32_t kMinAllocPref = 10000000;
return std::max(kMinAllocPref, StaticPrefs::MaxAllocSizeDoNotUseDirectly());
return std::max(kMinAllocPref,
StaticPrefs::gfx_max_alloc_size_do_not_use_directly());
}
/* static */
void gfxPlatform::InitMoz2DLogging() {
auto fwd = new CrashStatsLogForwarder(
CrashReporter::Annotation::GraphicsCriticalError);
fwd->SetCircularBufferSize(StaticPrefs::GfxLoggingCrashLength());
fwd->SetCircularBufferSize(StaticPrefs::gfx_logging_crash_length());
mozilla::gfx::Config cfg;
cfg.mLogForwarder = fwd;
@ -1985,12 +1989,12 @@ bool gfxPlatform::OffMainThreadCompositingEnabled() {
eCMSMode gfxPlatform::GetCMSMode() {
if (!gCMSInitialized) {
int32_t mode = StaticPrefs::CMSMode();
int32_t mode = StaticPrefs::gfx_color_management_mode();
if (mode >= 0 && mode < eCMSMode_AllCount) {
gCMSMode = static_cast<eCMSMode>(mode);
}
bool enableV4 = StaticPrefs::CMSEnableV4();
bool enableV4 = StaticPrefs::gfx_color_management_enablev4();
if (enableV4) {
qcms_enable_iccv4();
}
@ -2012,7 +2016,7 @@ int gfxPlatform::GetRenderingIntent() {
MOZ_ASSERT(QCMS_INTENT_DEFAULT == 0);
/* Try to query the pref system for a rendering intent. */
int32_t pIntent = StaticPrefs::CMSRenderingIntent();
int32_t pIntent = StaticPrefs::gfx_color_management_rendering_intent();
if ((pIntent < QCMS_INTENT_MIN) || (pIntent > QCMS_INTENT_MAX)) {
/* If the pref is out of range, use embedded profile. */
pIntent = -1;
@ -2436,7 +2440,7 @@ void gfxPlatform::InitAcceleration() {
"media.hardware-video-decoding.failed");
InitGPUProcessPrefs();
gfxVars::SetRemoteCanvasEnabled(StaticPrefs::CanvasRemote() &&
gfxVars::SetRemoteCanvasEnabled(StaticPrefs::gfx_canvas_remote() &&
gfxConfig::IsEnabled(Feature::GPU_PROCESS));
}
}
@ -2478,7 +2482,7 @@ void gfxPlatform::InitGPUProcessPrefs() {
NS_LITERAL_CSTRING("FEATURE_FAILURE_SAFE_MODE"));
return;
}
if (StaticPrefs::LayerScopeEnabled()) {
if (StaticPrefs::gfx_layerscope_enabled()) {
gpuProc.ForceDisable(FeatureStatus::Blocked,
"LayerScope does not work in the GPU process",
NS_LITERAL_CSTRING("FEATURE_FAILURE_LAYERSCOPE"));
@ -2534,8 +2538,8 @@ void gfxPlatform::InitCompositorAccelerationPrefs() {
/*static*/
bool gfxPlatform::WebRenderPrefEnabled() {
return StaticPrefs::WebRenderAll() ||
StaticPrefs::WebRenderEnabledDoNotUseDirectly();
return StaticPrefs::gfx_webrender_all() ||
StaticPrefs::gfx_webrender_enabled_do_not_use_directly();
}
/*static*/
@ -2884,7 +2888,8 @@ void gfxPlatform::InitWebRenderConfig() {
// If the user set the pref to force-disable, let's do that. This will
// override all the other enabling prefs (gfx.webrender.enabled,
// gfx.webrender.all, and gfx.webrender.all.qualified).
if (StaticPrefs::WebRenderForceDisabled() || WebRenderEnvvarDisabled()) {
if (StaticPrefs::gfx_webrender_force_disabled() ||
WebRenderEnvvarDisabled()) {
featureWebRender.UserDisable(
"User force-disabled WR",
NS_LITERAL_CSTRING("FEATURE_FAILURE_USER_FORCE_DISABLED"));
@ -3322,7 +3327,7 @@ class FrameStatsComparator {
};
void gfxPlatform::NotifyFrameStats(nsTArray<FrameStats>&& aFrameStats) {
if (!StaticPrefs::LoggingSlowFramesEnabled()) {
if (!StaticPrefs::gfx_logging_slow_frames_enabled()) {
return;
}
@ -3363,7 +3368,9 @@ bool gfxPlatform::AsyncPanZoomEnabled() {
}
/*static*/
bool gfxPlatform::PerfWarnings() { return StaticPrefs::PerfWarnings(); }
bool gfxPlatform::PerfWarnings() {
return StaticPrefs::gfx_perf_warnings_enabled();
}
void gfxPlatform::GetAcceleratedCompositorBackends(
nsTArray<LayersBackend>& aBackends) {

Просмотреть файл

@ -675,7 +675,7 @@ class gfxPlatform : public mozilla::layers::MemoryPressureListener {
mozilla::gfx::SurfaceFormat aFormat);
/**
* Wrapper around StaticPrefs::PerfWarnings().
* Wrapper around StaticPrefs::gfx_perf_warnings_enabled().
* Extracted into a function to avoid including StaticPrefs.h from this file.
*/
static bool PerfWarnings();

Просмотреть файл

@ -418,7 +418,7 @@ nsresult gfxPlatformFontList::InitFontList() {
// Try to initialize the cross-process shared font list if enabled by prefs,
// but not if we're running in Safe Mode.
if (StaticPrefs::SharedFontList() && !gfxPlatform::InSafeMode()) {
if (StaticPrefs::gfx_e10s_font_list_shared() && !gfxPlatform::InSafeMode()) {
for (auto i = mFontEntries.Iter(); !i.Done(); i.Next()) {
i.Data()->mShmemCharacterMap = nullptr;
i.Data()->mShmemFace = nullptr;

Просмотреть файл

@ -185,11 +185,13 @@ class MOZ_STACK_CLASS gfxOTSContext : public ots::OTSContext {
public:
gfxOTSContext() {
// Whether to apply OTS validation to OpenType Layout tables
mCheckOTLTables = StaticPrefs::ValidateOTLTables();
mCheckOTLTables = StaticPrefs::gfx_downloadable_fonts_otl_validation();
// Whether to preserve Variation tables in downloaded fonts
mCheckVariationTables = StaticPrefs::ValidateVariationTables();
mCheckVariationTables =
StaticPrefs::gfx_downloadable_fonts_validate_variation_tables();
// Whether to preserve color bitmap glyphs
mKeepColorBitmaps = StaticPrefs::KeepColorBitmaps();
mKeepColorBitmaps =
StaticPrefs::gfx_downloadable_fonts_keep_color_bitmaps();
}
virtual ~gfxOTSContext() {

Просмотреть файл

@ -1470,14 +1470,15 @@ bool gfxUtils::DumpDisplayList() {
wr::RenderRoot gfxUtils::GetContentRenderRoot() {
if (gfx::gfxVars::UseWebRender() &&
StaticPrefs::WebRenderSplitRenderRoots()) {
StaticPrefs::gfx_webrender_split_render_roots()) {
return wr::RenderRoot::Content;
}
return wr::RenderRoot::Default;
}
Maybe<wr::RenderRoot> gfxUtils::GetRenderRootForFrame(const nsIFrame* aFrame) {
if (!gfxVars::UseWebRender() || !StaticPrefs::WebRenderSplitRenderRoots()) {
if (!gfxVars::UseWebRender() ||
!StaticPrefs::gfx_webrender_split_render_roots()) {
return Nothing();
}
if (!aFrame->GetContent()) {
@ -1494,7 +1495,8 @@ Maybe<wr::RenderRoot> gfxUtils::GetRenderRootForElement(
if (!aElement) {
return Nothing();
}
if (!gfxVars::UseWebRender() || !StaticPrefs::WebRenderSplitRenderRoots()) {
if (!gfxVars::UseWebRender() ||
!StaticPrefs::gfx_webrender_split_render_roots()) {
return Nothing();
}
if (!aElement->IsXULElement()) {
@ -1509,7 +1511,8 @@ Maybe<wr::RenderRoot> gfxUtils::GetRenderRootForElement(
wr::RenderRoot gfxUtils::RecursivelyGetRenderRootForFrame(
const nsIFrame* aFrame) {
if (!gfxVars::UseWebRender() || !StaticPrefs::WebRenderSplitRenderRoots()) {
if (!gfxVars::UseWebRender() ||
!StaticPrefs::gfx_webrender_split_render_roots()) {
return wr::RenderRoot::Default;
}

Просмотреть файл

@ -1543,8 +1543,8 @@ void gfxWindowsPlatform::InitializeD2DConfig() {
return;
}
d2d1.SetDefaultFromPref(StaticPrefs::GetDirect2DDisabledPrefName(), false,
StaticPrefs::GetDirect2DDisabledPrefDefault());
d2d1.SetDefaultFromPref(StaticPrefs::Getgfx_direct2d_disabledPrefName(), false,
StaticPrefs::Getgfx_direct2d_disabledPrefDefault());
nsCString message;
nsCString failureId;
@ -1553,7 +1553,7 @@ void gfxWindowsPlatform::InitializeD2DConfig() {
d2d1.Disable(FeatureStatus::Blacklisted, message.get(), failureId);
}
if (!d2d1.IsEnabled() && StaticPrefs::Direct2DForceEnabled()) {
if (!d2d1.IsEnabled() && StaticPrefs::gfx_direct2d_force_enabled()) {
d2d1.UserForceEnable("Force-enabled via user-preference");
}
}

Просмотреть файл

@ -96,7 +96,7 @@ void VRDisplayClient::FireEvents() {
// Check if we need to trigger onvrdisplayactivate event
if (!bLastEventWasMounted && mDisplayInfo.mDisplayState.isMounted) {
bLastEventWasMounted = true;
if (StaticPrefs::VRAutoActivateEnabled()) {
if (StaticPrefs::dom_vr_autoactivate_enabled()) {
vm->FireDOMVRDisplayMountedEvent(mDisplayInfo.mDisplayID);
}
}
@ -104,7 +104,7 @@ void VRDisplayClient::FireEvents() {
// Check if we need to trigger onvrdisplaydeactivate event
if (bLastEventWasMounted && !mDisplayInfo.mDisplayState.isMounted) {
bLastEventWasMounted = false;
if (StaticPrefs::VRAutoActivateEnabled()) {
if (StaticPrefs::dom_vr_autoactivate_enabled()) {
vm->FireDOMVRDisplayUnmountedEvent(mDisplayInfo.mDisplayID);
}
}

Просмотреть файл

@ -268,7 +268,8 @@ void VRDisplayHost::CheckWatchDog() {
bShouldStartFrame = true;
} else {
TimeDuration duration = TimeStamp::Now() - lastFrameStart;
if (duration.ToMilliseconds() > StaticPrefs::VRDisplayRafMaxDuration()) {
if (duration.ToMilliseconds() >
StaticPrefs::dom_vr_display_rafMaxDuration()) {
bShouldStartFrame = true;
}
}

Просмотреть файл

@ -79,7 +79,7 @@ VRManager::VRManager()
#if !defined(MOZ_WIDGET_ANDROID)
// The VR Service accesses all hardware from a separate process
// and replaces the other VRSystemManager when enabled.
if (!StaticPrefs::VRProcessEnabled() || !XRE_IsGPUProcess()) {
if (!StaticPrefs::dom_vr_process_enabled() || !XRE_IsGPUProcess()) {
VRServiceManager::Get().CreateService();
}
if (VRServiceManager::Get().IsServiceValid()) {
@ -144,7 +144,7 @@ void VRManager::Shutdown() {
}
// XRE_IsGPUProcess() is helping us to check some platforms like
// Win 7 try which are not using GPU process but VR process is enabled.
if (XRE_IsGPUProcess() && StaticPrefs::VRProcessEnabled() &&
if (XRE_IsGPUProcess() && StaticPrefs::dom_vr_process_enabled() &&
mVRServiceStarted) {
RefPtr<Runnable> task = NS_NewRunnableFunction(
"VRServiceManager::ShutdownVRProcess",
@ -388,7 +388,7 @@ void VRManager::CheckForInactiveTimeout() {
Shutdown();
} else {
TimeDuration duration = TimeStamp::Now() - mLastActiveTime;
if (duration.ToMilliseconds() > StaticPrefs::VRInactiveTimeout()) {
if (duration.ToMilliseconds() > StaticPrefs::dom_vr_inactive_timeout()) {
Shutdown();
// We must not throttle the next enumeration request
// after an idle timeout, as it may result in the
@ -419,11 +419,12 @@ void VRManager::EnumerateVRDisplays() {
StartTasks();
/**
* Throttle the rate of enumeration to the interval set in
* VRDisplayEnumerateInterval
* dom_vr_display_enumerate_interval.
*/
if (!mLastDisplayEnumerationTime.IsNull()) {
TimeDuration duration = TimeStamp::Now() - mLastDisplayEnumerationTime;
if (duration.ToMilliseconds() < StaticPrefs::VRDisplayEnumerateInterval()) {
if (duration.ToMilliseconds() <
StaticPrefs::dom_vr_display_enumerate_interval()) {
return;
}
}
@ -440,8 +441,8 @@ void VRManager::EnumerateVRDisplays() {
}
/**
* If we get this far, don't try again until
* the VRDisplayEnumerateInterval elapses
* If we get this far, don't try again until the
* dom_vr_display_enumerate_interval elapses.
*/
mLastDisplayEnumerationTime = TimeStamp::Now();
@ -456,7 +457,7 @@ void VRManager::EnumerateVRDisplays() {
*/
#if !defined(MOZ_WIDGET_ANDROID)
if (!mVRServiceStarted) {
if (XRE_IsGPUProcess() && StaticPrefs::VRProcessEnabled()) {
if (XRE_IsGPUProcess() && StaticPrefs::dom_vr_process_enabled()) {
VRServiceManager::Get().CreateVRProcess();
mVRServiceStarted = true;
} else {
@ -699,7 +700,7 @@ void VRManager::ScanForControllers() {
if (!mLastControllerEnumerationTime.IsNull()) {
TimeDuration duration = TimeStamp::Now() - mLastControllerEnumerationTime;
if (duration.ToMilliseconds() <
StaticPrefs::VRControllerEnumerateInterval()) {
StaticPrefs::dom_vr_controller_enumerate_interval()) {
return;
}
}

Просмотреть файл

@ -537,7 +537,7 @@ void VRSystemManagerExternal::OpenShmem() {
#elif defined(XP_WIN)
if (mShmemFile == NULL) {
if (StaticPrefs::VRProcessEnabled()) {
if (StaticPrefs::dom_vr_process_enabled()) {
mShmemFile =
CreateFileMappingA(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0,
sizeof(VRExternalShmem), kShmemName);
@ -639,7 +639,7 @@ already_AddRefed<VRSystemManagerExternal> VRSystemManagerExternal::Create(
return nullptr;
}
if ((!StaticPrefs::VRExternalEnabled() && aAPIShmem == nullptr)
if ((!StaticPrefs::dom_vr_external_enabled() && aAPIShmem == nullptr)
#if defined(XP_WIN)
|| !XRE_IsGPUProcess()
#endif

Просмотреть файл

@ -289,7 +289,7 @@ bool VRDisplayPuppet::SubmitFrame(ID3D11Texture2D* aSource,
VRManager* vm = VRManager::Get();
MOZ_ASSERT(vm);
switch (StaticPrefs::VRPuppetSubmitFrame()) {
switch (StaticPrefs::dom_vr_puppet_submitframe()) {
case 0:
// The VR frame is not displayed.
break;
@ -479,7 +479,7 @@ bool VRDisplayPuppet::SubmitFrame(MacIOSurface* aMacIOSurface,
VRManager* vm = VRManager::Get();
MOZ_ASSERT(vm);
switch (StaticPrefs::VRPuppetSubmitFrame()) {
switch (StaticPrefs::dom_vr_puppet_submitframe()) {
case 0:
// The VR frame is not displayed.
break;
@ -640,7 +640,7 @@ VRSystemManagerPuppet::VRSystemManagerPuppet()
/*static*/
already_AddRefed<VRSystemManagerPuppet> VRSystemManagerPuppet::Create() {
if (!StaticPrefs::dom_vr_enabled() || !StaticPrefs::VRPuppetEnabled()) {
if (!StaticPrefs::dom_vr_enabled() || !StaticPrefs::dom_vr_puppet_enabled()) {
return nullptr;
}

Просмотреть файл

@ -69,7 +69,7 @@ void VRProcessManager::LaunchVRProcess() {
}
void VRProcessManager::DisableVRProcess(const char* aMessage) {
if (!StaticPrefs::VRProcessEnabled()) {
if (!StaticPrefs::dom_vr_process_enabled()) {
return;
}
@ -279,4 +279,4 @@ RefPtr<MemoryReportingProcess> VRProcessManager::GetProcessMemoryReporter() {
}
} // namespace gfx
} // namespace mozilla
} // namespace mozilla

Просмотреть файл

@ -82,7 +82,7 @@ bool VRProcessParent::WaitForLaunch() {
return !!mVRChild;
}
int32_t timeoutMs = StaticPrefs::VRProcessTimeoutMs();
int32_t timeoutMs = StaticPrefs::dom_vr_process_startup_timeout_ms();
// If one of the following environment variables are set we can effectively
// ignore the timeout - as we can guarantee the compositor process will be

Просмотреть файл

@ -209,7 +209,7 @@ OSVRSession::OSVRSession()
OSVRSession::~OSVRSession() { Shutdown(); }
bool OSVRSession::Initialize(mozilla::gfx::VRSystemState& aSystemState) {
if (!StaticPrefs::dom_vr_enabled() || !StaticPrefs::VROSVREnabled()) {
if (!StaticPrefs::dom_vr_enabled() || !StaticPrefs::dom_vr_osvr_enabled()) {
return false;
}
if (mOSVRInitialized) {

Просмотреть файл

@ -206,7 +206,7 @@ OculusSession::OculusSession()
OculusSession::~OculusSession() { Shutdown(); }
bool OculusSession::Initialize(mozilla::gfx::VRSystemState& aSystemState) {
if (!StaticPrefs::dom_vr_enabled() || !StaticPrefs::VROculusEnabled()) {
if (!StaticPrefs::dom_vr_enabled() || !StaticPrefs::dom_vr_oculus_enabled()) {
return false;
}
@ -256,8 +256,8 @@ void OculusSession::UpdateVisibility() {
}
TimeDuration duration = TimeStamp::Now() - mLastPresentationEnd;
TimeDuration timeout =
TimeDuration::FromMilliseconds(StaticPrefs::VROculusPresentTimeout());
TimeDuration timeout = TimeDuration::FromMilliseconds(
StaticPrefs::dom_vr_oculus_present_timeout());
if (timeout <= TimeDuration(0) || duration >= timeout) {
if (!ChangeVisibility(false)) {
gfxWarning() << "OculusSession::ChangeVisibility(false) failed";
@ -293,7 +293,7 @@ void OculusSession::CoverTransitions() {
bool OculusSession::ChangeVisibility(bool bVisible) {
ovrInitFlags flags =
(ovrInitFlags)(ovrInit_RequestVersion | ovrInit_MixedRendering);
if (StaticPrefs::VROculusInvisibleEnabled() && !bVisible) {
if (StaticPrefs::dom_vr_oculus_invisible_enabled() && !bVisible) {
flags = (ovrInitFlags)(flags | ovrInit_Invisible);
}
if (mInitFlags == flags) {
@ -1153,7 +1153,7 @@ void OculusSession::UpdateHeadsetPose(VRSystemState& aState) {
return;
}
double predictedFrameTime = 0.0f;
if (StaticPrefs::VRPosePredictionEnabled()) {
if (StaticPrefs::dom_vr_poseprediction_enabled()) {
// XXX We might need to call ovr_GetPredictedDisplayTime even if we don't
// use the result. If we don't call it, the Oculus driver will spew out many
// warnings...
@ -1324,7 +1324,8 @@ void OculusSession::EnumerateControllers(VRSystemState& aState,
void OculusSession::UpdateControllerInputs(VRSystemState& aState,
const ovrInputState& aInputState) {
const float triggerThreshold = StaticPrefs::VRControllerTriggerThreshold();
const float triggerThreshold =
StaticPrefs::dom_vr_controller_trigger_threshold();
for (uint32_t handIdx = 0; handIdx < 2; handIdx++) {
// Left Touch Controller will always be at index 0 and

Просмотреть файл

@ -250,7 +250,7 @@ OpenVRSession::~OpenVRSession() {
}
bool OpenVRSession::Initialize(mozilla::gfx::VRSystemState& aSystemState) {
if (!StaticPrefs::dom_vr_enabled() || !StaticPrefs::VROpenVREnabled()) {
if (!StaticPrefs::dom_vr_enabled() || !StaticPrefs::dom_vr_openvr_enabled()) {
return false;
}
if (mVRSystem != nullptr) {
@ -306,7 +306,7 @@ bool OpenVRSession::Initialize(mozilla::gfx::VRSystemState& aSystemState) {
return false;
}
if (StaticPrefs::VROpenVRActionInputEnabled() && !SetupContollerActions()) {
if (StaticPrefs::dom_vr_openvr_action_input() && !SetupContollerActions()) {
return false;
}
@ -326,7 +326,7 @@ bool OpenVRSession::SetupContollerActions() {
nsCString knucklesManifest;
// Getting / Generating manifest file paths.
if (StaticPrefs::VRProcessEnabled()) {
if (StaticPrefs::dom_vr_process_enabled()) {
VRParent* vrParent = VRProcessChild::GetVRParent();
nsCString output;
@ -769,7 +769,7 @@ bool OpenVRSession::SetupContollerActions() {
// End of setup controller actions.
// Notify the parent process these manifest files are already been recorded.
if (StaticPrefs::VRProcessEnabled()) {
if (StaticPrefs::dom_vr_process_enabled()) {
NS_DispatchToMainThread(NS_NewRunnableFunction(
"SendOpenVRControllerActionPathToParent",
[controllerAction, viveManifest, WMRManifest, knucklesManifest]() {
@ -1307,7 +1307,8 @@ void OpenVRSession::UpdateControllerButtons(VRSystemState& aState) {
// value. In order to not affect the current VR content, we add a workaround
// for yAxis.
const float yAxisInvert = (mIsWindowsMR) ? -1.0f : 1.0f;
const float triggerThreshold = StaticPrefs::VRControllerTriggerThreshold();
const float triggerThreshold =
StaticPrefs::dom_vr_controller_trigger_threshold();
for (uint32_t stateIndex = 0; stateIndex < kVRControllerMaxCount;
++stateIndex) {
@ -1633,7 +1634,8 @@ void OpenVRSession::UpdateControllerButtonsObsolete(VRSystemState& aState) {
// value. In order to not affect the current VR content, we add a workaround
// for yAxis.
const float yAxisInvert = (mIsWindowsMR) ? -1.0f : 1.0f;
const float triggerThreshold = StaticPrefs::VRControllerTriggerThreshold();
const float triggerThreshold =
StaticPrefs::dom_vr_controller_trigger_threshold();
for (uint32_t stateIndex = 0; stateIndex < kVRControllerMaxCount;
stateIndex++) {
@ -1935,7 +1937,7 @@ void OpenVRSession::StartFrame(mozilla::gfx::VRSystemState& aSystemState) {
UpdateHeadsetPose(aSystemState);
UpdateEyeParameters(aSystemState);
if (StaticPrefs::VROpenVRActionInputEnabled()) {
if (StaticPrefs::dom_vr_openvr_action_input()) {
EnumerateControllers(aSystemState);
vr::VRActiveActionSet_t actionSet = {0};
@ -2147,7 +2149,7 @@ void OpenVRSession::HapticTimerCallback(nsITimer* aTimer, void* aClosure) {
*/
OpenVRSession* self = static_cast<OpenVRSession*>(aClosure);
if (StaticPrefs::VROpenVRActionInputEnabled()) {
if (StaticPrefs::dom_vr_openvr_action_input()) {
self->UpdateHaptics();
} else {
self->UpdateHapticsObsolete();

Просмотреть файл

@ -52,7 +52,7 @@ bool IsImmersiveContentActive(const mozilla::gfx::VRBrowserState& aState) {
already_AddRefed<VRService> VRService::Create() {
MOZ_ASSERT(NS_IsMainThread());
if (!StaticPrefs::VRServiceEnabled()) {
if (!StaticPrefs::dom_vr_service_enabled()) {
return nullptr;
}
@ -73,7 +73,7 @@ VRService::VRService()
#if defined(XP_WIN)
mMutex(NULL),
#endif
mVRProcessEnabled(StaticPrefs::VRProcessEnabled()) {
mVRProcessEnabled(StaticPrefs::dom_vr_process_enabled()) {
// When we have the VR process, we map the memory
// of mAPIShmem from GPU process.
// If we don't have the VR process, we will instantiate
@ -292,7 +292,7 @@ void VRService::ServiceInitialize() {
memset(&mSystemState, 0, sizeof(mSystemState));
mSystemState.enumerationCompleted = true;
mSystemState.displayState.minRestartInterval =
StaticPrefs::VRExternalNotDetectedTimeout();
StaticPrefs::dom_vr_external_notdetected_timeout();
mSystemState.displayState.shutdown = true;
PushState(mSystemState);
}
@ -309,7 +309,7 @@ void VRService::ServiceShutdown() {
mSystemState.displayState.shutdown = true;
if (mSession && mSession->ShouldQuit()) {
mSystemState.displayState.minRestartInterval =
StaticPrefs::VRExternalQuitTimeout();
StaticPrefs::dom_vr_external_quit_timeout();
}
PushState(mSystemState);
mSession = nullptr;

Просмотреть файл

@ -66,7 +66,8 @@ class VRService {
#if defined(XP_WIN)
HANDLE mMutex;
#endif
// We store the value of StaticPrefs::VRProcessEnabled() in mVRProcessEnabled.
// We store the value of StaticPrefs::dom_vr_process_enabled() in
// mVRProcessEnabled.
bool mVRProcessEnabled;
bool IsInServiceThread();

Просмотреть файл

@ -46,7 +46,7 @@ void VRServiceManager::ShutdownVRProcess() {
}
VRGPUChild::Shutdown();
}
if (StaticPrefs::VRProcessEnabled()) {
if (StaticPrefs::dom_vr_process_enabled()) {
// Using PGPU channel to tell the main process
// to shutdown VR process.
gfx::GPUParent* gpu = GPUParent::GetSingleton();
@ -56,7 +56,7 @@ void VRServiceManager::ShutdownVRProcess() {
}
void VRServiceManager::CreateService() {
if (!StaticPrefs::VRProcessEnabled()) {
if (!StaticPrefs::dom_vr_process_enabled()) {
mVRService = VRService::Create();
}
}
@ -94,4 +94,4 @@ VRExternalShmem* VRServiceManager::GetAPIShmem() {
}
} // namespace gfx
} // namespace mozilla
} // namespace mozilla

Просмотреть файл

@ -437,7 +437,7 @@ static bool Moz2DRenderCallback(const Range<const uint8_t> aBlob,
offset = extra_end;
}
if (StaticPrefs::WebRenderBlobPaintFlashing()) {
if (StaticPrefs::gfx_webrender_blob_paint_flashing()) {
dt->SetTransform(gfx::Matrix());
float r = float(rand()) / RAND_MAX;
float g = float(rand()) / RAND_MAX;

Просмотреть файл

@ -77,8 +77,9 @@ class NewRenderer : public RendererEvent {
if (!wr_window_new(
aWindowId, mSize.width, mSize.height,
supportLowPriorityTransactions,
StaticPrefs::WebRenderPictureCaching() && supportPictureCaching,
StaticPrefs::WebRenderStartDebugServer(), compositor->gl(),
StaticPrefs::gfx_webrender_picture_caching() &&
supportPictureCaching,
StaticPrefs::gfx_webrender_start_debug_server(), compositor->gl(),
aRenderThread.GetProgramCache()
? aRenderThread.GetProgramCache()->Raw()
: nullptr,

Просмотреть файл

@ -77,7 +77,7 @@ void ConvertYCbCrToRGB32(const uint8* y_buf, const uint8* u_buf,
//
// The function is still fast on some old intel chips.
// See Bug 1256475.
bool use_deprecated = StaticPrefs::YCbCrAccurateConversion() ||
bool use_deprecated = StaticPrefs::gfx_ycbcr_accurate_conversion() ||
(supports_mmx() && supports_sse() && !supports_sse3() &&
yuv_color_space == YUVColorSpace::BT601);
// The deprecated function only support BT601.
@ -291,14 +291,13 @@ void ScaleYCbCrToRGB32(const uint8* y_buf,
YUVType yuv_type,
YUVColorSpace yuv_color_space,
ScaleFilter filter) {
bool use_deprecated =
StaticPrefs::YCbCrAccurateConversion() ||
StaticPrefs::gfx_ycbcr_accurate_conversion() ||
#if defined(XP_WIN) && defined(_M_X64)
// libyuv does not support SIMD scaling on win 64bit. See Bug 1295927.
supports_sse3() ||
// libyuv does not support SIMD scaling on win 64bit. See Bug 1295927.
supports_sse3() ||
#endif
(supports_mmx() && supports_sse() && !supports_sse3());
(supports_mmx() && supports_sse() && !supports_sse3());
// The deprecated function only support BT601.
// See Bug 1210357.
if (yuv_color_space != YUVColorSpace::BT601) {

Просмотреть файл

@ -35,9 +35,10 @@ AnimationSurfaceProvider::AnimationSurfaceProvider(
// enter decode-on-demand mode.
IntSize frameSize = aSurfaceKey.Size();
size_t threshold =
(size_t(StaticPrefs::ImageAnimatedDecodeOnDemandThresholdKB()) * 1024) /
(size_t(StaticPrefs::image_animated_decode_on_demand_threshold_kb()) *
1024) /
(sizeof(uint32_t) * frameSize.width * frameSize.height);
size_t batch = StaticPrefs::ImageAnimatedDecodeOnDemandBatchSize();
size_t batch = StaticPrefs::image_animated_decode_on_demand_batch_size();
mFrames.reset(
new AnimationFrameRetainedBuffer(threshold, batch, aCurrentFrame));
@ -407,7 +408,7 @@ void AnimationSurfaceProvider::RequestFrameDiscarding() {
static_cast<AnimationFrameRetainedBuffer*>(mFrames.get());
MOZ_ASSERT(!mDecoder->GetFrameRecycler());
if (StaticPrefs::ImageAnimatedDecodeOnDemandRecycle()) {
if (StaticPrefs::image_animated_decode_on_demand_recycle()) {
mFrames.reset(new AnimationFrameRecyclingQueue(std::move(*oldFrameQueue)));
mDecoder->SetFrameRecycler(this);
} else {
@ -464,7 +465,8 @@ bool AnimationSurfaceProvider::ShouldPreferSyncRun() const {
MutexAutoLock lock(mDecodingMutex);
MOZ_ASSERT(mDecoder);
return mDecoder->ShouldSyncDecode(StaticPrefs::ImageMemDecodeBytesAtATime());
return mDecoder->ShouldSyncDecode(
StaticPrefs::image_mem_decode_bytes_at_a_time());
}
RawAccessFrameRef AnimationSurfaceProvider::RecycleFrame(

Просмотреть файл

@ -353,7 +353,7 @@ class IOThreadIniter final : public Runnable {
DecodePool::DecodePool() : mMutex("image::IOThread") {
// Determine the number of threads we want.
int32_t prefLimit = StaticPrefs::ImageMTDecodingLimit();
int32_t prefLimit = StaticPrefs::image_multithreaded_decoding_limit();
uint32_t limit;
if (prefLimit <= 0) {
int32_t numCores = NumberOfCores();
@ -383,7 +383,8 @@ DecodePool::DecodePool() : mMutex("image::IOThread") {
uint32_t idleLimit;
// The timeout period before shutting down idle threads.
int32_t prefIdleTimeout = StaticPrefs::ImageMTDecodingIdleTimeout();
int32_t prefIdleTimeout =
StaticPrefs::image_multithreaded_decoding_idle_timeout();
TimeDuration idleTimeout;
if (prefIdleTimeout <= 0) {
idleTimeout = TimeDuration::Forever();

Просмотреть файл

@ -200,7 +200,8 @@ void DecodedSurfaceProvider::FinishDecoding() {
}
bool DecodedSurfaceProvider::ShouldPreferSyncRun() const {
return mDecoder->ShouldSyncDecode(StaticPrefs::ImageMemDecodeBytesAtATime());
return mDecoder->ShouldSyncDecode(
StaticPrefs::image_mem_decode_bytes_at_a_time());
}
} // namespace image

Просмотреть файл

@ -74,7 +74,7 @@ DecoderType DecoderFactory::GetDecoderType(const char* aMimeType) {
// WebP
} else if (!strcmp(aMimeType, IMAGE_WEBP) &&
StaticPrefs::ImageWebPEnabled()) {
StaticPrefs::image_webp_enabled()) {
type = DecoderType::WEBP;
}

Просмотреть файл

@ -86,7 +86,7 @@ const gfx::IntRect AnimationState::UpdateStateInternal(
} else if (aResult.Type() == MatchType::NOT_FOUND ||
aResult.Type() == MatchType::PENDING) {
if (mHasRequestedDecode) {
MOZ_ASSERT(StaticPrefs::ImageMemAnimatedDiscardable());
MOZ_ASSERT(StaticPrefs::image_mem_animated_discardable());
mCompositedFrameInvalid = true;
}
}
@ -138,7 +138,7 @@ void AnimationState::SetAnimationFrameTime(const TimeStamp& aTime) {
}
bool AnimationState::MaybeAdvanceAnimationFrameTime(const TimeStamp& aTime) {
if (!StaticPrefs::ImageAnimatedResumeFromLastDisplayed() ||
if (!StaticPrefs::image_animated_resume_from_last_displayed() ||
mCurrentAnimationFrameTime >= aTime) {
return false;
}
@ -379,7 +379,7 @@ RefreshResult FrameAnimator::RequestRefresh(AnimationState& aState,
// only advance the frame if the current time is greater than or
// equal to the current frame's end time.
if (!currentFrame) {
MOZ_ASSERT(StaticPrefs::ImageMemAnimatedDiscardable());
MOZ_ASSERT(StaticPrefs::image_mem_animated_discardable());
MOZ_ASSERT(aState.GetHasRequestedDecode() &&
!aState.GetIsCurrentlyDecoded());
MOZ_ASSERT(aState.mCompositedFrameInvalid);
@ -451,7 +451,7 @@ LookupResult FrameAnimator::GetCompositedFrame(AnimationState& aState,
aMarkUsed);
if (aState.mCompositedFrameInvalid) {
MOZ_ASSERT(StaticPrefs::ImageMemAnimatedDiscardable());
MOZ_ASSERT(StaticPrefs::image_mem_animated_discardable());
MOZ_ASSERT(aState.GetHasRequestedDecode());
MOZ_ASSERT(!aState.GetIsCurrentlyDecoded());
if (result.Type() == MatchType::NOT_FOUND) {

Просмотреть файл

@ -80,7 +80,7 @@ class AnimationState {
* Sets the composited frame as valid or invalid.
*/
void SetCompositedFrameInvalid(bool aInvalid) {
MOZ_ASSERT(!aInvalid || StaticPrefs::ImageMemAnimatedDiscardable());
MOZ_ASSERT(!aInvalid || StaticPrefs::image_mem_animated_discardable());
mCompositedFrameInvalid = aInvalid;
}

Просмотреть файл

@ -37,8 +37,8 @@ static uint32_t ComputeImageFlags(nsIURI* uri, const nsCString& aMimeType,
nsresult rv;
// We default to the static globals.
bool isDiscardable = StaticPrefs::ImageMemDiscardable();
bool doDecodeImmediately = StaticPrefs::ImageDecodeImmediatelyEnabled();
bool isDiscardable = StaticPrefs::image_mem_discardable();
bool doDecodeImmediately = StaticPrefs::image_decode_immediately_enabled();
// We want UI to be as snappy as possible and not to flicker. Disable
// discarding for chrome URLS.

Просмотреть файл

@ -97,7 +97,7 @@ void ImageMemoryReporter::ReportSharedSurface(
path.AppendLiteral("/");
}
if (StaticPrefs::ImageMemDebugReporting()) {
if (StaticPrefs::image_mem_debug_reporting()) {
path.AppendInt(aExternalId, 16);
path.AppendLiteral("/");
}
@ -137,7 +137,7 @@ void ImageMemoryReporter::AppendSharedSurfacePrefix(
if (extId) {
auto gpuEntry = aSharedSurfaces.mSurfaces.find(extId);
if (StaticPrefs::ImageMemDebugReporting()) {
if (StaticPrefs::image_mem_debug_reporting()) {
aPathPrefix.AppendLiteral(", external_id:");
aPathPrefix.AppendInt(extId, 16);
if (gpuEntry != aSharedSurfaces.mSurfaces.end()) {

Просмотреть файл

@ -347,7 +347,7 @@ LookupResult RasterImage::LookupFrame(const IntSize& aSize, uint32_t aFlags,
// one. (Or we're sync decoding and the existing decoder hasn't even started
// yet.) Trigger decoding so it'll be available next time.
MOZ_ASSERT(aPlaybackType != PlaybackType::eAnimated ||
StaticPrefs::ImageMemAnimatedDiscardable() ||
StaticPrefs::image_mem_animated_discardable() ||
!mAnimationState || mAnimationState->KnownFrameCount() < 1,
"Animated frames should be locked");
@ -415,7 +415,7 @@ RasterImage::WillDrawOpaqueNow() {
}
if (mAnimationState) {
if (!StaticPrefs::ImageMemAnimatedDiscardable()) {
if (!StaticPrefs::image_mem_animated_discardable()) {
// We never discard frames of animated images.
return true;
} else {
@ -471,7 +471,7 @@ void RasterImage::OnSurfaceDiscardedInternal(bool aAnimatedFramesDiscarded) {
MOZ_ASSERT(NS_IsMainThread());
if (aAnimatedFramesDiscarded && mAnimationState) {
MOZ_ASSERT(StaticPrefs::ImageMemAnimatedDiscardable());
MOZ_ASSERT(StaticPrefs::image_mem_animated_discardable());
ReleaseImageContainer();
gfx::IntRect rect =
mAnimationState->UpdateState(mAnimationFinished, this, mSize);
@ -716,7 +716,7 @@ bool RasterImage::SetMetadata(const ImageMetadata& aMetadata,
mAnimationState.emplace(mAnimationMode);
mFrameAnimator = MakeUnique<FrameAnimator>(this, mSize);
if (!StaticPrefs::ImageMemAnimatedDiscardable()) {
if (!StaticPrefs::image_mem_animated_discardable()) {
// We don't support discarding animated images (See bug 414259).
// Lock the image and throw away the key.
LockImage();
@ -1020,7 +1020,7 @@ RasterImage::GetKeys(nsTArray<nsCString>& keys) {
void RasterImage::Discard() {
MOZ_ASSERT(NS_IsMainThread());
MOZ_ASSERT(CanDiscard(), "Asked to discard but can't");
MOZ_ASSERT(!mAnimationState || StaticPrefs::ImageMemAnimatedDiscardable(),
MOZ_ASSERT(!mAnimationState || StaticPrefs::image_mem_animated_discardable(),
"Asked to discard for animated image");
// Delete all the decoded frames.
@ -1042,7 +1042,7 @@ void RasterImage::Discard() {
bool RasterImage::CanDiscard() {
return mAllSourceData &&
// Can discard animated images if the pref is set
(!mAnimationState || StaticPrefs::ImageMemAnimatedDiscardable());
(!mAnimationState || StaticPrefs::image_mem_animated_discardable());
}
NS_IMETHODIMP
@ -1320,7 +1320,7 @@ bool RasterImage::CanDownscaleDuringDecode(const IntSize& aSize,
// available, this image isn't transient, we have all the source data and know
// our size, and the flags allow us to do it.
if (!mHasSize || mTransient || !HaveSkia() ||
!StaticPrefs::ImageDownscaleDuringDecodeEnabled() ||
!StaticPrefs::image_downscale_during_decode_enabled() ||
!(aFlags & imgIContainer::FLAG_HIGH_QUALITY_SCALING)) {
return false;
}

Просмотреть файл

@ -410,7 +410,7 @@ class ImageSurfaceCache {
// Typically an image cache will not have too many size-varying surfaces, so
// if we exceed the given threshold, we should consider using a subset.
int32_t thresholdSurfaces =
StaticPrefs::ImageCacheFactor2ThresholdSurfaces();
StaticPrefs::image_cache_factor2_threshold_surfaces();
if (thresholdSurfaces < 0 ||
mSurfaces.Count() <= static_cast<uint32_t>(thresholdSurfaces)) {
return;
@ -1056,7 +1056,7 @@ class SurfaceCacheImpl final : public nsIMemoryReporter {
// difference between this and UnlockImage.)
DoUnlockSurfaces(
WrapNotNull(cache),
/* aStaticOnly = */ !StaticPrefs::ImageMemAnimatedDiscardable(),
/* aStaticOnly = */ !StaticPrefs::image_mem_animated_discardable(),
aAutoLock);
}
@ -1378,17 +1378,18 @@ void SurfaceCache::Initialize() {
// Length of time before an unused surface is removed from the cache, in
// milliseconds.
uint32_t surfaceCacheExpirationTimeMS =
StaticPrefs::ImageMemSurfaceCacheMinExpirationMS();
StaticPrefs::image_mem_surfacecache_min_expiration_ms();
// What fraction of the memory used by the surface cache we should discard
// when we get a memory pressure notification. This value is interpreted as
// 1/N, so 1 means to discard everything, 2 means to discard about half of the
// memory we're using, and so forth. We clamp it to avoid division by zero.
uint32_t surfaceCacheDiscardFactor =
max(StaticPrefs::ImageMemSurfaceCacheDiscardFactor(), 1u);
max(StaticPrefs::image_mem_surfacecache_discard_factor(), 1u);
// Maximum size of the surface cache, in kilobytes.
uint64_t surfaceCacheMaxSizeKB = StaticPrefs::ImageMemSurfaceCacheMaxSizeKB();
uint64_t surfaceCacheMaxSizeKB =
StaticPrefs::image_mem_surfacecache_max_size_kb();
// A knob determining the actual size of the surface cache. Currently the
// cache is (size of main memory) / (surface cache size factor) KB
@ -1399,7 +1400,7 @@ void SurfaceCache::Initialize() {
// of memory, which would yield a 64MB cache on this setting.
// We clamp this value to avoid division by zero.
uint32_t surfaceCacheSizeFactor =
max(StaticPrefs::ImageMemSurfaceCacheSizeFactor(), 1u);
max(StaticPrefs::image_mem_surfacecache_size_factor(), 1u);
// Compute the size of the surface cache.
uint64_t memorySize = PR_GetPhysicalMemorySize();
@ -1637,7 +1638,8 @@ IntSize SurfaceCache::ClampVectorSize(const IntSize& aSize) {
// It shouldn't get here if it is significantly larger because
// VectorImage::UseSurfaceCacheForSize should prevent us from requesting
// a rasterized version of a surface greater than 4x the maximum.
int32_t maxSizeKB = StaticPrefs::ImageCacheMaxRasterizedSVGThresholdKB();
int32_t maxSizeKB =
StaticPrefs::image_cache_max_rasterized_svg_threshold_kb();
if (maxSizeKB <= 0) {
return aSize;
}

Просмотреть файл

@ -81,14 +81,14 @@ static bool ShouldUseHeap(const IntSize& aSize, int32_t aStride,
// For as long as an animated image is retained, its frames will never be
// released to let the OS purge volatile buffers.
if (aIsAnimated && StaticPrefs::ImageMemAnimatedUseHeap()) {
if (aIsAnimated && StaticPrefs::image_mem_animated_use_heap()) {
return true;
}
// Lets us avoid too many small images consuming all of the handles. The
// actual allocation checks for overflow.
int32_t bufferSize = (aStride * aSize.width) / 1024;
if (bufferSize < StaticPrefs::ImageMemVolatileMinThresholdKB()) {
if (bufferSize < StaticPrefs::image_mem_volatile_min_threshold_kb()) {
return true;
}
@ -99,7 +99,7 @@ static already_AddRefed<DataSourceSurface> AllocateBufferForImage(
const IntSize& size, SurfaceFormat format, bool aIsAnimated = false) {
int32_t stride = VolatileSurfaceStride(size, format);
if (gfxVars::GetUseWebRenderOrDefault() && StaticPrefs::ImageMemShared()) {
if (gfxVars::GetUseWebRenderOrDefault() && StaticPrefs::image_mem_shared()) {
RefPtr<SourceSurfaceSharedData> newSurf = new SourceSurfaceSharedData();
if (newSurf->Init(size, stride, format)) {
return newSurf.forget();

Просмотреть файл

@ -86,7 +86,7 @@ class imgMemoryReporter final : public nsIMemoryReporter {
layers::CompositorManagerChild* manager =
CompositorManagerChild::GetInstance();
if (!manager || !StaticPrefs::ImageMemDebugReporting()) {
if (!manager || !StaticPrefs::image_mem_debug_reporting()) {
layers::SharedSurfacesMemoryReport sharedSurfaces;
FinishCollectReports(aHandleReport, aData, aAnonymize, sharedSurfaces);
return NS_OK;
@ -263,7 +263,7 @@ class imgMemoryReporter final : public nsIMemoryReporter {
summaryTotal += counter;
if (counter.IsNotable() || StaticPrefs::ImageMemDebugReporting()) {
if (counter.IsNotable() || StaticPrefs::image_mem_debug_reporting()) {
ReportImage(aHandleReport, aData, aPathPrefix, counter,
aSharedSurfaces);
} else {
@ -344,7 +344,7 @@ class imgMemoryReporter final : public nsIMemoryReporter {
if (counter.Type() == SurfaceMemoryCounterType::NORMAL) {
PlaybackType playback = counter.Key().Playback();
if (playback == PlaybackType::eAnimated) {
if (StaticPrefs::ImageMemDebugReporting()) {
if (StaticPrefs::image_mem_debug_reporting()) {
surfacePathPrefix.AppendPrintf(
" (animation %4u)", uint32_t(counter.Values().FrameIndex()));
} else {
@ -1251,8 +1251,8 @@ imgCacheQueue& imgLoader::GetCacheQueue(const ImageCacheKey& aKey) {
}
void imgLoader::GlobalInit() {
sCacheTimeWeight = StaticPrefs::ImageCacheTimeWeight() / 1000.0;
int32_t cachesize = StaticPrefs::ImageCacheSize();
sCacheTimeWeight = StaticPrefs::image_cache_timeweight() / 1000.0;
int32_t cachesize = StaticPrefs::image_cache_size();
sCacheMaxSize = cachesize > 0 ? cachesize : 0;
sMemReporter = new imgMemoryReporter();

Просмотреть файл

@ -469,7 +469,7 @@ void imgRequest::AdjustPriorityInternal(int32_t aDelta) {
}
void imgRequest::BoostPriority(uint32_t aCategory) {
if (!StaticPrefs::ImageLayoutNetworkPriority()) {
if (!StaticPrefs::image_layout_network_priority()) {
return;
}

Просмотреть файл

@ -43,8 +43,8 @@ TEST_F(ImageSurfaceCache, Factor2) {
// Ensures we meet the threshold for FLAG_SYNC_DECODE_IF_FAST to do sync
// decoding without the implications of FLAG_SYNC_DECODE.
ASSERT_LT(length,
static_cast<uint64_t>(StaticPrefs::ImageMemDecodeBytesAtATime()));
ASSERT_LT(length, static_cast<uint64_t>(
StaticPrefs::image_mem_decode_bytes_at_a_time()));
// Write the data into the image.
rv = image->OnImageDataAvailable(nullptr, nullptr, inputStream, 0,
@ -73,7 +73,7 @@ TEST_F(ImageSurfaceCache, Factor2) {
// We need the default threshold to be enabled (otherwise we should disable
// this test).
int32_t threshold = StaticPrefs::ImageCacheFactor2ThresholdSurfaces();
int32_t threshold = StaticPrefs::image_cache_factor2_threshold_surfaces();
ASSERT_TRUE(threshold >= 0);
// We need to know what the native sizes are, otherwise factor of 2 mode will

Просмотреть файл

@ -152,7 +152,8 @@ ZoomConstraintsClient::Observe(nsISupports* aSubject, const char* aTopic,
ZCC_LOG("Got a pref-change event in %p\n", this);
// We need to run this later because all the pref change listeners need
// to execute before we can be guaranteed that
// StaticPrefs::ForceUserScalable() returns the updated value.
// StaticPrefs::browser_ui_zoom_force_user_scalable() returns the updated
// value.
RefPtr<nsRunnableMethod<ZoomConstraintsClient>> event =
NewRunnableMethod("ZoomConstraintsClient::RefreshZoomConstraints", this,

Просмотреть файл

@ -4107,7 +4107,7 @@ nsresult nsLayoutUtils::PaintFrame(gfxContext* aRenderingContext,
presShell->EndPaint();
builder->Check();
if (StaticPrefs::GfxLoggingPaintedPixelCountEnabled()) {
if (StaticPrefs::gfx_logging_painted_pixel_count_enabled()) {
LogPaintedPixelCount(layerManager, paintStart);
}
@ -10008,7 +10008,7 @@ bool nsLayoutUtils::ShouldHandleMetaViewport(const Document* aDocument) {
nsIDocShell::META_VIEWPORT_OVERRIDE_NONE);
// The META_VIEWPORT_OVERRIDE_NONE case means that there is no override
// and we rely solely on the StaticPrefs.
return StaticPrefs::MetaViewportEnabled();
return StaticPrefs::dom_meta_viewport_enabled();
}
}

Просмотреть файл

@ -2141,7 +2141,7 @@ void nsRefreshDriver::Tick(VsyncId aId, TimeStamp aNowTime) {
NS_ASSERTION(mInRefresh, "Still in refresh");
if (mPresContext->IsRoot() && XRE_IsContentProcess() &&
StaticPrefs::AlwaysPaint()) {
StaticPrefs::gfx_content_always_paint()) {
ScheduleViewManagerFlush();
}

Просмотреть файл

@ -92,9 +92,10 @@ void ScrollAnimationBezierPhysics::InitTimingFunction(
SMILKeySpline& aTimingFunction, nscoord aCurrentPos,
nscoord aCurrentVelocity, nscoord aDestination) {
if (aDestination == aCurrentPos ||
StaticPrefs::SmoothScrollCurrentVelocityWeighting() == 0) {
StaticPrefs::general_smoothScroll_currentVelocityWeighting() == 0) {
aTimingFunction.Init(
0, 0, 1 - StaticPrefs::SmoothScrollStopDecelerationWeighting(), 1);
0, 0, 1 - StaticPrefs::general_smoothScroll_stopDecelerationWeighting(),
1);
return;
}
@ -102,12 +103,13 @@ void ScrollAnimationBezierPhysics::InitTimingFunction(
double slope =
aCurrentVelocity * (mDuration / oneSecond) / (aDestination - aCurrentPos);
double normalization = sqrt(1.0 + slope * slope);
double dt =
1.0 / normalization * StaticPrefs::SmoothScrollCurrentVelocityWeighting();
double dt = 1.0 / normalization *
StaticPrefs::general_smoothScroll_currentVelocityWeighting();
double dxy = slope / normalization *
StaticPrefs::SmoothScrollCurrentVelocityWeighting();
StaticPrefs::general_smoothScroll_currentVelocityWeighting();
aTimingFunction.Init(
dt, dxy, 1 - StaticPrefs::SmoothScrollStopDecelerationWeighting(), 1);
dt, dxy,
1 - StaticPrefs::general_smoothScroll_stopDecelerationWeighting(), 1);
}
nsPoint ScrollAnimationBezierPhysics::PositionAt(const TimeStamp& aTime) {

Просмотреть файл

@ -10,10 +10,14 @@ using namespace mozilla;
ScrollAnimationMSDPhysics::ScrollAnimationMSDPhysics(const nsPoint& aStartPos)
: mStartPos(aStartPos),
mModelX(0, 0, 0,
StaticPrefs::SmoothScrollMSDPhysicsRegularSpringConstant(), 1),
mModelY(0, 0, 0,
StaticPrefs::SmoothScrollMSDPhysicsRegularSpringConstant(), 1),
mModelX(
0, 0, 0,
StaticPrefs::general_smoothScroll_msdPhysics_regularSpringConstant(),
1),
mModelY(
0, 0, 0,
StaticPrefs::general_smoothScroll_msdPhysics_regularSpringConstant(),
1),
mIsFirstIteration(true) {}
void ScrollAnimationMSDPhysics::Update(const TimeStamp& aTime,
@ -56,7 +60,8 @@ double ScrollAnimationMSDPhysics::ComputeSpringConstant(
if (!mPreviousEventTime) {
mPreviousEventTime = aTime;
mPreviousDelta = TimeDuration();
return StaticPrefs::SmoothScrollMSDPhysicsMotionBeginSpringConstant();
return StaticPrefs::
general_smoothScroll_msdPhysics_motionBeginSpringConstant();
}
TimeDuration delta = aTime - mPreviousEventTime;
@ -67,23 +72,28 @@ double ScrollAnimationMSDPhysics::ComputeSpringConstant(
double deltaMS = delta.ToMilliseconds();
if (deltaMS >=
StaticPrefs::SmoothScrollMSDPhysicsContinuousMotionMaxDeltaMS()) {
return StaticPrefs::SmoothScrollMSDPhysicsMotionBeginSpringConstant();
StaticPrefs::
general_smoothScroll_msdPhysics_continuousMotionMaxDeltaMS()) {
return StaticPrefs::
general_smoothScroll_msdPhysics_motionBeginSpringConstant();
}
if (previousDelta &&
deltaMS >= StaticPrefs::SmoothScrollMSDPhysicsSlowdownMinDeltaMS() &&
deltaMS >=
StaticPrefs::general_smoothScroll_msdPhysics_slowdownMinDeltaMS() &&
deltaMS >=
previousDelta.ToMilliseconds() *
StaticPrefs::SmoothScrollMSDPhysicsSlowdownMinDeltaRatio()) {
StaticPrefs::
general_smoothScroll_msdPhysics_slowdownMinDeltaRatio()) {
// The rate of events has slowed (the time delta between events has
// increased) enough that we think that the current scroll motion is coming
// to a stop. Use a stiffer spring in order to reach the destination more
// quickly.
return StaticPrefs::SmoothScrollMSDPhysicsSlowdownSpringConstant();
return StaticPrefs::
general_smoothScroll_msdPhysics_slowdownSpringConstant();
}
return StaticPrefs::SmoothScrollMSDPhysicsRegularSpringConstant();
return StaticPrefs::general_smoothScroll_msdPhysics_regularSpringConstant();
}
void ScrollAnimationMSDPhysics::SimulateUntil(const TimeStamp& aTime) {

Просмотреть файл

@ -1991,7 +1991,7 @@ void ScrollFrameHelper::AsyncScroll::InitSmoothScroll(
// Read preferences only on first iteration or for a different event origin.
if (!mAnimationPhysics || aOrigin != mOrigin) {
mOrigin = aOrigin;
if (StaticPrefs::SmoothScrollMSDPhysicsEnabled()) {
if (StaticPrefs::general_smoothScroll_msdPhysics_enabled()) {
mAnimationPhysics =
MakeUnique<ScrollAnimationMSDPhysics>(aInitialPosition);
} else {

Просмотреть файл

@ -7283,7 +7283,7 @@ void FrameLayerBuilder::DrawPaintedLayer(PaintedLayer* aLayer,
layerBuilder->PaintItems(userData->mItems, iterRect, aContext, builder,
presContext, offset, userData->mXScale,
userData->mYScale);
if (StaticPrefs::GfxLoggingPaintedPixelCountEnabled()) {
if (StaticPrefs::gfx_logging_painted_pixel_count_enabled()) {
aLayer->Manager()->AddPaintedPixelCount(iterRect.Area());
}
}
@ -7300,7 +7300,7 @@ void FrameLayerBuilder::DrawPaintedLayer(PaintedLayer* aLayer,
layerBuilder->PaintItems(userData->mItems, aRegionToDraw.GetBounds(),
aContext, builder, presContext, offset,
userData->mXScale, userData->mYScale);
if (StaticPrefs::GfxLoggingPaintedPixelCountEnabled()) {
if (StaticPrefs::gfx_logging_painted_pixel_count_enabled()) {
aLayer->Manager()->AddPaintedPixelCount(aRegionToDraw.GetBounds().Area());
}
}

Просмотреть файл

@ -2857,7 +2857,7 @@ FrameLayerBuilder* nsDisplayList::BuildLayers(nsDisplayListBuilder* aBuilder,
docShell);
#endif
if (XRE_IsContentProcess() && StaticPrefs::AlwaysPaint()) {
if (XRE_IsContentProcess() && StaticPrefs::gfx_content_always_paint()) {
FrameLayerBuilder::InvalidateAllLayers(aLayerManager);
}
@ -6968,7 +6968,7 @@ nsDisplayRenderRoot::nsDisplayRenderRoot(
mRenderRoot(aRenderRoot),
mBuiltWRCommands(false) {
MOZ_ASSERT(aRenderRoot != wr::RenderRoot::Default);
MOZ_ASSERT(StaticPrefs::WebRenderSplitRenderRoots());
MOZ_ASSERT(StaticPrefs::gfx_webrender_split_render_roots());
ExpandDisplayListBuilderRenderRootRect(aBuilder);
MOZ_COUNT_CTOR(nsDisplayRenderRoot);
}
@ -10261,7 +10261,8 @@ bool nsDisplayFilters::CreateWebRenderCSSFilters(WrFiltersHolder& aWrFilters) {
// If there are too many filters to render, then just pretend that we
// succeeded, and don't render any of them.
if (filters.Length() > StaticPrefs::WebRenderMaxFilterOpsPerChain()) {
if (filters.Length() >
StaticPrefs::gfx_webrender_max_filter_ops_per_chain()) {
return true;
}
aWrFilters.filters.SetCapacity(filters.Length());

Просмотреть файл

@ -0,0 +1,35 @@
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>CSS Reftest Reference</title>
<link rel="author" title="Morgan Rae Reschenberg" href="mailto:mreschenberg@berkeley.edu">
<style>
select {
color: transparent;
}
.minWidth {
min-width: 100px;
}
.width {
width: 100px;
}
.floatLWidth {
float: left;
width: 100px;
}
</style>
</head>
<body>
<select class="floatLWidth">
</select>
<br style="clear:both;">
<select class="minWidth">
</select>
<br>
<select class="width">
</select>
</body>
</html>

Просмотреть файл

@ -0,0 +1,49 @@
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>CSS Test: 'contain: size' on select objects should cause them to be sized as if they have no contents.</title>
<link rel="author" title="Morgan Rae Reschenberg" href="mailto:mreschenberg@berkeley.edu">
<link rel="match" href="contain-size-select-001-ref.html">
<style>
select {
contain: size;
color: transparent;
}
.minWidth {
min-width: 100px;
}
.width {
width: 100px;
}
.floatLWidth {
float: left;
width: 100px;
}
</style>
</head>
<body>
<select class="floatLWidth">
<option>CSS Test: A size-contained floated select with specified width and no specified height should size itself as if it had no contents.</option>
<option>a</option>
<option>b</option>
<option>c</option>
</select>
<br style="clear:both;">
<select class="minWidth">
<option>CSS Test: A size-contained select with specified min-width should size itself as if it had no contents.</option>
<option>a</option>
<option>b</option>
<option>c</option>
</select>
<br>
<select class="width">
<option>CSS Test: A size-contained select with specified width should size itself as if it had no contents.</option>
<option>a</option>
<option>b</option>
<option>c</option>
</select>
</body>
</html>

Просмотреть файл

@ -0,0 +1,24 @@
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>CSS Reftest Reference</title>
<link rel="author" title="Morgan Rae Reschenberg" href="mailto:mreschenberg@berkeley.edu">
<style>
select {
color: transparent;
}
.floatLBasic {
float: left;
}
</style>
</head>
<body>
<select>
</select>
<br>
<select class="floatLBasic">
</select>
</body>
</html>

Просмотреть файл

@ -0,0 +1,34 @@
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>CSS Test: 'contain: size' on select objects should cause them to be sized as if they have no contents.</title>
<link rel="author" title="Morgan Rae Reschenberg" href="mailto:mreschenberg@berkeley.edu">
<link rel="match" href="contain-size-select-002-ref.html">
<style>
select {
contain: size;
color: transparent;
}
.floatLBasic {
float: left;
}
</style>
</head>
<body>
<select>
<option>CSS Test: A size-contained select with no specified size should size itself as if it had no contents.</option>
<option>aaaaaa</option>
<option>b</option>
<option>c</option>
</select>
<br>
<select class="floatLBasic">
<option>CSS Test: A size-contained floated select with no specified size should size itself as if it had no contents.</option>
<option>a</option>
<option>b</option>
<option>c</option>
</select>
</body>
</html>

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше