Bug 1550422 - P12. Convert Live gfxPrefs into StaticPrefs. r=jrmuizel

gfxPrefs Live preferences are almost identical to StaticPrefs.

We leave aside for now those that set a custom change callback as this feature isn't yet supported in StaticPrefs.

Differential Revision: https://phabricator.services.mozilla.com/D31256

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Jean-Yves Avenard 2019-05-26 14:29:42 +00:00
Родитель 4b77501235
Коммит 04a34db033
150 изменённых файлов: 1092 добавлений и 1043 удалений

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

@ -7147,7 +7147,7 @@ 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 = gfxPrefs::DesktopViewportWidth() / fullZoom;
CSSCoord viewportWidth = StaticPrefs::DesktopViewportWidth() / fullZoom;
CSSToScreenScale scaleToFit(aDisplaySize.width / viewportWidth);
float aspectRatio = (float)aDisplaySize.height / aDisplaySize.width;
CSSSize viewportSize(viewportWidth, viewportWidth * aspectRatio);
@ -7241,7 +7241,7 @@ nsViewportInfo Document::GetViewportInfo(const ScreenIntSize& aDisplaySize) {
nsViewportInfo::ZoomFlag effectiveZoomFlag =
mAllowZoom ? nsViewportInfo::ZoomFlag::AllowZoom
: nsViewportInfo::ZoomFlag::DisallowZoom;
if (gfxPrefs::ForceUserScalable()) {
if (StaticPrefs::ForceUserScalable()) {
// 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
@ -7354,7 +7354,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 = gfxPrefs::DesktopViewportWidth() / fullZoom;
width = StaticPrefs::DesktopViewportWidth() / fullZoom;
} else {
// Some viewport information was provided; follow the spec.
width = displaySize.width;

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

@ -390,7 +390,7 @@ nsresult TextInputProcessor::BeginInputTransactionInternal(
nsresult rv = NS_OK;
if (aForTests) {
bool isAPZAware = gfxPrefs::TestEventsAsyncEnabled();
bool isAPZAware = StaticPrefs::TestEventsAsyncEnabled();
rv = dispatcher->BeginTestInputTransaction(this, isAPZAware);
} else {
rv = dispatcher->BeginInputTransaction(this);

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

@ -30,7 +30,7 @@
// is included in mozAutoDocUpdate.h.
#include "nsNPAPIPluginInstance.h"
#include "gfxDrawable.h"
#include "gfxPrefs.h"
#include "mozilla/StaticPrefs.h"
#include "ImageOps.h"
#include "mozAutoDocUpdate.h"
#include "mozilla/AntiTrackingCommon.h"
@ -7908,7 +7908,7 @@ nsresult nsContentUtils::SendMouseEvent(
}
return presShell->HandleEvent(view->GetFrame(), &event, false, &status);
}
if (gfxPrefs::TestEventsAsyncEnabled()) {
if (StaticPrefs::TestEventsAsyncEnabled()) {
status = widget->DispatchInputEvent(&event);
} else {
nsresult rv = widget->DispatchEvent(&event, status);

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

@ -46,6 +46,7 @@
#include "mozilla/MiscEvents.h"
#include "mozilla/MouseEvents.h"
#include "mozilla/PresShell.h"
#include "mozilla/StaticPrefs.h"
#include "mozilla/TextEvents.h"
#include "mozilla/TextEventDispatcher.h"
#include "mozilla/TouchEvents.h"
@ -69,7 +70,6 @@
#endif
#include "Layers.h"
#include "gfxPrefs.h"
#include "mozilla/dom/AudioDeviceInfo.h"
#include "mozilla/dom/Element.h"
@ -470,7 +470,7 @@ nsDOMWindowUtils::SetDisplayPortForElement(float aXPx, float aYPx,
new DisplayPortPropertyData(displayport, aPriority),
nsINode::DeleteProperty<DisplayPortPropertyData>);
if (gfxPrefs::LayoutUseContainersForRootFrames()) {
if (StaticPrefs::LayoutUseContainersForRootFrames()) {
nsIFrame* rootScrollFrame = presShell->GetRootScrollFrame();
if (rootScrollFrame && aElement == rootScrollFrame->GetContent() &&
nsLayoutUtils::UsesAsyncScrolling(rootScrollFrame)) {

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

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

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

@ -51,7 +51,6 @@
#include "gfxPlatform.h"
#include "gfxFont.h"
#include "gfxBlur.h"
#include "gfxPrefs.h"
#include "gfxTextRun.h"
#include "gfxUtils.h"
@ -93,6 +92,7 @@
#include "mozilla/MathAlgorithms.h"
#include "mozilla/Preferences.h"
#include "mozilla/ServoBindings.h"
#include "mozilla/StaticPrefs.h"
#include "mozilla/Telemetry.h"
#include "mozilla/TimeStamp.h"
#include "mozilla/UniquePtr.h"
@ -1231,8 +1231,8 @@ bool CanvasRenderingContext2D::EnsureTarget(const gfx::Rect* aCoveredRect,
}
// Check that the dimensions are sane
if (mWidth > gfxPrefs::MaxCanvasSize() ||
mHeight > gfxPrefs::MaxCanvasSize() || mWidth < 0 || mHeight < 0) {
if (mWidth > StaticPrefs::MaxCanvasSize() ||
mHeight > StaticPrefs::MaxCanvasSize() || mWidth < 0 || mHeight < 0) {
SetErrorState();
return false;
}

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

@ -5,7 +5,7 @@
#include "WebGL2Context.h"
#include "gfxPrefs.h"
#include "mozilla/StaticPrefs.h"
#include "GLContext.h"
#include "mozilla/dom/WebGL2RenderingContextBinding.h"
#include "mozilla/ArrayUtils.h"
@ -31,7 +31,7 @@ UniquePtr<webgl::FormatUsageAuthority> WebGL2Context::CreateFormatUsage(
}
/*static*/
bool WebGL2Context::IsSupported() { return gfxPrefs::WebGL2Enabled(); }
bool WebGL2Context::IsSupported() { return StaticPrefs::WebGL2Enabled(); }
/*static*/
WebGL2Context* WebGL2Context::Create() { return new WebGL2Context(); }

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

@ -67,7 +67,7 @@ GLenum WebGL2Context::ClientWaitSync(const WebGLSync& sync, GLbitfield flags,
}
const bool canBeAvailable =
(sync.mCanBeAvailable || gfxPrefs::WebGLImmediateQueries());
(sync.mCanBeAvailable || StaticPrefs::WebGLImmediateQueries());
if (!canBeAvailable) {
if (timeout) {
GenerateWarning(
@ -118,7 +118,7 @@ void WebGL2Context::GetSyncParameter(JSContext*, const WebGLSync& sync,
////
const bool canBeAvailable =
(sync.mCanBeAvailable || gfxPrefs::WebGLImmediateQueries());
(sync.mCanBeAvailable || StaticPrefs::WebGLImmediateQueries());
if (!canBeAvailable && pname == LOCAL_GL_SYNC_STATUS) {
retval.set(JS::Int32Value(LOCAL_GL_UNSIGNALED));
return;

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

@ -13,7 +13,6 @@
#include "gfxContext.h"
#include "gfxCrashReporterUtils.h"
#include "gfxPattern.h"
#include "gfxPrefs.h"
#include "gfxUtils.h"
#include "MozFramebuffer.h"
#include "GLBlitHelper.h"
@ -35,6 +34,7 @@
#include "mozilla/ProcessPriorityManager.h"
#include "mozilla/ScopeExit.h"
#include "mozilla/Services.h"
#include "mozilla/StaticPrefs.h"
#include "mozilla/Telemetry.h"
#include "nsContentUtils.h"
#include "nsDisplayList.h"
@ -97,7 +97,7 @@ using namespace mozilla::layers;
WebGLContextOptions::WebGLContextOptions() {
// Set default alpha state based on preference.
if (gfxPrefs::WebGLDefaultNoAlpha()) alpha = false;
if (StaticPrefs::WebGLDefaultNoAlpha()) alpha = false;
}
bool WebGLContextOptions::operator==(const WebGLContextOptions& r) const {
@ -116,18 +116,18 @@ bool WebGLContextOptions::operator==(const WebGLContextOptions& r) const {
WebGLContext::WebGLContext()
: gl(mGL_OnlyClearInDestroyResourcesAndContext) // const reference
,
mMaxPerfWarnings(gfxPrefs::WebGLMaxPerfWarnings()),
mMaxPerfWarnings(StaticPrefs::WebGLMaxPerfWarnings()),
mNumPerfWarnings(0),
mMaxAcceptableFBStatusInvals(
gfxPrefs::WebGLMaxAcceptableFBStatusInvals()),
StaticPrefs::WebGLMaxAcceptableFBStatusInvals()),
mDataAllocGLCallCount(0),
mEmptyTFO(0),
mContextLossHandler(this),
mNeedsFakeNoAlpha(false),
mNeedsFakeNoDepth(false),
mNeedsFakeNoStencil(false),
mAllowFBInvalidation(gfxPrefs::WebGLFBInvalidation()),
mMsaaSamples((uint8_t)gfxPrefs::WebGLMsaaSamples()) {
mAllowFBInvalidation(StaticPrefs::WebGLFBInvalidation()),
mMsaaSamples((uint8_t)StaticPrefs::WebGLMsaaSamples()) {
mGeneration = 0;
mInvalidated = false;
mCapturedFrameInvalidated = false;
@ -163,7 +163,7 @@ WebGLContext::WebGLContext()
mAlreadyWarnedAboutFakeVertexAttrib0 = false;
mAlreadyWarnedAboutViewportLargerThanDest = false;
mMaxWarnings = gfxPrefs::WebGLMaxWarningsPerContext();
mMaxWarnings = StaticPrefs::WebGLMaxWarningsPerContext();
if (mMaxWarnings < -1) {
GenerateWarning(
"webgl.max-warnings-per-context size is too large (seems like a "
@ -359,11 +359,11 @@ WebGLContext::SetContextOptions(JSContext* cx, JS::Handle<JS::Value> options,
}
// Don't do antialiasing if we've disabled MSAA.
if (!gfxPrefs::MSAALevel()) {
if (!StaticPrefs::MSAALevel()) {
newOpts.antialias = false;
}
if (!gfxPrefs::WebGLForceMSAA()) {
if (!StaticPrefs::WebGLForceMSAA()) {
const nsCOMPtr<nsIGfxInfo> gfxInfo = services::GetGfxInfo();
nsCString blocklistId;
@ -475,7 +475,7 @@ bool WebGLContext::CreateAndInitGL(
if (IsWebGL2()) {
flags |= gl::CreateContextFlags::PREFER_ES3;
} else if (!gfxPrefs::WebGL1AllowCoreProfile()) {
} else if (!StaticPrefs::WebGL1AllowCoreProfile()) {
flags |= gl::CreateContextFlags::REQUIRE_COMPAT_PROFILE;
}
@ -496,7 +496,7 @@ bool WebGLContext::CreateAndInitGL(
// - Same origin with root page (try to stem bleeding from WebGL
// ads/trackers)
default:
if (!gfxPrefs::WebGLDefaultLowPower()) {
if (!StaticPrefs::WebGLDefaultLowPower()) {
flags |= gl::CreateContextFlags::HIGH_POWER;
}
break;
@ -541,11 +541,11 @@ bool WebGLContext::CreateAndInitGL(
tryNativeGL = false;
tryANGLE = true;
if (gfxPrefs::WebGLDisableWGL()) {
if (StaticPrefs::WebGLDisableWGL()) {
tryNativeGL = false;
}
if (gfxPrefs::WebGLDisableANGLE() || PR_GetEnv("MOZ_WEBGL_FORCE_OPENGL") ||
if (StaticPrefs::WebGLDisableANGLE() || PR_GetEnv("MOZ_WEBGL_FORCE_OPENGL") ||
useEGL) {
tryNativeGL = true;
tryANGLE = false;
@ -801,7 +801,7 @@ WebGLContext::SetDimensions(int32_t signedWidth, int32_t signedHeight) {
// pick up the old generation.
++mGeneration;
bool disabled = gfxPrefs::WebGLDisabled();
bool disabled = StaticPrefs::WebGLDisabled();
// TODO: When we have software webgl support we should use that instead.
disabled |= gfxPlatform::InSafeMode();
@ -817,7 +817,7 @@ WebGLContext::SetDimensions(int32_t signedWidth, int32_t signedHeight) {
return NS_ERROR_FAILURE;
}
if (gfxPrefs::WebGLDisableFailIfMajorPerformanceCaveat()) {
if (StaticPrefs::WebGLDisableFailIfMajorPerformanceCaveat()) {
mOptions.failIfMajorPerformanceCaveat = false;
}
@ -834,7 +834,7 @@ WebGLContext::SetDimensions(int32_t signedWidth, int32_t signedHeight) {
}
// Alright, now let's start trying.
bool forceEnabled = gfxPrefs::WebGLForceEnabled();
bool forceEnabled = StaticPrefs::WebGLForceEnabled();
ScopedGfxFeatureReporter reporter("WebGL", forceEnabled);
MOZ_ASSERT(!gl);
@ -966,8 +966,9 @@ WebGLContext::SetDimensions(int32_t signedWidth, int32_t signedHeight) {
}
void WebGLContext::LoseOldestWebGLContextIfLimitExceeded() {
const auto maxWebGLContexts = gfxPrefs::WebGLMaxContexts();
auto maxWebGLContextsPerPrincipal = gfxPrefs::WebGLMaxContextsPerPrincipal();
const auto maxWebGLContexts = StaticPrefs::WebGLMaxContexts();
auto maxWebGLContextsPerPrincipal =
StaticPrefs::WebGLMaxContextsPerPrincipal();
// maxWebGLContextsPerPrincipal must be less than maxWebGLContexts
MOZ_ASSERT(maxWebGLContextsPerPrincipal <= maxWebGLContexts);
@ -1329,7 +1330,7 @@ ScopedPrepForResourceClear::~ScopedPrepForResourceClear() {
// -
void WebGLContext::OnEndOfFrame() const {
if (gfxPrefs::WebGLSpewFrameAllocs()) {
if (StaticPrefs::WebGLSpewFrameAllocs()) {
GeneratePerfWarning("[webgl.perf.spew-frame-allocs] %" PRIu64
" data allocations this frame.",
mDataAllocGLCallCount);

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

@ -82,7 +82,7 @@ bool WebGLContext::IsExtensionSupported(dom::CallerType callerType,
allowPrivilegedExts = true;
}
if (gfxPrefs::WebGLPrivilegedExtensionsEnabled()) {
if (StaticPrefs::WebGLPrivilegedExtensionsEnabled()) {
allowPrivilegedExts = true;
}

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

@ -8,11 +8,11 @@
#include <algorithm>
#include "GLSLANG/ShaderLang.h"
#include "CanvasUtils.h"
#include "gfxPrefs.h"
#include "GLContext.h"
#include "jsfriendapi.h"
#include "mozilla/CheckedInt.h"
#include "mozilla/Preferences.h"
#include "mozilla/StaticPrefs.h"
#include "nsIObserverService.h"
#include "nsPrintfCString.h"
#include "WebGLActiveInfo.h"
@ -288,9 +288,10 @@ bool WebGLContext::InitAndValidateGL(FailureReason* const out_failReason) {
return false;
}
mDisableExtensions = gfxPrefs::WebGLDisableExtensions();
mLoseContextOnMemoryPressure = gfxPrefs::WebGLLoseContextOnMemoryPressure();
mCanLoseContextInForeground = gfxPrefs::WebGLCanLoseContextInForeground();
mDisableExtensions = StaticPrefs::WebGLDisableExtensions();
mLoseContextOnMemoryPressure =
StaticPrefs::WebGLLoseContextOnMemoryPressure();
mCanLoseContextInForeground = StaticPrefs::WebGLCanLoseContextInForeground();
// These are the default values, see 6.2 State tables in the
// OpenGL ES 2.0.25 spec.
@ -487,7 +488,7 @@ bool WebGLContext::InitAndValidateGL(FailureReason* const out_failReason) {
// Last resort, just check the global preference
nsContentUtils::ShouldResistFingerprinting());
if (gfxPrefs::WebGLMinCapabilityMode()) {
if (StaticPrefs::WebGLMinCapabilityMode()) {
bool ok = true;
ok &= RestrictCap(&mGLMaxVertexTextureImageUnits,
@ -664,7 +665,7 @@ bool WebGLContext::InitAndValidateGL(FailureReason* const out_failReason) {
mNeedsIndexValidation =
!gl->IsSupported(gl::GLFeature::robust_buffer_access_behavior);
switch (gfxPrefs::WebGLForceIndexValidation()) {
switch (StaticPrefs::WebGLForceIndexValidation()) {
case -1:
mNeedsIndexValidation = false;
break;
@ -672,7 +673,7 @@ bool WebGLContext::InitAndValidateGL(FailureReason* const out_failReason) {
mNeedsIndexValidation = true;
break;
default:
MOZ_ASSERT(gfxPrefs::WebGLForceIndexValidation() == 0);
MOZ_ASSERT(StaticPrefs::WebGLForceIndexValidation() == 0);
break;
}

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

@ -5,9 +5,9 @@
#include "WebGLExtensions.h"
#include "gfxPrefs.h"
#include "GLContext.h"
#include "mozilla/dom/WebGLRenderingContextBinding.h"
#include "mozilla/StaticPrefs.h"
#include "WebGLContext.h"
namespace mozilla {
@ -62,7 +62,7 @@ WebGLExtensionFBORenderMipmap::~WebGLExtensionFBORenderMipmap() = default;
bool WebGLExtensionFBORenderMipmap::IsSupported(
const WebGLContext* const webgl) {
if (webgl->IsWebGL2()) return false;
if (!gfxPrefs::WebGLDraftExtensionsEnabled()) return false;
if (!StaticPrefs::WebGLDraftExtensionsEnabled()) return false;
const auto& gl = webgl->gl;
if (!gl->IsGLES()) return true;
@ -83,7 +83,7 @@ WebGLExtensionMultiview::~WebGLExtensionMultiview() = default;
bool WebGLExtensionMultiview::IsSupported(const WebGLContext* const webgl) {
if (!webgl->IsWebGL2()) return false;
if (!gfxPrefs::WebGLDraftExtensionsEnabled()) return false;
if (!StaticPrefs::WebGLDraftExtensionsEnabled()) return false;
const auto& gl = webgl->gl;
return gl->IsSupported(gl::GLFeature::multiview);

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

@ -117,7 +117,7 @@ void WebGLQuery::GetQueryParameter(GLenum pname,
// We must usually wait for an event loop before the query can be available.
const bool canBeAvailable =
(mCanBeAvailable || gfxPrefs::WebGLImmediateQueries());
(mCanBeAvailable || StaticPrefs::WebGLImmediateQueries());
if (!canBeAvailable) {
if (pname == LOCAL_GL_QUERY_RESULT_AVAILABLE) {
retval.set(JS::BooleanValue(false));

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

@ -5,10 +5,10 @@
#include "WebGLShaderValidator.h"
#include "gfxPrefs.h"
#include "GLContext.h"
#include "mozilla/gfx/Logging.h"
#include "mozilla/Preferences.h"
#include "mozilla/StaticPrefs.h"
#include "MurmurHash3.h"
#include "nsPrintfCString.h"
#include <string>
@ -67,7 +67,7 @@ static ShCompileOptions ChooseValidatorCompileOptions(
}
}
if (gfxPrefs::WebGLAllANGLEOptions()) {
if (StaticPrefs::WebGLAllANGLEOptions()) {
options = -1;
options ^= SH_INTERMEDIATE_TREE;

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

@ -8,7 +8,6 @@
#include <algorithm>
#include "CanvasUtils.h"
#include "gfxPrefs.h"
#include "GLBlitHelper.h"
#include "GLContext.h"
#include "mozilla/Casting.h"
@ -19,6 +18,7 @@
#include "mozilla/dom/ImageData.h"
#include "mozilla/MathAlgorithms.h"
#include "mozilla/Scoped.h"
#include "mozilla/StaticPrefs.h"
#include "mozilla/Unused.h"
#include "ScopedGLHelpers.h"
#include "TexUnpackBlob.h"
@ -328,7 +328,7 @@ UniquePtr<webgl::TexUnpackBlob> WebGLContext::FromDomElem(
uint32_t elemWidth = 0;
uint32_t elemHeight = 0;
layers::Image* layersImage = nullptr;
if (!gfxPrefs::WebGLDisableDOMBlitUploads() && sfer.mLayersImage) {
if (!StaticPrefs::WebGLDisableDOMBlitUploads() && sfer.mLayersImage) {
layersImage = sfer.mLayersImage;
elemWidth = layersImage->GetSize().width;
elemHeight = layersImage->GetSize().height;

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

@ -1811,7 +1811,7 @@ mozilla::ipc::IPCResult BrowserChild::RecvRealTouchEvent(
if (localEvent.mMessage == eTouchStart && AsyncPanZoomEnabled()) {
nsCOMPtr<Document> document = GetTopLevelDocument();
if (gfxPrefs::TouchActionEnabled()) {
if (StaticPrefs::TouchActionEnabled()) {
APZCCallbackHelper::SendSetAllowedTouchBehaviorNotification(
mPuppetWidget, document, localEvent, aInputBlockId,
mSetAllowedTouchBehaviorCallback);

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

@ -18,6 +18,7 @@
#include "gfxPrefs.h"
#include "gfxWindowsPlatform.h"
#include "mfapi.h"
#include "mozilla/StaticPrefs.h"
#include "mozilla/Telemetry.h"
#include "mozilla/gfx/DeviceManagerDx.h"
#include "mozilla/layers/D3D11ShareHandleImage.h"
@ -416,7 +417,7 @@ D3D9DXVA2Manager::Init(layers::KnowsCompositor* aKnowsCompositor,
}
if ((adapter.VendorId == 0x1022 || adapter.VendorId == 0x1002) &&
!gfxPrefs::PDMWMFSkipBlacklist()) {
!StaticPrefs::PDMWMFSkipBlacklist()) {
for (const auto& model : sAMDPreUVD4) {
if (adapter.DeviceId == model) {
mIsAMDPreUVD4 = true;
@ -506,7 +507,7 @@ DXVA2Manager* DXVA2Manager::CreateD3D9DXVA(
// DXVA processing takes up a lot of GPU resources, so limit the number of
// videos we use DXVA with at any one time.
uint32_t dxvaLimit = gfxPrefs::PDMWMFMaxDXVAVideos();
uint32_t dxvaLimit = StaticPrefs::PDMWMFMaxDXVAVideos();
if (sDXVAVideosCount == dxvaLimit) {
aFailureReason.AssignLiteral("Too many DXVA videos playing");
@ -848,7 +849,7 @@ D3D11DXVA2Manager::InitInternal(layers::KnowsCompositor* aKnowsCompositor,
}
if ((adapterDesc.VendorId == 0x1022 || adapterDesc.VendorId == 0x1002) &&
!gfxPrefs::PDMWMFSkipBlacklist()) {
!StaticPrefs::PDMWMFSkipBlacklist()) {
for (const auto& model : sAMDPreUVD4) {
if (adapterDesc.DeviceId == model) {
mIsAMDPreUVD4 = true;
@ -1218,7 +1219,7 @@ DXVA2Manager* DXVA2Manager::CreateD3D11DXVA(
ID3D11Device* aDevice) {
// DXVA processing takes up a lot of GPU resources, so limit the number of
// videos we use DXVA with at any one time.
uint32_t dxvaLimit = gfxPrefs::PDMWMFMaxDXVAVideos();
uint32_t dxvaLimit = StaticPrefs::PDMWMFMaxDXVAVideos();
if (sDXVAVideosCount == dxvaLimit) {
aFailureReason.AssignLiteral("Too many DXVA videos playing");
@ -1250,7 +1251,7 @@ bool DXVA2Manager::IsUnsupportedResolution(const uint32_t& aWidth,
// AMD cards with UVD3 or earlier perform poorly trying to decode 1080p60 in
// hardware, so use software instead. Pick 45 as an arbitrary upper bound for
// the framerate we can handle.
return !gfxPrefs::PDMWMFAMDHighResEnabled() && mIsAMDPreUVD4 &&
return !StaticPrefs::PDMWMFAMDHighResEnabled() && mIsAMDPreUVD4 &&
(aWidth >= 1920 || aHeight >= 1088) && aFramerate > 45;
}

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

@ -22,11 +22,11 @@
#include "WMFDecoderModule.h"
#include "WMFUtils.h"
#include "gfx2DGlue.h"
#include "gfxPrefs.h"
#include "gfxWindowsPlatform.h"
#include "mozilla/AbstractThread.h"
#include "mozilla/ClearOnShutdown.h"
#include "mozilla/Logging.h"
#include "mozilla/StaticPrefs.h"
#include "mozilla/SyncRunnable.h"
#include "mozilla/Telemetry.h"
#include "mozilla/WindowsVersion.h"
@ -443,11 +443,11 @@ class CreateDXVAManagerEvent : public Runnable {
NS_ASSERTION(NS_IsMainThread(), "Must be on main thread.");
const bool deblacklistingForTelemetry =
XRE_IsGPUProcess() &&
gfxPrefs::PDMWMFDeblacklistingForTelemetryInGPUProcess();
StaticPrefs::PDMWMFDeblacklistingForTelemetryInGPUProcess();
nsACString* failureReason = &mFailureReason;
nsCString secondFailureReason;
if (mBackend == LayersBackend::LAYERS_D3D11 &&
gfxPrefs::PDMWMFAllowD3D11() && IsWin8OrLater()) {
StaticPrefs::PDMWMFAllowD3D11() && IsWin8OrLater()) {
const nsCString& blacklistedDLL = FindD3D11BlacklistedDLL();
if (!deblacklistingForTelemetry && !blacklistedDLL.IsEmpty()) {
failureReason->AppendPrintf("D3D11 blacklisted with DLL %s",
@ -515,7 +515,7 @@ bool WMFVideoMFTManager::InitializeDXVA() {
}
MediaResult WMFVideoMFTManager::ValidateVideoInfo() {
if (mStreamType != H264 || gfxPrefs::PDMWMFAllowUnsupportedResolutions()) {
if (mStreamType != H264 || StaticPrefs::PDMWMFAllowUnsupportedResolutions()) {
return NS_OK;
}
@ -586,8 +586,8 @@ MediaResult WMFVideoMFTManager::InitInternal() {
attr->SetUINT32(CODECAPI_AVDecNumWorkerThreads,
WMFDecoderModule::GetNumDecoderThreads());
bool lowLatency =
(gfxPrefs::PDMWMFLowLatencyEnabled() || IsWin10OrLater()) &&
!gfxPrefs::PDMWMFLowLatencyForceDisabled();
(StaticPrefs::PDMWMFLowLatencyEnabled() || IsWin10OrLater()) &&
!StaticPrefs::PDMWMFLowLatencyForceDisabled();
if (mLowLatency || lowLatency) {
hr = attr->SetUINT32(CODECAPI_AVLowLatencyMode, TRUE);
if (SUCCEEDED(hr)) {
@ -1150,7 +1150,7 @@ nsCString WMFVideoMFTManager::GetDescriptionName() const {
bool hw = IsHardwareAccelerated(failureReason);
return nsPrintfCString("wmf %s video decoder - %s",
hw ? "hardware" : "software",
hw ? gfxPrefs::PDMWMFUseNV12Format() &&
hw ? StaticPrefs::PDMWMFUseNV12Format() &&
gfx::DeviceManagerDx::Get()->CanUseNV12()
? "nv12"
: "rgba32"

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

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

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

@ -14,9 +14,9 @@
#include "mozilla/dom/VRDisplayBinding.h"
#include "mozilla/Base64.h"
#include "mozilla/EventStateManager.h"
#include "mozilla/StaticPrefs.h"
#include "mozilla/gfx/DataSurfaceHelpers.h"
#include "Navigator.h"
#include "gfxPrefs.h"
#include "gfxUtils.h"
#include "gfxVR.h"
#include "VRDisplayClient.h"
@ -445,7 +445,7 @@ void VRDisplay::StartHandlingVRNavigationEvent() {
mHandlingVRNavigationEventStart = TimeStamp::Now();
++mVRNavigationEventDepth;
TimeDuration timeout =
TimeDuration::FromMilliseconds(gfxPrefs::VRNavigationTimeout());
TimeDuration::FromMilliseconds(StaticPrefs::VRNavigationTimeout());
// 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(gfxPrefs::VRNavigationTimeout());
TimeDuration::FromMilliseconds(StaticPrefs::VRNavigationTimeout());
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() && gfxPrefs::VRRequireGesture() &&
!IsHandlingVRNavigationEvent() && StaticPrefs::VRRequireGesture() &&
!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

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

@ -15,7 +15,7 @@
#include "mozilla/Scoped.h"
#include "mozilla/UniquePtr.h"
#include "mozilla/Vector.h"
#include "gfxPrefs.h"
#include "mozilla/StaticPrefs.h"
#include "cairo.h"
#include "cairo-tee.h"
@ -1309,7 +1309,7 @@ void DrawTargetCairo::FillGlyphs(ScaledFont* aFont, const GlyphBuffer& aBuffer,
}
if (!SupportsVariationSettings(mSurface) && aFont->HasVariationSettings() &&
gfxPrefs::PrintFontVariationsAsPaths()) {
StaticPrefs::PrintFontVariationsAsPaths()) {
cairo_set_fill_rule(mContext, CAIRO_FILL_RULE_WINDING);
cairo_new_path(mContext);
cairo_glyph_path(mContext, &glyphs[0], aBuffer.mNumGlyphs);

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

@ -209,9 +209,9 @@ static const char* const sExtensionNames[] = {
"GL_OVR_multiview2"};
static bool ShouldUseTLSIsCurrent(bool useTLSIsCurrent) {
if (gfxPrefs::UseTLSIsCurrent() == 0) return useTLSIsCurrent;
if (StaticPrefs::UseTLSIsCurrent() == 0) return useTLSIsCurrent;
return gfxPrefs::UseTLSIsCurrent() > 0;
return StaticPrefs::UseTLSIsCurrent() > 0;
}
static bool ParseVersion(const std::string& versionStr,
@ -1759,7 +1759,7 @@ GLFormats GLContext::ChooseGLFormats(const SurfaceCaps& caps) const {
}
}
uint32_t msaaLevel = gfxPrefs::MSAALevel();
uint32_t msaaLevel = StaticPrefs::MSAALevel();
GLsizei samples = msaaLevel * msaaLevel;
samples = std::min(samples, mMaxSamples);

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

@ -10,6 +10,7 @@
#include <OpenGL/gl.h>
#include "gfxFailure.h"
#include "gfxPrefs.h"
#include "mozilla/StaticPrefs.h"
#include "prenv.h"
#include "GeckoProfiler.h"
#include "mozilla/gfx/MacIOSurface.h"
@ -202,7 +203,7 @@ already_AddRefed<GLContext> GLContextProviderCGL::CreateForWindow(nsIWidget* aWi
return nullptr;
}
GLint opaque = gfxPrefs::CompositorGLContextOpaque();
GLint opaque = StaticPrefs::CompositorGLContextOpaque();
[context setValues:&opaque forParameter:NSOpenGLCPSurfaceOpacity];
RefPtr<GLContextCGL> glContext =
@ -226,7 +227,7 @@ static already_AddRefed<GLContextCGL> CreateOffscreenFBOContext(CreateContextFla
std::vector<NSOpenGLPixelFormatAttribute> attribs;
if (!gfxPrefs::GLAllowHighPower()) {
if (!StaticPrefs::GLAllowHighPower()) {
flags &= ~CreateContextFlags::HIGH_POWER;
}
if (flags & CreateContextFlags::ALLOW_OFFLINE_RENDERER ||
@ -236,7 +237,7 @@ static already_AddRefed<GLContextCGL> CreateOffscreenFBOContext(CreateContextFla
attribs.push_back(NSOpenGLPFAAllowOfflineRenderers);
}
if (gfxPrefs::RequireHardwareGL()) {
if (StaticPrefs::RequireHardwareGL()) {
attribs.push_back(NSOpenGLPFAAccelerated);
}
@ -260,7 +261,7 @@ static already_AddRefed<GLContextCGL> CreateOffscreenFBOContext(CreateContextFla
RefPtr<GLContextCGL> glContext = new GLContextCGL(flags, SurfaceCaps::Any(), context, true);
if (gfxPrefs::GLMultithreaded()) {
if (StaticPrefs::GLMultithreaded()) {
CGLEnable(glContext->GetCGLContext(), kCGLCEMPEngine);
}
return glContext.forget();

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

@ -19,6 +19,7 @@
#include "mozilla/layers/CompositorOptions.h"
#include "mozilla/Range.h"
#include "mozilla/ScopeExit.h"
#include "mozilla/StaticPrefs.h"
#include "mozilla/widget/CompositorWidget.h"
#include "mozilla/widget/GtkCompositorWidget.h"
#include "mozilla/Unused.h"
@ -185,7 +186,7 @@ bool GLXLibrary::EnsureInitialized() {
if (HasExtension(extensionsStr, "GLX_EXT_texture_from_pixmap") &&
fnLoadSymbols(symbols_texturefrompixmap)) {
mUseTextureFromPixmap = gfxPrefs::UseGLXTextureFromPixmap();
mUseTextureFromPixmap = StaticPrefs::UseGLXTextureFromPixmap();
} else {
mUseTextureFromPixmap = false;
NS_WARNING("Texture from pixmap disabled");

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

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

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

@ -290,11 +290,11 @@ static EGLDisplay GetAndInitDisplayForAccelANGLE(
FeatureState& d3d11ANGLE = gfxConfig::GetFeature(Feature::D3D11_HW_ANGLE);
if (!gfxPrefs::WebGLANGLETryD3D11())
if (!StaticPrefs::WebGLANGLETryD3D11())
d3d11ANGLE.UserDisable("User disabled D3D11 ANGLE by pref",
NS_LITERAL_CSTRING("FAILURE_ID_ANGLE_PREF"));
if (gfxPrefs::WebGLANGLEForceD3D11())
if (StaticPrefs::WebGLANGLEForceD3D11())
d3d11ANGLE.UserForceEnable(
"User force-enabled D3D11 ANGLE on disabled hardware");
@ -742,7 +742,7 @@ EGLDisplay GLLibraryEGL::CreateDisplay(bool forceAccel,
bool shouldTryWARP = !forceAccel; // Only if ANGLE not supported or fails
// If WARP preferred, will override ANGLE support
if (gfxPrefs::WebGLANGLEForceWARP()) {
if (StaticPrefs::WebGLANGLEForceWARP()) {
shouldTryWARP = true;
shouldTryAccel = false;
if (accelAngleFailureId.IsEmpty()) {

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

@ -88,7 +88,7 @@ UniquePtr<SurfaceFactory> GLScreenBuffer::CreateFactory(
factory = MakeUnique<SurfaceFactory_GLTexture>(mGLContext, caps, ipcChannel,
mFlags);
#elif defined(MOZ_WIDGET_ANDROID)
if (XRE_IsParentProcess() && !gfxPrefs::WebGLSurfaceTextureEnabled()) {
if (XRE_IsParentProcess() && !StaticPrefs::WebGLSurfaceTextureEnabled()) {
factory = SurfaceFactory_EGLImage::Create(gl, caps, ipcChannel, flags);
} else {
factory =
@ -117,7 +117,7 @@ UniquePtr<SurfaceFactory> GLScreenBuffer::CreateFactory(
SurfaceFactory_ANGLEShareHandle::Create(gl, caps, ipcChannel, flags);
}
if (!factory && gfxPrefs::WebGLDXGLEnabled()) {
if (!factory && StaticPrefs::WebGLDXGLEnabled()) {
factory =
SurfaceFactory_D3D11Interop::Create(gl, caps, ipcChannel, flags);
}

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

@ -415,7 +415,7 @@ SharedSurface_D3D11Interop::SharedSurface_D3D11Interop(
mLockHandle(lockHandle),
mTexD3D(texD3D),
mDXGIHandle(dxgiHandle),
mNeedsFinish(gfxPrefs::WebGLDXGLNeedsFinish()),
mNeedsFinish(StaticPrefs::WebGLDXGLNeedsFinish()),
mLockedForGL(false) {
MOZ_ASSERT(bool(mProdTex) == bool(mInteropFB));
}

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

@ -266,7 +266,7 @@ mozilla::ipc::IPCResult GPUParent::RecvInit(
}
#ifdef XP_WIN
else {
if (gfxPrefs::Direct3D11UseDoubleBuffering() && IsWin10OrLater()) {
if (StaticPrefs::Direct3D11UseDoubleBuffering() && IsWin10OrLater()) {
// This is needed to avoid freezing the window on a device crash on double
// buffering, see bug 1549674.
widget::WinCompositorWindowThread::Start();

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

@ -512,13 +512,13 @@ void GPUProcessManager::OnProcessUnexpectedShutdown(GPUProcessHost* aHost) {
CompositorManagerChild::OnGPUProcessLost(aHost->GetProcessToken());
DestroyProcess();
if (mNumProcessAttempts > uint32_t(gfxPrefs::GPUProcessMaxRestarts())) {
if (mNumProcessAttempts > uint32_t(StaticPrefs::GPUProcessMaxRestarts())) {
char disableMessage[64];
SprintfLiteral(disableMessage, "GPU process disabled after %d attempts",
mNumProcessAttempts);
DisableGPUProcess(disableMessage);
} else if (mNumProcessAttempts >
uint32_t(gfxPrefs::GPUProcessMaxRestartsWithDecoder()) &&
uint32_t(StaticPrefs::GPUProcessMaxRestartsWithDecoder()) &&
mDecodeVideoOnGpuProcess) {
mDecodeVideoOnGpuProcess = false;
Telemetry::Accumulate(Telemetry::GPU_PROCESS_CRASH_FALLBACKS,

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

@ -223,11 +223,11 @@ D3D11RecycleAllocator::D3D11RecycleAllocator(
gfx::SurfaceFormat aPreferredFormat)
: TextureClientRecycleAllocator(aAllocator),
mDevice(aDevice),
mCanUseNV12(gfxPrefs::PDMWMFUseNV12Format() &&
mCanUseNV12(StaticPrefs::PDMWMFUseNV12Format() &&
gfx::DeviceManagerDx::Get()->CanUseNV12()),
mCanUseP010(gfxPrefs::PDMWMFUseNV12Format() &&
mCanUseP010(StaticPrefs::PDMWMFUseNV12Format() &&
gfx::DeviceManagerDx::Get()->CanUseP010()),
mCanUseP016(gfxPrefs::PDMWMFUseNV12Format() &&
mCanUseP016(StaticPrefs::PDMWMFUseNV12Format() &&
gfx::DeviceManagerDx::Get()->CanUseP016()) {
SetPreferredSurfaceFormat(aPreferredFormat);
}

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

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

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

@ -162,7 +162,7 @@ void PaintThread::QueuePaintTask(UniquePtr<PaintTask>&& aTask) {
MOZ_ASSERT(NS_IsMainThread());
MOZ_ASSERT(aTask);
if (gfxPrefs::LayersOMTPDumpCapture() && aTask->mCapture) {
if (StaticPrefs::LayersOMTPDumpCapture() && aTask->mCapture) {
aTask->mCapture->Dump();
}
@ -207,7 +207,7 @@ void PaintThread::AsyncPaintTask(CompositorBridgeChild* aBridge,
target->Flush();
}
if (gfxPrefs::LayersOMTPReleaseCaptureOnMainThread()) {
if (StaticPrefs::LayersOMTPReleaseCaptureOnMainThread()) {
// This should ensure the capture drawtarget, which may hold on to
// UnscaledFont objects, gets destroyed on the main thread (See bug
// 1404742). This assumes (unflushed) target DrawTargets do not themselves

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

@ -10,7 +10,6 @@
#include "AsyncPanZoomController.h"
#include "Compositor.h" // for Compositor
#include "DragTracker.h" // for DragTracker
#include "gfxPrefs.h" // for gfxPrefs
#include "GenericFlingAnimation.h" // for FLING_LOG
#include "HitTestingTreeNode.h" // for HitTestingTreeNode
#include "InputBlockState.h" // for InputBlockState
@ -37,8 +36,9 @@
#include "mozilla/layers/WebRenderScrollDataWrapper.h"
#include "mozilla/MouseEvents.h"
#include "mozilla/mozalloc.h" // for operator new
#include "mozilla/TouchEvents.h"
#include "mozilla/Preferences.h" // for Preferences
#include "mozilla/StaticPrefs.h" // for StaticPrefs
#include "mozilla/TouchEvents.h"
#include "mozilla/EventStateManager.h" // for WheelPrefs
#include "mozilla/webrender/WebRenderAPI.h"
#include "nsDebug.h" // for NS_WARNING
@ -272,7 +272,7 @@ APZCTreeManager::APZCTreeManager(LayersId aRootLayersId)
"layers::APZCTreeManager::APZCTreeManager",
[self] { self->mFlushObserver = new CheckerboardFlushObserver(self); }));
AsyncPanZoomController::InitializeGlobalState();
mApzcTreeLog.ConditionOnPrefFunction(gfxPrefs::APZPrintTree);
mApzcTreeLog.ConditionOnPrefFunction(StaticPrefs::APZPrintTree);
#if defined(MOZ_WIDGET_ANDROID)
if (jni::IsFennec()) {
mToolbarAnimator = new AndroidDynamicToolbarAnimator(this);
@ -369,7 +369,7 @@ APZCTreeManager::UpdateHitTestingTreeImpl(LayersId aRootLayerTreeId,
// For testing purposes, we log some data to the APZTestData associated with
// the layers id that originated this update.
APZTestData* testData = nullptr;
if (gfxPrefs::APZTestLoggingEnabled()) {
if (StaticPrefs::APZTestLoggingEnabled()) {
MutexAutoLock lock(mTestDataLock);
UniquePtr<APZTestData> ptr = MakeUnique<APZTestData>();
auto result = mTestData.insert(
@ -1306,7 +1306,7 @@ nsEventStatus APZCTreeManager::ReceiveInputEvent(
}
if (apzc) {
if (gfxPrefs::APZTestLoggingEnabled() &&
if (StaticPrefs::APZTestLoggingEnabled() &&
mouseInput.mType == MouseInput::MOUSE_HITTEST) {
ScrollableLayerGuid guid = apzc->GetGuid();
@ -1318,7 +1318,7 @@ nsEventStatus APZCTreeManager::ReceiveInputEvent(
}
TargetConfirmationFlags confFlags{hitResult};
bool apzDragEnabled = gfxPrefs::APZDragEnabled();
bool apzDragEnabled = StaticPrefs::APZDragEnabled();
if (apzDragEnabled && hitScrollbar) {
// If scrollbar dragging is enabled and we hit a scrollbar, wait
// for the main-thread confirmation because it contains drag metrics
@ -1544,7 +1544,7 @@ nsEventStatus APZCTreeManager::ReceiveInputEvent(
// Disable async keyboard scrolling when accessibility.browsewithcaret is
// enabled
if (!gfxPrefs::APZKeyboardEnabled() ||
gfxPrefs::AccessibilityBrowseWithCaret()) {
StaticPrefs::AccessibilityBrowseWithCaret()) {
APZ_KEY_LOG("Skipping key input from invalid prefs\n");
return result;
}
@ -1740,7 +1740,7 @@ nsEventStatus APZCTreeManager::ProcessTouchInput(
// checked are similar to the ones we check for MOUSE_INPUT starting
// a scrollbar mouse-drag.
mInScrollbarTouchDrag =
gfxPrefs::APZDragEnabled() && gfxPrefs::APZTouchDragEnabled() &&
StaticPrefs::APZDragEnabled() && StaticPrefs::APZTouchDragEnabled() &&
hitScrollbarNode && hitScrollbarNode->IsScrollThumbNode() &&
hitScrollbarNode->GetScrollbarData().mThumbIsAsyncDraggable;
@ -1923,7 +1923,7 @@ void APZCTreeManager::SetupScrollbarDrag(
// Under some conditions, we can confirm the drag block right away.
// Otherwise, we have to wait for a main-thread confirmation.
if (gfxPrefs::APZDragInitiationEnabled() &&
if (StaticPrefs::APZDragInitiationEnabled() &&
// check that the scrollbar's target scroll frame is layerized
aScrollThumbNode->GetScrollTargetId() == aApzc->GetGuid().mScrollId &&
!aApzc->IsScrollInfoLayer()) {
@ -2387,7 +2387,7 @@ ParentLayerPoint APZCTreeManager::DispatchFling(
AsyncPanZoomController* aPrev, const FlingHandoffState& aHandoffState) {
// If immediate handoff is disallowed, do not allow handoff beyond the
// single APZC that's scrolled by the input block that triggered this fling.
if (aHandoffState.mIsHandoff && !gfxPrefs::APZAllowImmediateHandoff() &&
if (aHandoffState.mIsHandoff && !StaticPrefs::APZAllowImmediateHandoff() &&
aHandoffState.mScrolledApzc == aPrev) {
FLING_LOG("APZCTM dropping handoff due to disallowed immediate handoff\n");
return aHandoffState.mVelocity;
@ -3294,7 +3294,8 @@ LayerToParentLayerMatrix4x4 APZCTreeManager::ComputeTransformForScrollThumb(
// With container scrolling, the RCD-RSF scrollbars are subject to the
// content resolution, which requires some special handling.
bool scrollbarSubjectToResolution =
aMetrics.IsRootContent() && gfxPrefs::LayoutUseContainersForRootFrames();
aMetrics.IsRootContent() &&
StaticPrefs::LayoutUseContainersForRootFrames();
// |asyncTransform| represents the amount by which we have scrolled and
// zoomed since the last paint. Because the scrollbar was sized and positioned

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

@ -23,7 +23,7 @@ namespace layers {
static bool WillHandleMouseEvent(const WidgetMouseEventBase& aEvent) {
return aEvent.mMessage == eMouseMove || aEvent.mMessage == eMouseDown ||
aEvent.mMessage == eMouseUp || aEvent.mMessage == eDragEnd ||
(gfxPrefs::TestEventsAsyncEnabled() &&
(StaticPrefs::TestEventsAsyncEnabled() &&
aEvent.mMessage == eMouseHitTest);
}
@ -66,7 +66,7 @@ nsEventStatus APZInputBridge::ReceiveInputEvent(
// hit testing in a zoomed-in or zoomed-out state.
// FIXME: bug 1525793 -- this may need to handle zooming or not on a
// per-document basis.
if (gfxPrefs::APZAllowZooming()) {
if (StaticPrefs::APZAllowZooming()) {
mouseEvent.mIgnoreRootScrollFrame = true;
}
@ -116,13 +116,13 @@ nsEventStatus APZInputBridge::ReceiveInputEvent(
if (Maybe<APZWheelAction> action = ActionForWheelEvent(&wheelEvent)) {
ScrollWheelInput::ScrollMode scrollMode =
ScrollWheelInput::SCROLLMODE_INSTANT;
if (gfxPrefs::SmoothScrollEnabled() &&
if (StaticPrefs::SmoothScrollEnabled() &&
((wheelEvent.mDeltaMode ==
dom::WheelEvent_Binding::DOM_DELTA_LINE &&
gfxPrefs::WheelSmoothScrollEnabled()) ||
StaticPrefs::WheelSmoothScrollEnabled()) ||
(wheelEvent.mDeltaMode ==
dom::WheelEvent_Binding::DOM_DELTA_PAGE &&
gfxPrefs::PageSmoothScrollEnabled()))) {
StaticPrefs::PageSmoothScrollEnabled()))) {
scrollMode = ScrollWheelInput::SCROLLMODE_SMOOTH;
}

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

@ -15,6 +15,7 @@
#include "OverscrollHandoffState.h"
#include "SimpleVelocityTracker.h"
#include "ViewConfiguration.h"
#include "mozilla/StaticPrefs.h"
#define ANDROID_APZ_LOG(...)
// #define ANDROID_APZ_LOG(...) printf_stderr("ANDROID_APZ: " __VA_ARGS__)
@ -55,7 +56,7 @@ AndroidSpecificState::AndroidSpecificState() {
AsyncPanZoomAnimation* AndroidSpecificState::CreateFlingAnimation(
AsyncPanZoomController& aApzc, const FlingHandoffState& aHandoffState,
float aPLPPI) {
if (gfxPrefs::APZUseChromeFlingPhysics()) {
if (StaticPrefs::APZUseChromeFlingPhysics()) {
return new GenericFlingAnimation<AndroidFlingPhysics>(
aApzc, aHandoffState.mChain, aHandoffState.mIsHandoff,
aHandoffState.mScrolledApzc, aPLPPI);
@ -68,7 +69,7 @@ AsyncPanZoomAnimation* AndroidSpecificState::CreateFlingAnimation(
UniquePtr<VelocityTracker> AndroidSpecificState::CreateVelocityTracker(
Axis* aAxis) {
if (gfxPrefs::APZUseChromeFlingPhysics()) {
if (StaticPrefs::APZUseChromeFlingPhysics()) {
return MakeUnique<AndroidVelocityTracker>();
}
return MakeUnique<SimpleVelocityTracker>(aAxis);
@ -76,7 +77,7 @@ UniquePtr<VelocityTracker> AndroidSpecificState::CreateVelocityTracker(
/* static */
void AndroidSpecificState::InitializeGlobalState() {
// Not conditioned on gfxPrefs::APZUseChromeFlingPhysics() because
// Not conditioned on StaticPrefs::APZUseChromeFlingPhysics() because
// the pref is live.
AndroidFlingPhysics::InitializeGlobalState();
}
@ -167,8 +168,8 @@ StackScrollerFlingAnimation::StackScrollerFlingAnimation(
// flywheel to kick in, then we need to update the timestamp on the
// StackScroller because otherwise it might use a stale velocity.
TimeDuration flingDuration = TimeStamp::Now() - state->mLastFling;
if (flingDuration.ToMilliseconds() < gfxPrefs::APZFlingAccelInterval() &&
velocity.Length() >= gfxPrefs::APZFlingAccelMinVelocity()) {
if (flingDuration.ToMilliseconds() < StaticPrefs::APZFlingAccelInterval() &&
velocity.Length() >= StaticPrefs::APZFlingAccelMinVelocity()) {
bool unused = false;
mOverScroller->ComputeScrollOffset(flingDuration.ToMilliseconds(),
&unused);
@ -242,8 +243,9 @@ bool StackScrollerFlingAnimation::DoSample(FrameMetrics& aFrameMetrics,
float speed = velocity.Length();
// gfxPrefs::APZFlingStoppedThreshold is only used in tests.
if (!shouldContinueFling || (speed < gfxPrefs::APZFlingStoppedThreshold())) {
// StaticPrefs::APZFlingStoppedThreshold is only used in tests.
if (!shouldContinueFling ||
(speed < StaticPrefs::APZFlingStoppedThreshold())) {
if (shouldContinueFling) {
// The OverScroller thinks it should continue but the speed is below
// the stopping threshold so abort the animation.

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

@ -10,7 +10,6 @@
#include "APZCTreeManager.h"
#include "FrameMetrics.h"
#include "gfxPrefs.h"
#include "mozilla/EventForwards.h"
#include "mozilla/FloatingPoint.h"
#include "mozilla/gfx/2D.h"
@ -24,6 +23,7 @@
#include "mozilla/layers/UiCompositorControllerParent.h"
#include "mozilla/MathAlgorithms.h"
#include "mozilla/Move.h"
#include "mozilla/StaticPrefs.h"
#include "mozilla/Unused.h"
namespace {
@ -200,10 +200,10 @@ nsEventStatus AndroidDynamicToolbarAnimator::ReceiveInputEvent(
}
mControllerLastDragDirection = direction;
}
// NOTE: gfxPrefs::ToolbarScrollThreshold() returns a percentage as an
// int32_t. So multiply it by 0.01f to convert.
// 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 * gfxPrefs::ToolbarScrollThreshold() *
Abs(std::lround(0.01f * StaticPrefs::ToolbarScrollThreshold() *
mControllerCompositionHeight));
if ((Abs(mControllerTotalDistance.value) > dragThreshold) &&
(delta != 0)) {

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

@ -9,6 +9,7 @@
#include <cmath>
#include "mozilla/ClearOnShutdown.h"
#include "mozilla/StaticPrefs.h"
#include "mozilla/StaticPtr.h"
namespace mozilla {
@ -32,7 +33,7 @@ const float kDecelerationRate = 2.3582018f;
// Default friction constant in android.view.ViewConfiguration.
static float GetFlingFriction() {
return gfxPrefs::APZChromeFlingPhysicsFriction();
return StaticPrefs::APZChromeFlingPhysicsFriction();
}
// Tension lines cross at (GetInflexion(), 1).
@ -40,7 +41,7 @@ static float GetInflexion() {
// Clamp the inflexion to the range [0,1]. Values outside of this range
// do not make sense in the physics model, and for negative values the
// approximation used to compute the spline curve does not converge.
const float inflexion = gfxPrefs::APZChromeFlingPhysicsInflexion();
const float inflexion = StaticPrefs::APZChromeFlingPhysicsInflexion();
if (inflexion < 0.0f) {
return 0.0f;
}
@ -53,7 +54,7 @@ static float GetInflexion() {
// Fling scroll is stopped when the scroll position is |kThresholdForFlingEnd|
// pixels or closer from the end.
static float GetThresholdForFlingEnd() {
return gfxPrefs::APZChromeFlingPhysicsStopThreshold();
return StaticPrefs::APZChromeFlingPhysicsStopThreshold();
}
static double ComputeSplineDeceleration(ParentLayerCoord aVelocity,

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

@ -6,7 +6,7 @@
#include "AndroidVelocityTracker.h"
#include "gfxPrefs.h"
#include "mozilla/StaticPrefs.h"
namespace mozilla {
namespace layers {
@ -251,7 +251,7 @@ Maybe<float> AndroidVelocityTracker::ComputeVelocity(uint32_t aTimestampMs) {
float time[kHistorySize];
uint32_t m = 0;
int index = mHistory.Length() - 1;
const uint32_t horizon = gfxPrefs::APZVelocityRelevanceTime();
const uint32_t horizon = StaticPrefs::APZVelocityRelevanceTime();
const auto& newest_movement = mHistory[index];
do {

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

@ -33,7 +33,7 @@
#include "UnitTransforms.h" // for TransformTo
#include "base/message_loop.h" // for MessageLoop
#include "base/task.h" // for NewRunnableMethod, etc
#include "gfxPrefs.h" // for gfxPrefs
#include "mozilla/StaticPrefs.h" // for StaticPrefs
#include "gfxTypes.h" // for gfxFloat
#include "LayersLogging.h" // for print_stderr
#include "mozilla/Assertions.h" // for MOZ_ASSERT, etc
@ -131,7 +131,7 @@ typedef PlatformSpecificStateBase
* \page APZCPrefs APZ preferences
*
* The following prefs are used to control the behaviour of the APZC.
* The default values are provided in gfxPrefs.h.
* The default values are provided in StaticPrefs.h.
*
* \li\b apz.allow_double_tap_zooming
* Pref that allows or disallows double tap to zoom
@ -614,7 +614,7 @@ class ZoomAnimation : public AsyncPanZoomAnimation {
const CSSToParentLayerScale2D& aEndZoom)
: mApzc(aApzc),
mTotalDuration(TimeDuration::FromMilliseconds(
gfxPrefs::APZZoomAnimationDuration())),
StaticPrefs::APZZoomAnimationDuration())),
mStartOffset(aStartOffset),
mStartZoom(aStartZoom),
mEndOffset(aEndOffset),
@ -937,25 +937,25 @@ float AsyncPanZoomController::GetDPI() const {
}
ScreenCoord AsyncPanZoomController::GetTouchStartTolerance() const {
return (gfxPrefs::APZTouchStartTolerance() * GetDPI());
return (StaticPrefs::APZTouchStartTolerance() * GetDPI());
}
ScreenCoord AsyncPanZoomController::GetTouchMoveTolerance() const {
return (gfxPrefs::APZTouchMoveTolerance() * GetDPI());
return (StaticPrefs::APZTouchMoveTolerance() * GetDPI());
}
ScreenCoord AsyncPanZoomController::GetSecondTapTolerance() const {
return (gfxPrefs::APZSecondTapTolerance() * GetDPI());
return (StaticPrefs::APZSecondTapTolerance() * GetDPI());
}
/* static */ AsyncPanZoomController::AxisLockMode
AsyncPanZoomController::GetAxisLockMode() {
return static_cast<AxisLockMode>(gfxPrefs::APZAxisLockMode());
return static_cast<AxisLockMode>(StaticPrefs::APZAxisLockMode());
}
/* static */ AsyncPanZoomController::PinchLockMode
AsyncPanZoomController::GetPinchLockMode() {
return static_cast<PinchLockMode>(gfxPrefs::APZPinchLockMode());
return static_cast<PinchLockMode>(StaticPrefs::APZPinchLockMode());
}
bool AsyncPanZoomController::ArePointerEventsConsumable(
@ -1011,7 +1011,7 @@ bool AsyncPanZoomController::ArePointerEventsConsumable(
nsEventStatus AsyncPanZoomController::HandleDragEvent(
const MouseInput& aEvent, const AsyncDragMetrics& aDragMetrics,
CSSCoord aInitialThumbPos) {
if (!gfxPrefs::APZDragEnabled()) {
if (!StaticPrefs::APZDragEnabled()) {
return nsEventStatus_eIgnore;
}
@ -1404,7 +1404,7 @@ nsEventStatus AsyncPanZoomController::OnTouchMove(
}
MOZ_ASSERT(GetCurrentTouchBlock());
if (gfxPrefs::TouchActionEnabled() &&
if (StaticPrefs::TouchActionEnabled() &&
GetCurrentTouchBlock()->TouchActionAllowsPanningXY()) {
// User tries to trigger a touch behavior. If allowed touch behavior is
// vertical pan
@ -1565,7 +1565,7 @@ nsEventStatus AsyncPanZoomController::OnScaleBegin(
// content controller, it may want to do something else with this gesture.
// FIXME: bug 1525793 -- this may need to handle zooming or not on a
// per-document basis.
if (!gfxPrefs::APZAllowZooming()) {
if (!StaticPrefs::APZAllowZooming()) {
if (RefPtr<GeckoContentController> controller =
GetGeckoContentController()) {
controller->NotifyPinchGesture(aEvent.mType, GetGuid(), 0,
@ -1612,7 +1612,7 @@ nsEventStatus AsyncPanZoomController::OnScale(const PinchGestureInput& aEvent) {
// FIXME: bug 1525793 -- this may need to handle zooming or not on a
// per-document basis.
if (!gfxPrefs::APZAllowZooming()) {
if (!StaticPrefs::APZAllowZooming()) {
if (RefPtr<GeckoContentController> controller =
GetGeckoContentController()) {
controller->NotifyPinchGesture(
@ -1702,7 +1702,7 @@ nsEventStatus AsyncPanZoomController::OnScale(const PinchGestureInput& aEvent) {
// We don't want to redraw on every scale, so throttle it.
if (!mPinchPaintTimerSet) {
const int delay = gfxPrefs::APZScaleRepaintDelay();
const int delay = StaticPrefs::APZScaleRepaintDelay();
if (delay >= 0) {
if (RefPtr<GeckoContentController> controller =
GetGeckoContentController()) {
@ -1746,7 +1746,7 @@ nsEventStatus AsyncPanZoomController::OnScaleEnd(
// FIXME: bug 1525793 -- this may need to handle zooming or not on a
// per-document basis.
if (!gfxPrefs::APZAllowZooming()) {
if (!StaticPrefs::APZAllowZooming()) {
if (RefPtr<GeckoContentController> controller =
GetGeckoContentController()) {
controller->NotifyPinchGesture(aEvent.mType, GetGuid(), 0,
@ -1839,9 +1839,9 @@ nsEventStatus AsyncPanZoomController::HandleEndOfPan() {
APZC_LOG("%p starting a fling animation if %f >= %f\n", this,
flingVelocity.Length().value,
gfxPrefs::APZFlingMinVelocityThreshold());
StaticPrefs::APZFlingMinVelocityThreshold());
if (flingVelocity.Length() < gfxPrefs::APZFlingMinVelocityThreshold()) {
if (flingVelocity.Length() < StaticPrefs::APZFlingMinVelocityThreshold()) {
// Relieve overscroll now if needed, since we will not transition to a fling
// animation and then an overscroll animation, and relieve it then.
GetCurrentInputBlock()
@ -1960,7 +1960,7 @@ ParentLayerPoint AsyncPanZoomController::GetScrollWheelDelta(
// EventStateManager::DeltaAccumulator::ComputeScrollAmountForDefaultAction
// and WheelTransaction::OverrideSystemScrollSpeed. Note that we do *not*
// restrict this to the root content, see bug 1217715 for discussion on this.
if (gfxPrefs::MouseWheelHasRootScrollDeltaOverride() &&
if (StaticPrefs::MouseWheelHasRootScrollDeltaOverride() &&
!aEvent.IsCustomizedByUserPrefs() &&
aEvent.mDeltaType == ScrollWheelInput::SCROLLDELTA_LINE &&
aEvent.mAllowToOverrideSystemScrollSpeed) {
@ -1972,9 +1972,9 @@ ParentLayerPoint AsyncPanZoomController::GetScrollWheelDelta(
// it might need extra acceleration. See WheelHandlingHelper.cpp.
if (aEvent.mDeltaType == ScrollWheelInput::SCROLLDELTA_LINE &&
aEvent.mScrollSeriesNumber > 0) {
int32_t start = gfxPrefs::MouseWheelAccelerationStart();
int32_t start = StaticPrefs::MouseWheelAccelerationStart();
if (start >= 0 && aEvent.mScrollSeriesNumber >= uint32_t(start)) {
int32_t factor = gfxPrefs::MouseWheelAccelerationFactor();
int32_t factor = StaticPrefs::MouseWheelAccelerationFactor();
if (factor > 0) {
delta.x = ComputeAcceleratedWheelDelta(
delta.x, aEvent.mScrollSeriesNumber, factor);
@ -2008,7 +2008,7 @@ nsEventStatus AsyncPanZoomController::OnKeyboard(const KeyboardInput& aEvent) {
MaybeAdjustDestinationForScrollSnapping(aEvent, destination);
// If smooth scrolling is disabled, then scroll immediately to the destination
if (!gfxPrefs::SmoothScrollEnabled()) {
if (!StaticPrefs::SmoothScrollEnabled()) {
CancelAnimation();
// CallDispatchScroll interprets the start and end points as the start and
@ -2108,7 +2108,7 @@ CSSPoint AsyncPanZoomController::GetKeyboardDestination(
switch (aAction.mType) {
case KeyboardScrollAction::eScrollCharacter: {
int32_t scrollDistance = gfxPrefs::ToolkitHorizontalScrollDistance();
int32_t scrollDistance = StaticPrefs::ToolkitHorizontalScrollDistance();
if (aAction.mForward) {
scrollDestination.x += scrollDistance * lineScrollSize.width;
@ -2118,7 +2118,7 @@ CSSPoint AsyncPanZoomController::GetKeyboardDestination(
break;
}
case KeyboardScrollAction::eScrollLine: {
int32_t scrollDistance = gfxPrefs::ToolkitVerticalScrollDistance();
int32_t scrollDistance = StaticPrefs::ToolkitVerticalScrollDistance();
if (aAction.mForward) {
scrollDestination.y += scrollDistance * lineScrollSize.height;
@ -2253,7 +2253,7 @@ bool AsyncPanZoomController::IsContentOfHonouredTargetRightToLeft(
bool AsyncPanZoomController::AllowScrollHandoffInCurrentBlock() const {
bool result = mInputQueue->AllowScrollHandoff();
if (!gfxPrefs::APZAllowImmediateHandoff()) {
if (!StaticPrefs::APZAllowImmediateHandoff()) {
if (InputBlockState* currentBlock = GetCurrentInputBlock()) {
// Do not allow handoff beyond the first APZC to scroll.
if (currentBlock->GetScrolledApzc() == this) {
@ -2338,7 +2338,7 @@ nsEventStatus AsyncPanZoomController::OnScrollWheel(
} else if ((delta.x || delta.y) && !CanScrollWithWheel(delta)) {
// We can't scroll this apz anymore, so we simply drop the event.
if (mInputQueue->GetActiveWheelTransaction() &&
gfxPrefs::MouseScrollTestingEnabled()) {
StaticPrefs::MouseScrollTestingEnabled()) {
if (RefPtr<GeckoContentController> controller =
GetGeckoContentController()) {
controller->NotifyMozMouseScrollEvent(
@ -2929,10 +2929,11 @@ void AsyncPanZoomController::HandlePanningWithTouchAction(double aAngle) {
this, ScrollDirection::eVertical);
if (GetCurrentTouchBlock()->TouchActionAllowsPanningXY()) {
if (canScrollHorizontal && canScrollVertical) {
if (apz::IsCloseToHorizontal(aAngle, gfxPrefs::APZAxisLockAngle())) {
if (apz::IsCloseToHorizontal(aAngle, StaticPrefs::APZAxisLockAngle())) {
mY.SetAxisLocked(true);
SetState(PANNING_LOCKED_X);
} else if (apz::IsCloseToVertical(aAngle, gfxPrefs::APZAxisLockAngle())) {
} else if (apz::IsCloseToVertical(aAngle,
StaticPrefs::APZAxisLockAngle())) {
mX.SetAxisLocked(true);
SetState(PANNING_LOCKED_Y);
} else {
@ -2947,7 +2948,7 @@ void AsyncPanZoomController::HandlePanningWithTouchAction(double aAngle) {
// Using bigger angle for panning to keep behavior consistent
// with IE.
if (apz::IsCloseToHorizontal(aAngle,
gfxPrefs::APZAllowedDirectPanAngle())) {
StaticPrefs::APZAllowedDirectPanAngle())) {
mY.SetAxisLocked(true);
SetState(PANNING_LOCKED_X);
mPanDirRestricted = true;
@ -2957,7 +2958,8 @@ void AsyncPanZoomController::HandlePanningWithTouchAction(double aAngle) {
SetState(NOTHING);
}
} else if (GetCurrentTouchBlock()->TouchActionAllowsPanningY()) {
if (apz::IsCloseToVertical(aAngle, gfxPrefs::APZAllowedDirectPanAngle())) {
if (apz::IsCloseToVertical(aAngle,
StaticPrefs::APZAllowedDirectPanAngle())) {
mX.SetAxisLocked(true);
SetState(PANNING_LOCKED_Y);
mPanDirRestricted = true;
@ -2990,12 +2992,13 @@ void AsyncPanZoomController::HandlePanning(double aAngle) {
if (!canScrollHorizontal || !canScrollVertical) {
SetState(PANNING);
} else if (apz::IsCloseToHorizontal(aAngle, gfxPrefs::APZAxisLockAngle())) {
} else if (apz::IsCloseToHorizontal(aAngle,
StaticPrefs::APZAxisLockAngle())) {
mY.SetAxisLocked(true);
if (canScrollHorizontal) {
SetState(PANNING_LOCKED_X);
}
} else if (apz::IsCloseToVertical(aAngle, gfxPrefs::APZAxisLockAngle())) {
} else if (apz::IsCloseToVertical(aAngle, StaticPrefs::APZAxisLockAngle())) {
mX.SetAxisLocked(true);
if (canScrollVertical) {
SetState(PANNING_LOCKED_Y);
@ -3015,18 +3018,19 @@ void AsyncPanZoomController::HandlePanningUpdate(
double angle = atan2(vector.y, vector.x); // range [-pi, pi]
angle = fabs(angle); // range [0, pi]
float breakThreshold = gfxPrefs::APZAxisBreakoutThreshold() * GetDPI();
float breakThreshold = StaticPrefs::APZAxisBreakoutThreshold() * GetDPI();
if (fabs(aPanDistance.x) > breakThreshold ||
fabs(aPanDistance.y) > breakThreshold) {
if (mState == PANNING_LOCKED_X) {
if (!apz::IsCloseToHorizontal(angle,
gfxPrefs::APZAxisBreakoutAngle())) {
StaticPrefs::APZAxisBreakoutAngle())) {
mY.SetAxisLocked(false);
SetState(PANNING);
}
} else if (mState == PANNING_LOCKED_Y) {
if (!apz::IsCloseToVertical(angle, gfxPrefs::APZAxisBreakoutAngle())) {
if (!apz::IsCloseToVertical(angle,
StaticPrefs::APZAxisBreakoutAngle())) {
mX.SetAxisLocked(false);
SetState(PANNING);
}
@ -3070,15 +3074,15 @@ void AsyncPanZoomController::HandlePinchLocking() {
if (mPinchLocked) {
if (GetPinchLockMode() == PINCH_STICKY) {
ScreenCoord spanBreakoutThreshold =
gfxPrefs::APZPinchLockSpanBreakoutThreshold() * GetDPI();
StaticPrefs::APZPinchLockSpanBreakoutThreshold() * GetDPI();
mPinchLocked = !(spanDistance > spanBreakoutThreshold);
}
} else {
if (GetPinchLockMode() != PINCH_FREE) {
ScreenCoord spanLockThreshold =
gfxPrefs::APZPinchLockSpanLockThreshold() * GetDPI();
StaticPrefs::APZPinchLockSpanLockThreshold() * GetDPI();
ScreenCoord scrollLockThreshold =
gfxPrefs::APZPinchLockScrollLockThreshold() * GetDPI();
StaticPrefs::APZPinchLockScrollLockThreshold() * GetDPI();
if (spanDistance < spanLockThreshold &&
focusChange.Length() > scrollLockThreshold) {
@ -3096,7 +3100,7 @@ nsEventStatus AsyncPanZoomController::StartPanning(
angle = fabs(angle); // range [0, pi]
RecursiveMutexAutoLock lock(mRecursiveMutex);
if (gfxPrefs::TouchActionEnabled()) {
if (StaticPrefs::TouchActionEnabled()) {
HandlePanningWithTouchAction(angle);
} else {
if (GetAxisLockMode() == FREE) {
@ -3251,10 +3255,12 @@ void AsyncPanZoomController::OverscrollForPanning(
// that axis is greater than the pan distance along the other axis by a
// configurable factor. If we are already overscrolled, don't check this.
if (!IsOverscrolled()) {
if (aPanDistance.x < gfxPrefs::APZMinPanDistanceRatio() * aPanDistance.y) {
if (aPanDistance.x <
StaticPrefs::APZMinPanDistanceRatio() * aPanDistance.y) {
aOverscroll.x = 0;
}
if (aPanDistance.y < gfxPrefs::APZMinPanDistanceRatio() * aPanDistance.x) {
if (aPanDistance.y <
StaticPrefs::APZMinPanDistanceRatio() * aPanDistance.x) {
aOverscroll.y = 0;
}
}
@ -3263,7 +3269,7 @@ void AsyncPanZoomController::OverscrollForPanning(
}
void AsyncPanZoomController::OverscrollBy(ParentLayerPoint& aOverscroll) {
if (!gfxPrefs::APZOverscrollEnabled()) {
if (!StaticPrefs::APZOverscrollEnabled()) {
return;
}
@ -3330,7 +3336,7 @@ ParentLayerPoint AsyncPanZoomController::AttemptFling(
// that generate events faster than the clock resolution.
ParentLayerPoint velocity = GetVelocityVector();
if (!velocity.IsFinite() ||
velocity.Length() < gfxPrefs::APZFlingMinVelocityThreshold()) {
velocity.Length() < StaticPrefs::APZFlingMinVelocityThreshold()) {
// Relieve overscroll now if needed, since we will not transition to a fling
// animation and then an overscroll animation, and relieve it then.
aHandoffState.mChain->SnapBackOverscrolledApzc(this);
@ -3401,7 +3407,7 @@ void AsyncPanZoomController::HandleFlingOverscroll(
FLING_LOG("APZC %p left with residual velocity %s\n", this,
Stringify(residualVelocity).c_str());
if (!IsZero(residualVelocity) && IsPannable() &&
gfxPrefs::APZOverscrollEnabled()) {
StaticPrefs::APZOverscrollEnabled()) {
// Obey overscroll-behavior.
RecursiveMutexAutoLock lock(mRecursiveMutex);
if (!mX.OverscrollBehaviorAllowsOverscrollEffect()) {
@ -3446,8 +3452,8 @@ void AsyncPanZoomController::SmoothScrollTo(const CSSPoint& aDestination) {
StartAnimation(new SmoothScrollAnimation(
*this, initialPosition, initialVelocity, destination,
gfxPrefs::ScrollBehaviorSpringConstant(),
gfxPrefs::ScrollBehaviorDampingRatio()));
StaticPrefs::ScrollBehaviorSpringConstant(),
StaticPrefs::ScrollBehaviorDampingRatio()));
}
}
@ -3658,21 +3664,23 @@ void AsyncPanZoomController::ScaleWithFocus(float aScale,
*/
static CSSSize CalculateDisplayPortSize(const CSSSize& aCompositionSize,
const CSSPoint& aVelocity) {
bool xIsStationarySpeed = fabsf(aVelocity.x) < gfxPrefs::APZMinSkateSpeed();
bool yIsStationarySpeed = fabsf(aVelocity.y) < gfxPrefs::APZMinSkateSpeed();
bool xIsStationarySpeed =
fabsf(aVelocity.x) < StaticPrefs::APZMinSkateSpeed();
bool yIsStationarySpeed =
fabsf(aVelocity.y) < StaticPrefs::APZMinSkateSpeed();
float xMultiplier = xIsStationarySpeed
? gfxPrefs::APZXStationarySizeMultiplier()
: gfxPrefs::APZXSkateSizeMultiplier();
? StaticPrefs::APZXStationarySizeMultiplier()
: StaticPrefs::APZXSkateSizeMultiplier();
float yMultiplier = yIsStationarySpeed
? gfxPrefs::APZYStationarySizeMultiplier()
: gfxPrefs::APZYSkateSizeMultiplier();
? StaticPrefs::APZYStationarySizeMultiplier()
: StaticPrefs::APZYSkateSizeMultiplier();
if (IsHighMemSystem() && !xIsStationarySpeed) {
xMultiplier += gfxPrefs::APZXSkateHighMemAdjust();
xMultiplier += StaticPrefs::APZXSkateHighMemAdjust();
}
if (IsHighMemSystem() && !yIsStationarySpeed) {
yMultiplier += gfxPrefs::APZYSkateHighMemAdjust();
yMultiplier += StaticPrefs::APZYSkateHighMemAdjust();
}
return aCompositionSize * CSSSize(xMultiplier, yMultiplier);
@ -3689,9 +3697,9 @@ static CSSSize ExpandDisplayPortToDangerZone(
CSSSize dangerZone(0.0f, 0.0f);
if (aFrameMetrics.LayersPixelsPerCSSPixel().xScale != 0 &&
aFrameMetrics.LayersPixelsPerCSSPixel().yScale != 0) {
dangerZone =
LayerSize(gfxPrefs::APZDangerZoneX(), gfxPrefs::APZDangerZoneY()) /
aFrameMetrics.LayersPixelsPerCSSPixel();
dangerZone = LayerSize(StaticPrefs::APZDangerZoneX(),
StaticPrefs::APZDangerZoneY()) /
aFrameMetrics.LayersPixelsPerCSSPixel();
}
const CSSSize compositionSize =
aFrameMetrics.CalculateBoundedCompositedSizeInCssPixels();
@ -3750,7 +3758,7 @@ const ScreenMargin AsyncPanZoomController::CalculatePendingDisplayPort(
displayPortSize =
ExpandDisplayPortToDangerZone(displayPortSize, aFrameMetrics);
if (gfxPrefs::APZEnlargeDisplayPortWhenClipped()) {
if (StaticPrefs::APZEnlargeDisplayPortWhenClipped()) {
RedistributeDisplayPortExcess(displayPortSize, scrollableRect);
}
@ -3769,7 +3777,7 @@ const ScreenMargin AsyncPanZoomController::CalculatePendingDisplayPort(
// Offset the displayport, depending on how fast we're moving and the
// estimated time it takes to paint, to try to minimise checkerboarding.
float paintFactor = kDefaultEstimatedPaintDurationMs;
displayPort.MoveBy(velocity * paintFactor * gfxPrefs::APZVelocityBias());
displayPort.MoveBy(velocity * paintFactor * StaticPrefs::APZVelocityBias());
APZC_LOG_FM(
aFrameMetrics,
@ -3833,8 +3841,8 @@ bool AsyncPanZoomController::SnapBackIfOverscrolled() {
bool AsyncPanZoomController::IsFlingingFast() const {
RecursiveMutexAutoLock lock(mRecursiveMutex);
if (mState == FLING &&
GetVelocityVector().Length() > gfxPrefs::APZFlingStopOnTapThreshold()) {
if (mState == FLING && GetVelocityVector().Length() >
StaticPrefs::APZFlingStopOnTapThreshold()) {
APZC_LOG("%p is moving fast\n", this);
return true;
}
@ -4188,7 +4196,7 @@ AsyncPanZoomController::GetCurrentAsyncTransformForFixedAdjustment(
// with apz.allow_zooming enabled).
// FIXME: bug 1525793 -- this may need to handle zooming or not on a
// per-document basis.
return (gfxPrefs::APZAllowZooming() && Metrics().IsRootContent() &&
return (StaticPrefs::APZAllowZooming() && Metrics().IsRootContent() &&
Metrics().GetVisualViewport().Size() <=
Metrics().GetLayoutViewport().Size())
? GetCurrentAsyncViewportTransform(aMode)
@ -4216,7 +4224,7 @@ LayoutDeviceToParentLayerScale AsyncPanZoomController::GetCurrentPinchZoomScale(
CSSRect AsyncPanZoomController::GetEffectiveLayoutViewport(
AsyncTransformConsumer aMode) const {
if (gfxPrefs::APZFrameDelayEnabled() && aMode == eForCompositing) {
if (StaticPrefs::APZFrameDelayEnabled() && aMode == eForCompositing) {
return mCompositedLayoutViewport;
}
return Metrics().GetLayoutViewport();
@ -4224,7 +4232,7 @@ CSSRect AsyncPanZoomController::GetEffectiveLayoutViewport(
CSSPoint AsyncPanZoomController::GetEffectiveScrollOffset(
AsyncTransformConsumer aMode) const {
if (gfxPrefs::APZFrameDelayEnabled() && aMode == eForCompositing) {
if (StaticPrefs::APZFrameDelayEnabled() && aMode == eForCompositing) {
return mCompositedScrollOffset;
}
return Metrics().GetScrollOffset();
@ -4232,7 +4240,7 @@ CSSPoint AsyncPanZoomController::GetEffectiveScrollOffset(
CSSToParentLayerScale2D AsyncPanZoomController::GetEffectiveZoom(
AsyncTransformConsumer aMode) const {
if (gfxPrefs::APZFrameDelayEnabled() && aMode == eForCompositing) {
if (StaticPrefs::APZFrameDelayEnabled() && aMode == eForCompositing) {
return mCompositedZoom;
}
return Metrics().GetZoom();
@ -4328,7 +4336,7 @@ void AsyncPanZoomController::ReportCheckerboard(const TimeStamp& aSampleTime) {
}
mLastCheckerboardReport = aSampleTime;
bool recordTrace = gfxPrefs::APZRecordCheckerboarding();
bool recordTrace = StaticPrefs::APZRecordCheckerboarding();
bool forTelemetry = Telemetry::CanRecordExtended();
uint32_t magnitude = GetCheckerboardMagnitude();
@ -4357,7 +4365,7 @@ void AsyncPanZoomController::UpdateCheckerboardEvent(
mPotentialCheckerboardTracker.CheckerboardDone();
if (gfxPrefs::APZRecordCheckerboarding()) {
if (StaticPrefs::APZRecordCheckerboarding()) {
// if the pref is enabled, also send it to the storage class. it may be
// chosen for public display on about:checkerboard, the hall of fame for
// checkerboard events.
@ -4662,7 +4670,7 @@ void AsyncPanZoomController::NotifyLayersUpdated(
// this we need to update mExpectedGeckoMetrics to be the last thing we
// know was painted by Gecko.
Maybe<CSSPoint> relativeDelta;
if (gfxPrefs::APZRelativeUpdate() && aLayerMetrics.IsRelative()) {
if (StaticPrefs::APZRelativeUpdate() && aLayerMetrics.IsRelative()) {
APZC_LOG("%p relative updating scroll offset from %s by %s\n", this,
ToString(Metrics().GetScrollOffset()).c_str(),
ToString(aLayerMetrics.GetScrollOffset() -
@ -4737,7 +4745,7 @@ void AsyncPanZoomController::NotifyLayersUpdated(
// See comment on the similar code in the |if (scrollOffsetUpdated)| block
// above.
if (gfxPrefs::APZRelativeUpdate() && aLayerMetrics.IsRelative()) {
if (StaticPrefs::APZRelativeUpdate() && aLayerMetrics.IsRelative()) {
Metrics().ApplyRelativeSmoothScrollUpdateFrom(aLayerMetrics);
} else {
Metrics().ApplySmoothScrollUpdateFrom(aLayerMetrics);
@ -5172,7 +5180,7 @@ void AsyncPanZoomController::UpdateSharedCompositorFrameMetrics() {
? static_cast<FrameMetrics*>(mSharedFrameMetricsBuffer->memory())
: nullptr;
if (frame && mSharedLock && gfxPrefs::ProgressivePaint()) {
if (frame && mSharedLock && StaticPrefs::ProgressivePaint()) {
mSharedLock->Lock();
*frame = Metrics();
mSharedLock->Unlock();
@ -5186,7 +5194,7 @@ void AsyncPanZoomController::ShareCompositorFrameMetrics() {
// we are using progressive tile painting, and we have a
// controller to pass the shared memory back to the content process/thread.
if (!mSharedFrameMetricsBuffer && mMetricsSharingController &&
gfxPrefs::ProgressivePaint()) {
StaticPrefs::ProgressivePaint()) {
// Create shared memory and initialize it with the current FrameMetrics
// value
mSharedFrameMetricsBuffer = new ipc::SharedMemoryBasic;
@ -5274,7 +5282,7 @@ void AsyncPanZoomController::ScrollSnap() {
void AsyncPanZoomController::ScrollSnapToDestination() {
RecursiveMutexAutoLock lock(mRecursiveMutex);
float friction = gfxPrefs::APZFlingFriction();
float friction = StaticPrefs::APZFlingFriction();
ParentLayerPoint velocity(mX.GetVelocity(), mY.GetVelocity());
ParentLayerPoint predictedDelta;
// "-velocity / log(1.0 - friction)" is the integral of the deceleration

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

@ -26,8 +26,8 @@ class DesktopFlingPhysics {
}
void Sample(const TimeDuration& aDelta, ParentLayerPoint* aOutVelocity,
ParentLayerPoint* aOutOffset) {
float friction = gfxPrefs::APZFlingFriction();
float threshold = gfxPrefs::APZFlingStoppedThreshold();
float friction = StaticPrefs::APZFlingFriction();
float threshold = StaticPrefs::APZFlingStoppedThreshold();
mVelocity = ParentLayerPoint(
ApplyFrictionOrCancel(mVelocity.x, aDelta, friction, threshold),

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

@ -139,7 +139,7 @@ FocusTarget::FocusTarget(PresShell* aRootPresShell,
// Check if there are key event listeners that could prevent default or change
// the focus or selection of the page.
if (gfxPrefs::APZKeyboardPassiveListeners()) {
if (StaticPrefs::APZKeyboardPassiveListeners()) {
mFocusHasKeyEventListeners =
HasListenersForNonPassiveKeyEvents(keyEventTarget.get());
} else {

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

@ -95,8 +95,8 @@ class GenericFlingAnimation : public AsyncPanZoomAnimation,
bool applyAcceleration = !aFlingIsHandedOff;
if (applyAcceleration && !mApzc.mLastFlingTime.IsNull() &&
(now - mApzc.mLastFlingTime).ToMilliseconds() <
gfxPrefs::APZFlingAccelInterval() &&
velocity.Length() >= gfxPrefs::APZFlingAccelMinVelocity()) {
StaticPrefs::APZFlingAccelInterval() &&
velocity.Length() >= StaticPrefs::APZFlingAccelMinVelocity()) {
if (velocity.x != 0 &&
SameDirection(velocity.x, mApzc.mLastFlingVelocity.x)) {
velocity.x = Accelerate(velocity.x, mApzc.mLastFlingVelocity.x);
@ -221,8 +221,8 @@ class GenericFlingAnimation : public AsyncPanZoomAnimation,
}
static float Accelerate(float aBase, float aSupplemental) {
return (aBase * gfxPrefs::APZFlingAccelBaseMultiplier()) +
(aSupplemental * gfxPrefs::APZFlingAccelSupplementalMultiplier());
return (aBase * StaticPrefs::APZFlingAccelBaseMultiplier()) +
(aSupplemental * StaticPrefs::APZFlingAccelSupplementalMultiplier());
}
AsyncPanZoomController& mApzc;

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

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

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

@ -297,7 +297,7 @@ nsEventStatus GestureEventListener::HandleInputTouchMove() {
CancelLongTapTimeoutTask();
CancelMaxTapTimeoutTask();
mSingleTapSent = Nothing();
if (!gfxPrefs::APZOneTouchPinchEnabled()) {
if (!StaticPrefs::APZOneTouchPinchEnabled()) {
// If the one-touch-pinch feature is disabled, bail out of the double-
// tap gesture instead.
SetState(GESTURE_NONE);
@ -601,7 +601,7 @@ void GestureEventListener::CreateLongTapTimeoutTask() {
mLongTapTimeoutTask = task;
mAsyncPanZoomController->PostDelayedTask(
task.forget(), gfxPrefs::UiClickHoldContextMenusDelay());
task.forget(), StaticPrefs::UiClickHoldContextMenusDelay());
}
void GestureEventListener::CancelMaxTapTimeoutTask() {
@ -629,7 +629,7 @@ void GestureEventListener::CreateMaxTapTimeoutTask() {
mMaxTapTimeoutTask = task;
mAsyncPanZoomController->PostDelayedTask(task.forget(),
gfxPrefs::APZMaxTapTime());
StaticPrefs::APZMaxTapTime());
}
} // namespace layers

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

@ -273,7 +273,7 @@ CompositorHitTestInfo HitTestingTreeNode::HitTest(
if (mEventRegions.mDTCRequiresTargetConfirmation) {
result += CompositorHitTestFlags::eRequiresTargetConfirmation;
}
} else if (gfxPrefs::TouchActionEnabled()) {
} else if (StaticPrefs::TouchActionEnabled()) {
if (mEventRegions.mNoActionRegion.Contains(point.x, point.y)) {
// set all the touch-action flags as disabled
result += CompositorHitTestTouchActionMask;

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

@ -149,7 +149,7 @@ bool InputBlockState::IsDownchainOf(AsyncPanZoomController* aA,
void InputBlockState::SetScrolledApzc(AsyncPanZoomController* aApzc) {
// An input block should only have one scrolled APZC.
MOZ_ASSERT(!mScrolledApzc || (gfxPrefs::APZAllowImmediateHandoff()
MOZ_ASSERT(!mScrolledApzc || (StaticPrefs::APZAllowImmediateHandoff()
? IsDownchainOf(mScrolledApzc, aApzc)
: mScrolledApzc == aApzc));
@ -404,7 +404,8 @@ bool WheelBlockState::MaybeTimeout(const ScrollWheelInput& aEvent) {
// If there's a recent mouse movement, we can time out the transaction
// early.
TimeDuration duration = TimeStamp::Now() - mLastMouseMove;
if (duration.ToMilliseconds() >= gfxPrefs::MouseWheelIgnoreMoveDelayMs()) {
if (duration.ToMilliseconds() >=
StaticPrefs::MouseWheelIgnoreMoveDelayMs()) {
TBS_LOG("%p wheel transaction timed out after mouse move\n", this);
EndTransaction();
return true;
@ -420,13 +421,14 @@ bool WheelBlockState::MaybeTimeout(const TimeStamp& aTimeStamp) {
// End the transaction if the event occurred > 1.5s after the most recently
// seen wheel event.
TimeDuration duration = aTimeStamp - mLastEventTime;
if (duration.ToMilliseconds() < gfxPrefs::MouseWheelTransactionTimeoutMs()) {
if (duration.ToMilliseconds() <
StaticPrefs::MouseWheelTransactionTimeoutMs()) {
return false;
}
TBS_LOG("%p wheel transaction timed out\n", this);
if (gfxPrefs::MouseScrollTestingEnabled()) {
if (StaticPrefs::MouseScrollTestingEnabled()) {
RefPtr<AsyncPanZoomController> apzc = GetTargetApzc();
apzc->NotifyMozMouseScrollEvent(
NS_LITERAL_STRING("MozMouseScrollTransactionTimeout"));
@ -450,7 +452,8 @@ void WheelBlockState::OnMouseMove(const ScreenIntPoint& aPoint) {
// this as the most recent mouse movement.
TimeStamp now = TimeStamp::Now();
TimeDuration duration = now - mLastEventTime;
if (duration.ToMilliseconds() >= gfxPrefs::MouseWheelIgnoreMoveDelayMs()) {
if (duration.ToMilliseconds() >=
StaticPrefs::MouseWheelIgnoreMoveDelayMs()) {
mLastMouseMove = now;
}
}
@ -581,7 +584,7 @@ TouchBlockState::TouchBlockState(
mInSlop(false),
mTouchCounter(aCounter) {
TBS_LOG("Creating %p\n", this);
if (!gfxPrefs::TouchActionEnabled()) {
if (!StaticPrefs::TouchActionEnabled()) {
mAllowedTouchBehaviorSet = true;
}
}
@ -613,7 +616,7 @@ bool TouchBlockState::HasAllowedTouchBehaviors() const {
void TouchBlockState::CopyPropertiesFrom(const TouchBlockState& aOther) {
TBS_LOG("%p copying properties from %p\n", this, &aOther);
if (gfxPrefs::TouchActionEnabled()) {
if (StaticPrefs::TouchActionEnabled()) {
MOZ_ASSERT(aOther.mAllowedTouchBehaviorSet ||
aOther.IsContentResponseTimerExpired());
SetAllowedTouchBehaviors(aOther.mAllowedTouchBehaviors);
@ -624,7 +627,7 @@ void TouchBlockState::CopyPropertiesFrom(const TouchBlockState& aOther) {
bool TouchBlockState::HasReceivedAllContentNotifications() const {
return CancelableBlockState::HasReceivedAllContentNotifications()
// See comment in TouchBlockState::IsReadyforHandling()
&& (!gfxPrefs::TouchActionEnabled() || mAllowedTouchBehaviorSet);
&& (!StaticPrefs::TouchActionEnabled() || mAllowedTouchBehaviorSet);
}
bool TouchBlockState::IsReadyForHandling() const {
@ -632,7 +635,7 @@ bool TouchBlockState::IsReadyForHandling() const {
return false;
}
if (!gfxPrefs::TouchActionEnabled()) {
if (!StaticPrefs::TouchActionEnabled()) {
// If TouchActionEnabled() was false when this block was created, then
// mAllowedTouchBehaviorSet is guaranteed to the true. However, the pref
// may have been flipped to false after the block was created. In that case,
@ -670,7 +673,7 @@ void TouchBlockState::DispatchEvent(const InputData& aEvent) const {
}
bool TouchBlockState::TouchActionAllowsPinchZoom() const {
if (!gfxPrefs::TouchActionEnabled()) {
if (!StaticPrefs::TouchActionEnabled()) {
return true;
}
// Pointer events specification requires that all touch points allow zoom.
@ -683,7 +686,7 @@ bool TouchBlockState::TouchActionAllowsPinchZoom() const {
}
bool TouchBlockState::TouchActionAllowsDoubleTapZoom() const {
if (!gfxPrefs::TouchActionEnabled()) {
if (!StaticPrefs::TouchActionEnabled()) {
return true;
}
for (size_t i = 0; i < mAllowedTouchBehaviors.Length(); i++) {
@ -695,7 +698,7 @@ bool TouchBlockState::TouchActionAllowsDoubleTapZoom() const {
}
bool TouchBlockState::TouchActionAllowsPanningX() const {
if (!gfxPrefs::TouchActionEnabled()) {
if (!StaticPrefs::TouchActionEnabled()) {
return true;
}
if (mAllowedTouchBehaviors.IsEmpty()) {
@ -707,7 +710,7 @@ bool TouchBlockState::TouchActionAllowsPanningX() const {
}
bool TouchBlockState::TouchActionAllowsPanningY() const {
if (!gfxPrefs::TouchActionEnabled()) {
if (!StaticPrefs::TouchActionEnabled()) {
return true;
}
if (mAllowedTouchBehaviors.IsEmpty()) {
@ -719,7 +722,7 @@ bool TouchBlockState::TouchActionAllowsPanningY() const {
}
bool TouchBlockState::TouchActionAllowsPanningXY() const {
if (!gfxPrefs::TouchActionEnabled()) {
if (!StaticPrefs::TouchActionEnabled()) {
return true;
}
if (mAllowedTouchBehaviors.IsEmpty()) {
@ -777,8 +780,8 @@ Maybe<ScrollDirection> TouchBlockState::GetBestGuessPanDirection(
angle = fabs(angle); // range [0, pi]
double angleThreshold = TouchActionAllowsPanningXY()
? gfxPrefs::APZAxisLockAngle()
: gfxPrefs::APZAllowedDirectPanAngle();
? StaticPrefs::APZAxisLockAngle()
: StaticPrefs::APZAllowedDirectPanAngle();
if (apz::IsCloseToHorizontal(angle, angleThreshold)) {
return Some(ScrollDirection::eHorizontal);
}

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

@ -82,7 +82,7 @@ nsEventStatus InputQueue::ReceiveTouchInput(
if (aEvent.mType == MultiTouchInput::MULTITOUCH_START) {
nsTArray<TouchBehaviorFlags> currentBehaviors;
bool haveBehaviors = false;
if (!gfxPrefs::TouchActionEnabled()) {
if (!StaticPrefs::TouchActionEnabled()) {
haveBehaviors = true;
} else if (mActiveTouchBlock) {
haveBehaviors =
@ -114,7 +114,7 @@ nsEventStatus InputQueue::ReceiveTouchInput(
aTarget, InputBlockState::TargetConfirmationState::eConfirmed,
nullptr /* the block was just created so it has no events */,
false /* not a scrollbar drag */);
if (gfxPrefs::TouchActionEnabled()) {
if (StaticPrefs::TouchActionEnabled()) {
block->SetAllowedTouchBehaviors(currentBehaviors);
}
INPQ_LOG("block %p tagged as fast-motion\n", block);
@ -318,7 +318,7 @@ nsEventStatus InputQueue::ReceiveKeyboardInput(
// If APZ is allowing passive listeners then we must dispatch the event to
// content, otherwise we can consume the event.
return gfxPrefs::APZKeyboardPassiveListeners()
return StaticPrefs::APZKeyboardPassiveListeners()
? nsEventStatus_eConsumeDoDefault
: nsEventStatus_eConsumeNoDefault;
}
@ -551,7 +551,7 @@ void InputQueue::ScheduleMainThreadTimeout(
RefPtr<Runnable> timeoutTask = NewRunnableMethod<uint64_t>(
"layers::InputQueue::MainThreadTimeout", this,
&InputQueue::MainThreadTimeout, aBlock->GetBlockId());
int32_t timeout = gfxPrefs::APZContentResponseTimeout();
int32_t timeout = StaticPrefs::APZContentResponseTimeout();
if (timeout == 0) {
// If the timeout is zero, treat it as a request to ignore any main
// thread confirmation and unconditionally use fallback behaviour for

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

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

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

@ -6,8 +6,8 @@
#include "SimpleVelocityTracker.h"
#include "gfxPrefs.h"
#include "mozilla/ComputedTimingFunction.h" // for ComputedTimingFunction
#include "mozilla/StaticPrefs.h"
#include "mozilla/StaticPtr.h" // for StaticAutoPtr
#define SVT_LOG(...)
@ -86,7 +86,7 @@ Maybe<float> SimpleVelocityTracker::ComputeVelocity(uint32_t aTimestampMs) {
int count = 0;
for (const auto& e : mVelocityQueue) {
uint32_t timeDelta = (aTimestampMs - e.first);
if (timeDelta < gfxPrefs::APZVelocityRelevanceTime()) {
if (timeDelta < StaticPrefs::APZVelocityRelevanceTime()) {
count++;
velocity += e.second;
}
@ -110,17 +110,17 @@ void SimpleVelocityTracker::AddVelocityToQueue(uint32_t aTimestampMs,
float SimpleVelocityTracker::ApplyFlingCurveToVelocity(float aVelocity) const {
float newVelocity = aVelocity;
if (gfxPrefs::APZMaxVelocity() > 0.0f) {
if (StaticPrefs::APZMaxVelocity() > 0.0f) {
bool velocityIsNegative = (newVelocity < 0);
newVelocity = fabs(newVelocity);
float maxVelocity = mAxis->ToLocalVelocity(gfxPrefs::APZMaxVelocity());
float maxVelocity = mAxis->ToLocalVelocity(StaticPrefs::APZMaxVelocity());
newVelocity = std::min(newVelocity, maxVelocity);
if (gfxPrefs::APZCurveThreshold() > 0.0f &&
gfxPrefs::APZCurveThreshold() < gfxPrefs::APZMaxVelocity()) {
if (StaticPrefs::APZCurveThreshold() > 0.0f &&
StaticPrefs::APZCurveThreshold() < StaticPrefs::APZMaxVelocity()) {
float curveThreshold =
mAxis->ToLocalVelocity(gfxPrefs::APZCurveThreshold());
mAxis->ToLocalVelocity(StaticPrefs::APZCurveThreshold());
if (newVelocity > curveThreshold) {
// here, 0 < curveThreshold < newVelocity <= maxVelocity, so we apply
// the curve

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

@ -8,7 +8,7 @@
#include "ScrollAnimationBezierPhysics.h"
#include "AsyncPanZoomController.h"
#include "gfxPrefs.h"
#include "mozilla/StaticPrefs.h"
#include "nsPoint.h"
namespace mozilla {
@ -21,22 +21,22 @@ static ScrollAnimationBezierPhysicsSettings SettingsForDeltaType(
switch (aDeltaType) {
case ScrollWheelInput::SCROLLDELTA_PAGE:
maxMS = clamped(gfxPrefs::PageSmoothScrollMaxDurationMs(), 0, 10000);
minMS = clamped(gfxPrefs::PageSmoothScrollMinDurationMs(), 0, maxMS);
maxMS = clamped(StaticPrefs::PageSmoothScrollMaxDurationMs(), 0, 10000);
minMS = clamped(StaticPrefs::PageSmoothScrollMinDurationMs(), 0, maxMS);
break;
case ScrollWheelInput::SCROLLDELTA_PIXEL:
maxMS = clamped(gfxPrefs::PixelSmoothScrollMaxDurationMs(), 0, 10000);
minMS = clamped(gfxPrefs::PixelSmoothScrollMinDurationMs(), 0, maxMS);
maxMS = clamped(StaticPrefs::PixelSmoothScrollMaxDurationMs(), 0, 10000);
minMS = clamped(StaticPrefs::PixelSmoothScrollMinDurationMs(), 0, maxMS);
break;
case ScrollWheelInput::SCROLLDELTA_LINE:
maxMS = clamped(gfxPrefs::WheelSmoothScrollMaxDurationMs(), 0, 10000);
minMS = clamped(gfxPrefs::WheelSmoothScrollMinDurationMs(), 0, maxMS);
maxMS = clamped(StaticPrefs::WheelSmoothScrollMaxDurationMs(), 0, 10000);
minMS = clamped(StaticPrefs::WheelSmoothScrollMinDurationMs(), 0, maxMS);
break;
}
// The pref is 100-based int percentage, while mIntervalRatio is 1-based ratio
double intervalRatio =
((double)gfxPrefs::SmoothScrollDurationToIntervalRatio()) / 100.0;
((double)StaticPrefs::SmoothScrollDurationToIntervalRatio()) / 100.0;
intervalRatio = std::max(1.0, intervalRatio);
return ScrollAnimationBezierPhysicsSettings{minMS, maxMS, intervalRatio};
}

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

@ -23,6 +23,7 @@
#include "mozilla/layers/LayerMetricsWrapper.h"
#include "mozilla/layers/APZThreadUtils.h"
#include "mozilla/layers/MatrixMessage.h"
#include "mozilla/StaticPrefs.h"
#include "mozilla/TypedEnumBits.h"
#include "mozilla/UniquePtr.h"
#include "apz/src/APZCTreeManager.h"
@ -32,7 +33,6 @@
#include "Layers.h"
#include "TestLayers.h"
#include "UnitTransforms.h"
#include "gfxPrefs.h"
using namespace mozilla;
using namespace mozilla::gfx;
@ -91,7 +91,7 @@ class ScopedGfxSetting {
#define SCOPED_GFX_PREF(prefBase, prefType, prefValue) \
ScopedGfxSetting<prefType, prefType> pref_##prefBase( \
&(gfxPrefs::prefBase), &(gfxPrefs::Set##prefBase), prefValue)
&(StaticPrefs::prefBase), &(StaticPrefs::Set##prefBase), prefValue)
#define SCOPED_GFX_VAR(varBase, varType, varValue) \
ScopedGfxSetting<const varType&, varType> var_##varBase( \
@ -520,7 +520,7 @@ void APZCTesterBase::Tap(const RefPtr<InputReceiver>& aTarget,
// If touch-action is enabled then simulate the allowed touch behaviour
// notification that the main thread is supposed to deliver.
if (gfxPrefs::TouchActionEnabled() &&
if (StaticPrefs::TouchActionEnabled() &&
status != nsEventStatus_eConsumeNoDefault) {
SetDefaultAllowedTouchBehavior(aTarget, *aOutInputBlockId);
}
@ -552,8 +552,8 @@ void APZCTesterBase::Pan(const RefPtr<InputReceiver>& aTarget,
// We can't use a scoped pref because this value might be read at some later
// time when the events are actually processed, rather than when we deliver
// them.
gfxPrefs::SetAPZTouchStartTolerance(1.0f / 1000.0f);
gfxPrefs::SetAPZTouchMoveTolerance(0.0f);
StaticPrefs::SetAPZTouchStartTolerance(1.0f / 1000.0f);
StaticPrefs::SetAPZTouchMoveTolerance(0.0f);
int overcomeTouchToleranceX = 0;
int overcomeTouchToleranceY = 0;
if (!(aOptions & PanOptions::ExactCoordinates)) {
@ -596,7 +596,7 @@ void APZCTesterBase::Pan(const RefPtr<InputReceiver>& aTarget,
EXPECT_EQ(1UL, aAllowedTouchBehaviors->Length());
aTarget->SetAllowedTouchBehavior(*aOutInputBlockId,
*aAllowedTouchBehaviors);
} else if (gfxPrefs::TouchActionEnabled()) {
} else if (StaticPrefs::TouchActionEnabled()) {
SetDefaultAllowedTouchBehavior(aTarget, *aOutInputBlockId);
}
}
@ -681,7 +681,7 @@ void APZCTesterBase::DoubleTap(const RefPtr<InputReceiver>& aTarget,
// If touch-action is enabled then simulate the allowed touch behaviour
// notification that the main thread is supposed to deliver.
if (gfxPrefs::TouchActionEnabled() &&
if (StaticPrefs::TouchActionEnabled() &&
status != nsEventStatus_eConsumeNoDefault) {
SetDefaultAllowedTouchBehavior(aTarget, blockId);
}
@ -700,7 +700,7 @@ void APZCTesterBase::DoubleTap(const RefPtr<InputReceiver>& aTarget,
}
mcc->AdvanceByMillis(10);
if (gfxPrefs::TouchActionEnabled() &&
if (StaticPrefs::TouchActionEnabled() &&
status != nsEventStatus_eConsumeNoDefault) {
SetDefaultAllowedTouchBehavior(aTarget, blockId);
}
@ -773,7 +773,7 @@ void APZCTesterBase::PinchWithTouchInput(
EXPECT_EQ(2UL, aAllowedTouchBehaviors->Length());
aTarget->SetAllowedTouchBehavior(*aOutInputBlockId,
*aAllowedTouchBehaviors);
} else if (gfxPrefs::TouchActionEnabled()) {
} else if (StaticPrefs::TouchActionEnabled()) {
SetDefaultAllowedTouchBehavior(aTarget, *aOutInputBlockId, 2);
}

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

@ -348,7 +348,7 @@ TEST_F(APZCBasicTester, OverScroll_Bug1152051b) {
uint64_t blockId;
nsEventStatus status =
TouchDown(apzc, ScreenIntPoint(10, 10), mcc->Time(), &blockId);
if (gfxPrefs::TouchActionEnabled() &&
if (StaticPrefs::TouchActionEnabled() &&
status != nsEventStatus_eConsumeNoDefault) {
SetDefaultAllowedTouchBehavior(apzc, blockId);
}

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

@ -6,7 +6,6 @@
#include "APZCBasicTester.h"
#include "APZTestCommon.h"
#include "gfxPrefs.h"
class APZCGestureDetectorTester : public APZCBasicTester {
public:
@ -393,7 +392,7 @@ class APZCLongPressTester : public APZCGestureDetectorTester {
TouchDown(apzc, ScreenIntPoint(10, 10), mcc->Time(), &blockId);
EXPECT_EQ(nsEventStatus_eConsumeDoDefault, status);
if (gfxPrefs::TouchActionEnabled() &&
if (StaticPrefs::TouchActionEnabled() &&
status != nsEventStatus_eConsumeNoDefault) {
// SetAllowedTouchBehavior() must be called after sending touch-start.
nsTArray<uint32_t> allowedTouchBehaviors;
@ -459,7 +458,7 @@ class APZCLongPressTester : public APZCGestureDetectorTester {
mcc->Time(), &blockId);
EXPECT_EQ(nsEventStatus_eConsumeDoDefault, status);
if (gfxPrefs::TouchActionEnabled() &&
if (StaticPrefs::TouchActionEnabled() &&
status != nsEventStatus_eConsumeNoDefault) {
// SetAllowedTouchBehavior() must be called after sending touch-start.
nsTArray<uint32_t> allowedTouchBehaviors;
@ -707,7 +706,7 @@ TEST_F(APZCGestureDetectorTester, LongPressInterruptedByWheel) {
uint64_t wheelBlockId = 0;
nsEventStatus status =
TouchDown(apzc, ScreenIntPoint(10, 10), mcc->Time(), &touchBlockId);
if (gfxPrefs::TouchActionEnabled() &&
if (StaticPrefs::TouchActionEnabled() &&
status != nsEventStatus_eConsumeNoDefault) {
SetDefaultAllowedTouchBehavior(apzc, touchBlockId);
}

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

@ -637,7 +637,7 @@ TEST_F(APZHitTestingTester, Bug1148350) {
uint64_t blockId;
TouchDown(manager, ScreenIntPoint(100, 100), mcc->Time(), &blockId);
if (gfxPrefs::TouchActionEnabled()) {
if (StaticPrefs::TouchActionEnabled()) {
SetDefaultAllowedTouchBehavior(manager, blockId);
}
mcc->AdvanceByMillis(100);

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

@ -161,7 +161,7 @@ class APZCPinchLockingTester : public APZCPinchTester {
void twoFingerPan() {
ScreenCoord panDistance =
gfxPrefs::APZPinchLockScrollLockThreshold() * 1.2 * tm->GetDPI();
StaticPrefs::APZPinchLockScrollLockThreshold() * 1.2 * tm->GetDPI();
mFocus = ScreenIntPoint((int)(mFocus.x + panDistance), (int)(mFocus.y));
@ -174,7 +174,7 @@ class APZCPinchLockingTester : public APZCPinchTester {
void twoFingerZoom() {
float pinchDistance =
gfxPrefs::APZPinchLockSpanBreakoutThreshold() * 1.2 * tm->GetDPI();
StaticPrefs::APZPinchLockSpanBreakoutThreshold() * 1.2 * tm->GetDPI();
float newSpan = mSpan + pinchDistance;
@ -191,7 +191,7 @@ class APZCPinchLockingTester : public APZCPinchTester {
// Send a small scale input to the APZC
float pinchDistance =
gfxPrefs::APZPinchLockSpanBreakoutThreshold() * 0.8 * tm->GetDPI();
StaticPrefs::APZPinchLockSpanBreakoutThreshold() * 0.8 * tm->GetDPI();
apzc->ReceiveInputEvent(
CreatePinchGestureInput(PinchGestureInput::PINCHGESTURE_SCALE, mFocus,
mSpan + pinchDistance, mSpan, mcc->Time()),

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

@ -65,7 +65,7 @@ TEST_F(APZCSnappingTester, Bug1265510) {
// inner frame; we verify that it does by checking the inner scroll position.
TimeStamp newTransactionTime =
now + TimeDuration::FromMilliseconds(
gfxPrefs::MouseWheelTransactionTimeoutMs() + 100);
StaticPrefs::MouseWheelTransactionTimeoutMs() + 100);
SmoothWheel(manager, ScreenIntPoint(50, 80), ScreenPoint(0, 6),
newTransactionTime);
inner->AdvanceAnimationsUntilEnd();

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

@ -9,12 +9,12 @@
#include <map>
#include "gfxPrefs.h"
#include "nsDebug.h" // for NS_WARNING
#include "nsTArray.h"
#include "mozilla/Assertions.h" // for MOZ_ASSERT
#include "mozilla/DebugOnly.h" // for DebugOnly
#include "mozilla/GfxMessageUtils.h" // for ParamTraits specializations
#include "mozilla/StaticPrefs.h"
#include "mozilla/ToString.h" // for ToString
#include "mozilla/gfx/CompositorHitTestInfo.h"
#include "mozilla/layers/ScrollableLayerGuid.h"
@ -130,7 +130,7 @@ class APZPaintLogHelper {
public:
APZPaintLogHelper(APZTestData* aTestData, SequenceNumber aPaintSequenceNumber)
: mTestData(aTestData), mPaintSequenceNumber(aPaintSequenceNumber) {
MOZ_ASSERT(!aTestData || gfxPrefs::APZTestLoggingEnabled(),
MOZ_ASSERT(!aTestData || StaticPrefs::APZTestLoggingEnabled(),
"don't call me");
}

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

@ -396,7 +396,7 @@ void APZEventState::ProcessTouchEvent(const WidgetTouchEvent& aEvent,
if (sentContentResponse && !isTouchPrevented &&
aApzResponse == nsEventStatus_eConsumeDoDefault &&
gfxPrefs::PointerEventsEnabled()) {
StaticPrefs::PointerEventsEnabled()) {
WidgetTouchEvent cancelEvent(aEvent);
cancelEvent.mMessage = eTouchPointerCancel;
cancelEvent.mFlags.mCancelable = false; // mMessage != eTouchCancel;

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

@ -192,11 +192,11 @@ void CheckerboardReportService::GetReports(
}
bool CheckerboardReportService::IsRecordingEnabled() const {
return gfxPrefs::APZRecordCheckerboarding();
return StaticPrefs::APZRecordCheckerboarding();
}
void CheckerboardReportService::SetRecordingEnabled(bool aEnabled) {
gfxPrefs::SetAPZRecordCheckerboarding(aEnabled);
StaticPrefs::SetAPZRecordCheckerboarding(aEnabled);
}
void CheckerboardReportService::FlushActiveReports() {

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

@ -367,7 +367,7 @@ bool BasicCompositor::SupportsEffect(EffectTypes aEffect) {
}
bool BasicCompositor::SupportsLayerGeometry() const {
return gfxPrefs::BasicLayerGeometry();
return StaticPrefs::BasicLayerGeometry();
}
static RefPtr<gfx::Path> BuildPathFromPolygon(const RefPtr<DrawTarget>& aDT,
@ -1023,7 +1023,7 @@ void BasicCompositor::EndFrame() {
// Pop aClipRectIn/bounds rect
mRenderTarget->mDrawTarget->PopClip();
if (gfxPrefs::WidgetUpdateFlashing()) {
if (StaticPrefs::WidgetUpdateFlashing()) {
float r = float(rand()) / RAND_MAX;
float g = float(rand()) / RAND_MAX;
float b = float(rand()) / RAND_MAX;

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

@ -661,7 +661,7 @@ bool BasicLayerManager::EndTransactionInternal(
}
void BasicLayerManager::FlashWidgetUpdateArea(gfxContext* aContext) {
if (gfxPrefs::WidgetUpdateFlashing()) {
if (StaticPrefs::WidgetUpdateFlashing()) {
float r = float(rand()) / RAND_MAX;
float g = float(rand()) / RAND_MAX;
float b = float(rand()) / RAND_MAX;

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

@ -244,7 +244,7 @@ bool ClientLayerManager::BeginTransactionWithTarget(gfxContext* aTarget,
// enabled in this process; it may be enabled in the parent process,
// and the parent process expects unique sequence numbers.
++mPaintSequenceNumber;
if (gfxPrefs::APZTestLoggingEnabled()) {
if (StaticPrefs::APZTestLoggingEnabled()) {
mApzTestData.StartNewPaint(mPaintSequenceNumber);
}
}
@ -280,7 +280,7 @@ bool ClientLayerManager::EndTransactionInternal(
AUTO_PROFILER_TRACING("Paint", "Rasterize", GRAPHICS);
Maybe<TimeStamp> startTime;
if (gfxPrefs::LayersDrawFPS()) {
if (StaticPrefs::LayersDrawFPS()) {
startTime = Some(TimeStamp::Now());
}
@ -310,7 +310,7 @@ bool ClientLayerManager::EndTransactionInternal(
// Skip the painting if the device is in device-reset status.
if (!gfxPlatform::GetPlatform()->DidRenderingDeviceReset()) {
if (gfxPrefs::AlwaysPaint() && XRE_IsContentProcess()) {
if (StaticPrefs::AlwaysPaint() && XRE_IsContentProcess()) {
TimeStamp start = TimeStamp::Now();
root->RenderLayer();
mLastPaintTime = TimeStamp::Now() - start;
@ -545,7 +545,7 @@ float ClientLayerManager::RequestProperty(const nsAString& aProperty) {
void ClientLayerManager::StartNewRepaintRequest(
SequenceNumber aSequenceNumber) {
if (gfxPrefs::APZTestLoggingEnabled()) {
if (StaticPrefs::APZTestLoggingEnabled()) {
mApzTestData.StartNewRepaintRequest(aSequenceNumber);
}
}
@ -615,7 +615,7 @@ void ClientLayerManager::FlushRendering() {
if (mWidget) {
if (CompositorBridgeChild* remoteRenderer = mWidget->GetRemoteRenderer()) {
if (mWidget->SynchronouslyRepaintOnResize() ||
gfxPrefs::LayersForceSynchronousResize()) {
StaticPrefs::LayersForceSynchronousResize()) {
remoteRenderer->SendFlushRendering();
} else {
remoteRenderer->SendFlushRenderingAsync();
@ -696,7 +696,7 @@ void ClientLayerManager::ForwardTransaction(bool aScheduleComposite) {
refreshStart = mTransactionStart;
}
if (gfxPrefs::AlwaysPaint() && XRE_IsContentProcess()) {
if (StaticPrefs::AlwaysPaint() && XRE_IsContentProcess()) {
mForwarder->SendPaintTime(mLatestTransactionId, mLastPaintTime);
}
@ -863,7 +863,7 @@ ClientLayerManager::CreatePersistentBufferProvider(const gfx::IntSize& aSize,
// instead of being sent to the compositor, in which case rendering into
// shared memory is wasteful.
if (IsCompositingCheap() &&
gfxPrefs::PersistentBufferProviderSharedEnabled()) {
StaticPrefs::PersistentBufferProviderSharedEnabled()) {
RefPtr<PersistentBufferProvider> provider =
PersistentBufferProviderShared::Create(aSize, aFormat,
AsShadowForwarder());

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

@ -202,7 +202,7 @@ class ClientLayerManager final : public LayerManager,
void LogTestDataForCurrentPaint(ScrollableLayerGuid::ViewID aScrollId,
const std::string& aKey,
const std::string& aValue) {
MOZ_ASSERT(gfxPrefs::APZTestLoggingEnabled(), "don't call me");
MOZ_ASSERT(StaticPrefs::APZTestLoggingEnabled(), "don't call me");
mApzTestData.LogTestDataForPaint(mPaintSequenceNumber, aScrollId, aKey,
aValue);
}
@ -220,13 +220,13 @@ class ClientLayerManager final : public LayerManager,
ScrollableLayerGuid::ViewID aScrollId,
const std::string& aKey,
const std::string& aValue) {
MOZ_ASSERT(gfxPrefs::APZTestLoggingEnabled(), "don't call me");
MOZ_ASSERT(StaticPrefs::APZTestLoggingEnabled(), "don't call me");
mApzTestData.LogTestDataForRepaintRequest(aSequenceNumber, aScrollId, aKey,
aValue);
}
void LogAdditionalTestData(const std::string& aKey,
const std::string& aValue) {
MOZ_ASSERT(gfxPrefs::APZTestLoggingEnabled(), "don't call me");
MOZ_ASSERT(StaticPrefs::APZTestLoggingEnabled(), "don't call me");
mApzTestData.RecordAdditionalData(aKey, aValue);
}

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

@ -85,7 +85,7 @@ static LayerToParentLayerMatrix4x4 GetTransformToAncestorsParentLayer(
iter = iter.GetParent()) {
transform = transform * iter.GetTransform();
if (gfxPrefs::LayoutUseContainersForRootFrames()) {
if (StaticPrefs::LayoutUseContainersForRootFrames()) {
// When scrolling containers, layout adds a post-scale into the transform
// of the displayport-ancestor (which we pick up in GetTransform() above)
// to cancel out the pres shell resolution (for historical reasons). The
@ -267,7 +267,7 @@ bool ClientTiledPaintedLayer::IsScrollingOnCompositor(
}
bool ClientTiledPaintedLayer::UseProgressiveDraw() {
if (!gfxPrefs::ProgressivePaint()) {
if (!StaticPrefs::ProgressivePaint()) {
// pref is disabled, so never do progressive
return false;
}
@ -479,7 +479,7 @@ void ClientTiledPaintedLayer::RenderLayer() {
isHalfTileWidthOrHeight) &&
SingleTiledContentClient::ClientSupportsLayerSize(layerSize,
ClientManager()) &&
gfxPrefs::LayersSingleTileEnabled();
StaticPrefs::LayersSingleTileEnabled();
if (mContentClient && mHaveSingleTiledContentClient &&
!wantSingleTiledContentClient) {

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

@ -22,8 +22,8 @@ MultiTiledContentClient::MultiTiledContentClient(
mLowPrecisionTiledBuffer(aPaintedLayer, *this, aManager,
&mSharedFrameMetricsHelper) {
MOZ_COUNT_CTOR(MultiTiledContentClient);
mLowPrecisionTiledBuffer.SetResolution(gfxPrefs::LowPrecisionResolution());
mHasLowPrecision = gfxPrefs::UseLowPrecisionBuffer();
mLowPrecisionTiledBuffer.SetResolution(StaticPrefs::LowPrecisionResolution());
mHasLowPrecision = StaticPrefs::UseLowPrecisionBuffer();
}
void MultiTiledContentClient::ClearCachedResources() {

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

@ -1347,7 +1347,7 @@ void TextureClient::PrintInfo(std::stringstream& aStream, const char* aPrefix) {
AppendToString(aStream, mFlags, " [flags=", "]");
#ifdef MOZ_DUMP_PAINTING
if (gfxPrefs::LayersDumpTexture()) {
if (StaticPrefs::LayersDumpTexture()) {
nsAutoCString pfx(aPrefix);
pfx += " ";

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

@ -230,7 +230,7 @@ bool SharedFrameMetricsHelper::AboutToCheckerboard(
CSSRect(aCompositorMetrics.GetScrollOffset(),
aCompositorMetrics.CalculateBoundedCompositedSizeInCssPixels());
showing.Inflate(
LayerSize(gfxPrefs::APZDangerZoneX(), gfxPrefs::APZDangerZoneY()) /
LayerSize(StaticPrefs::APZDangerZoneX(), StaticPrefs::APZDangerZoneY()) /
aCompositorMetrics.LayersPixelsPerCSSPixel());
// Clamp both rects to the scrollable rect, because having either of those
@ -600,7 +600,7 @@ Maybe<AcquiredBackBuffer> TileClient::AcquireBackBuffer(
// later (copying pixels and texture upload). But this could increase
// our memory usage and lead to OOM more frequently from spikes in usage,
// so we have this behavior behind a pref.
if (!gfxPrefs::LayersTileRetainBackBuffer()) {
if (!StaticPrefs::LayersTileRetainBackBuffer()) {
DiscardBackBuffer();
}
Flip();

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

@ -9,8 +9,8 @@
#include "LayerManagerComposite.h" // for LayerManagerComposite, etc
#include "Layers.h" // for Layer, ContainerLayer, etc
#include "gfxPoint.h" // for gfxPoint, gfxSize
#include "gfxPrefs.h" // for gfxPrefs
#include "mozilla/ServoBindings.h" // for Servo_AnimationValue_GetOpacity, etc
#include "mozilla/StaticPrefs.h" // for StaticPrefs
#include "mozilla/WidgetUtils.h" // for ComputeTransformForRotation
#include "mozilla/gfx/BaseRect.h" // for BaseRect
#include "mozilla/gfx/Point.h" // for RoundedToInt, PointTyped
@ -35,7 +35,6 @@
#include "nsTArray.h" // for nsTArray, nsTArray_Impl, etc
#include "nsTArrayForwardDeclare.h" // for InfallibleTArray
#include "UnitTransforms.h" // for TransformTo
#include "gfxPrefs.h"
#if defined(MOZ_WIDGET_ANDROID)
# include <android/log.h>
# include "mozilla/layers/UiCompositorControllerParent.h"
@ -790,7 +789,7 @@ static bool SampleAnimations(Layer* aLayer,
}
void AsyncCompositionManager::RecordShadowTransforms(Layer* aLayer) {
MOZ_ASSERT(gfxPrefs::CollectScrollTransforms());
MOZ_ASSERT(StaticPrefs::CollectScrollTransforms());
MOZ_ASSERT(CompositorThreadHolder::IsInCompositorThread());
ForEachNodePostOrder<ForwardIterator>(aLayer, [this](Layer* layer) {
@ -1473,7 +1472,7 @@ bool AsyncCompositionManager::TransformShadowTree(
trans *= gfx::Matrix4x4::From2D(mWorldTransform);
rootComposite->SetShadowBaseTransform(trans);
if (gfxPrefs::CollectScrollTransforms()) {
if (StaticPrefs::CollectScrollTransforms()) {
RecordShadowTransforms(root);
}
@ -1488,9 +1487,9 @@ void AsyncCompositionManager::SetFixedLayerMargins(ScreenIntCoord aTop,
}
ScreenMargin AsyncCompositionManager::GetFixedLayerMargins() const {
ScreenMargin result = mFixedLayerMargins;
if (gfxPrefs::APZFixedMarginOverrideEnabled()) {
result.top = gfxPrefs::APZFixedMarginOverrideTop();
result.bottom = gfxPrefs::APZFixedMarginOverrideBottom();
if (StaticPrefs::APZFixedMarginOverrideEnabled()) {
result.top = StaticPrefs::APZFixedMarginOverrideTop();
result.bottom = StaticPrefs::APZFixedMarginOverrideBottom();
}
return result;
}

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

@ -432,7 +432,7 @@ void RenderLayers(ContainerT* aContainer, LayerManagerComposite* aManager,
continue;
}
if (gfxPrefs::LayersDrawFPS()) {
if (StaticPrefs::LayersDrawFPS()) {
for (const auto& metadata : layer->GetAllScrollMetadata()) {
if (metadata.IsApzForceDisabled()) {
aManager->DisabledApzWarning();
@ -477,7 +477,7 @@ void RenderLayers(ContainerT* aContainer, LayerManagerComposite* aManager,
PrintUniformityInfo(layer);
}
if (gfxPrefs::DrawLayerInfo()) {
if (StaticPrefs::DrawLayerInfo()) {
DrawLayerInfo(preparedData.mClipRect, aManager, layer);
}
@ -509,7 +509,7 @@ void RenderLayers(ContainerT* aContainer, LayerManagerComposite* aManager,
}
}
if (gfxPrefs::APZMinimap()) {
if (StaticPrefs::APZMinimap()) {
RenderMinimap(aContainer, sampler, aManager, aClipRect, layer);
}
}
@ -650,7 +650,8 @@ void ContainerRender(ContainerT* aContainer, LayerManagerComposite* aManager,
// APZCs attached to it has a nonempty async transform, then that transform is
// not applied to any visible content. Display a warning box (conditioned on
// the FPS display being enabled).
if (gfxPrefs::LayersDrawFPS() && aContainer->IsScrollableWithoutContent()) {
if (StaticPrefs::LayersDrawFPS() &&
aContainer->IsScrollableWithoutContent()) {
RefPtr<APZSampler> sampler =
aManager->GetCompositor()->GetCompositorBridgeParent()->GetAPZSampler();
// Since aContainer doesn't have any children we can just iterate from the

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

@ -8,8 +8,8 @@
#define mozilla_gfx_layers_composite_Diagnostics_h
#include "FPSCounter.h"
#include "gfxPrefs.h"
#include "mozilla/Maybe.h"
#include "mozilla/StaticPrefs.h"
#include "mozilla/TimeStamp.h"
#include <deque>
#include <string>
@ -66,7 +66,7 @@ class Diagnostics {
class Record {
public:
explicit Record(TimeStamp aStart = TimeStamp()) {
if (gfxPrefs::LayersDrawFPS()) {
if (StaticPrefs::LayersDrawFPS()) {
mStart = aStart.IsNull() ? TimeStamp::Now() : aStart;
}
}

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

@ -7,13 +7,13 @@
#include <stddef.h> // for size_t
#include "Units.h" // for ScreenIntRect
#include "gfxRect.h" // for gfxRect
#include "gfxPrefs.h" // for gfxPrefs
#include "mozilla/gfx/Point.h" // for IntSize, Point
#include "mozilla/gfx/Rect.h" // for Rect
#include "mozilla/gfx/Types.h" // for Color, SurfaceFormat
#include "mozilla/layers/Compositor.h" // for Compositor
#include "mozilla/layers/CompositorTypes.h"
#include "mozilla/layers/Effects.h" // for Effect, EffectChain, etc
#include "mozilla/StaticPrefs.h" // for StaticPrefs
#include "mozilla/TimeStamp.h" // for TimeStamp, TimeDuration
#include "nsPoint.h" // for nsIntPoint
#include "nsRect.h" // for mozilla::gfx::IntRect
@ -259,7 +259,7 @@ double FPSCounter::GetStdDev(std::map<int, int> aHistogram) {
}
void FPSCounter::PrintFPS() {
if (!gfxPrefs::FPSPrintHistogram()) {
if (!StaticPrefs::FPSPrintHistogram()) {
return;
}
@ -308,7 +308,7 @@ void FPSCounter::PrintHistogram(std::map<int, int>& aHistogram) {
// Write FPS timestamp data to a file only if
// draw-fps.write-to-file is true
nsresult FPSCounter::WriteFrameTimeStamps() {
if (!gfxPrefs::WriteFPSToFile()) {
if (!StaticPrefs::WriteFPSToFile()) {
return NS_OK;
}

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

@ -622,8 +622,8 @@ LayerComposite* LayerManagerComposite::RootLayer() const {
void LayerManagerComposite::InvalidateDebugOverlay(nsIntRegion& aInvalidRegion,
const IntRect& aBounds) {
bool drawFps = gfxPrefs::LayersDrawFPS();
bool drawFrameColorBars = gfxPrefs::CompositorDrawColorBars();
bool drawFps = StaticPrefs::LayersDrawFPS();
bool drawFrameColorBars = StaticPrefs::CompositorDrawColorBars();
if (drawFps) {
aInvalidRegion.Or(aInvalidRegion, nsIntRect(0, 0, 650, 400));
@ -633,7 +633,7 @@ void LayerManagerComposite::InvalidateDebugOverlay(nsIntRegion& aInvalidRegion,
}
#ifdef USE_SKIA
bool drawPaintTimes = gfxPrefs::AlwaysPaint();
bool drawPaintTimes = StaticPrefs::AlwaysPaint();
if (drawPaintTimes) {
aInvalidRegion.Or(aInvalidRegion, nsIntRect(PaintCounter::GetPaintRect()));
}
@ -653,8 +653,8 @@ void LayerManagerComposite::DrawPaintTimes(Compositor* aCompositor) {
static uint16_t sFrameCount = 0;
void LayerManagerComposite::RenderDebugOverlay(const IntRect& aBounds) {
bool drawFps = gfxPrefs::LayersDrawFPS();
bool drawFrameColorBars = gfxPrefs::CompositorDrawColorBars();
bool drawFps = StaticPrefs::LayersDrawFPS();
bool drawFrameColorBars = StaticPrefs::CompositorDrawColorBars();
// 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 = gfxPrefs::AlwaysPaint();
bool drawPaintTimes = StaticPrefs::AlwaysPaint();
if (drawPaintTimes) {
DrawPaintTimes(mCompositor);
}
@ -775,9 +775,9 @@ RefPtr<CompositingRenderTarget>
LayerManagerComposite::PushGroupForLayerEffects() {
// This is currently true, so just making sure that any new use of this
// method is flagged for investigation
MOZ_ASSERT(gfxPrefs::LayersEffectInvert() ||
gfxPrefs::LayersEffectGrayscale() ||
gfxPrefs::LayersEffectContrast() != 0.0);
MOZ_ASSERT(StaticPrefs::LayersEffectInvert() ||
StaticPrefs::LayersEffectGrayscale() ||
StaticPrefs::LayersEffectContrast() != 0.0);
RefPtr<CompositingRenderTarget> previousTarget =
mCompositor->GetCurrentRenderTarget();
@ -905,16 +905,16 @@ void LayerManagerComposite::Render(const nsIntRegion& aInvalidRegion,
// permutations. However, may as well just get the values onces and
// then use them, just in case the consistency becomes important in
// the future.
bool invertVal = gfxPrefs::LayersEffectInvert();
bool grayscaleVal = gfxPrefs::LayersEffectGrayscale();
float contrastVal = gfxPrefs::LayersEffectContrast();
bool invertVal = StaticPrefs::LayersEffectInvert();
bool grayscaleVal = StaticPrefs::LayersEffectGrayscale();
float contrastVal = StaticPrefs::LayersEffectContrast();
bool haveLayerEffects = (invertVal || grayscaleVal || contrastVal != 0.0);
// Set LayerScope begin/end frame
LayerScopeAutoFrame frame(PR_Now());
// Dump to console
if (gfxPrefs::LayersDump()) {
if (StaticPrefs::LayersDump()) {
this->Dump(/* aSorted= */ true);
}
@ -1425,7 +1425,7 @@ bool LayerManagerComposite::CanUseCanvasLayerForSize(const IntSize& aSize) {
}
void LayerManagerComposite::NotifyShadowTreeTransaction() {
if (gfxPrefs::LayersDrawFPS()) {
if (StaticPrefs::LayersDrawFPS()) {
mDiagnostics->AddTxnFrame();
}
}

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

@ -429,7 +429,7 @@ void TextureHost::PrintInfo(std::stringstream& aStream, const char* aPrefix) {
}
AppendToString(aStream, mFlags, " [flags=", "]");
#ifdef MOZ_DUMP_PAINTING
if (gfxPrefs::LayersDumpTexture()) {
if (StaticPrefs::LayersDumpTexture()) {
nsAutoCString pfx(aPrefix);
pfx += " ";

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

@ -5,7 +5,6 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "TiledContentHost.h"
#include "gfxPrefs.h" // for gfxPrefs
#include "PaintedLayerComposite.h" // for PaintedLayerComposite
#include "mozilla/gfx/BaseSize.h" // for BaseSize
#include "mozilla/gfx/Matrix.h" // for Matrix4x4
@ -25,6 +24,7 @@
#include "nsPoint.h" // for IntPoint
#include "nsPrintfCString.h" // for nsPrintfCString
#include "nsRect.h" // for IntRect
#include "mozilla/StaticPrefs.h"
#include "mozilla/layers/TextureClient.h"
namespace mozilla {
@ -35,12 +35,12 @@ class Layer;
float TileHost::GetFadeInOpacity(float aOpacity) {
TimeStamp now = TimeStamp::Now();
if (!gfxPrefs::LayerTileFadeInEnabled() || mFadeStart.IsNull() ||
if (!StaticPrefs::LayerTileFadeInEnabled() || mFadeStart.IsNull() ||
now < mFadeStart) {
return aOpacity;
}
float duration = gfxPrefs::LayerTileFadeInDuration();
float duration = StaticPrefs::LayerTileFadeInDuration();
float elapsed = (now - mFadeStart).ToMilliseconds();
if (elapsed > duration) {
mFadeStart = TimeStamp();
@ -338,8 +338,8 @@ bool TiledLayerBufferComposite::UseTiles(const SurfaceDescriptorTiles& aTiles,
tile.mFadeStart = TimeStamp::Now();
aLayerManager->CompositeUntil(
tile.mFadeStart +
TimeDuration::FromMilliseconds(gfxPrefs::LayerTileFadeInDuration()));
tile.mFadeStart + TimeDuration::FromMilliseconds(
StaticPrefs::LayerTileFadeInDuration()));
}
}
@ -422,7 +422,7 @@ void TiledContentHost::Composite(
// we end up changing the expected overall transparency of the content,
// and it just looks wrong.
Color backgroundColor;
if (aOpacity == 1.0f && gfxPrefs::LowPrecisionOpacity() < 1.0f) {
if (aOpacity == 1.0f && StaticPrefs::LowPrecisionOpacity() < 1.0f) {
// Background colors are only stored on scrollable layers. Grab
// the one from the nearest scrollable ancestor layer.
for (LayerMetricsWrapper ancestor(GetLayer(),
@ -436,7 +436,7 @@ void TiledContentHost::Composite(
}
float lowPrecisionOpacityReduction =
(aOpacity == 1.0f && backgroundColor.a == 1.0f)
? gfxPrefs::LowPrecisionOpacity()
? StaticPrefs::LowPrecisionOpacity()
: 1.0f;
nsIntRegion tmpRegion;
@ -631,7 +631,7 @@ void TiledContentHost::PrintInfo(std::stringstream& aStream,
aStream << nsPrintfCString("TiledContentHost (0x%p)", this).get();
#if defined(MOZ_DUMP_PAINTING)
if (gfxPrefs::LayersDumpTexture()) {
if (StaticPrefs::LayersDumpTexture()) {
nsAutoCString pfx(aPrefix);
pfx += " ";

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

@ -122,7 +122,7 @@ void CompositorD3D11::SetVertexBuffer(ID3D11Buffer* aBuffer) {
}
bool CompositorD3D11::SupportsLayerGeometry() const {
return gfxPrefs::D3D11LayerGeometry();
return StaticPrefs::D3D11LayerGeometry();
}
bool CompositorD3D11::UpdateDynamicVertexBuffer(
@ -201,7 +201,7 @@ bool CompositorD3D11::Initialize(nsCString* const out_failureReason) {
(IDXGIFactory2**)getter_AddRefs(dxgiFactory2));
#if (_WIN32_WINDOWS_MAXVER >= 0x0A00)
if (gfxPrefs::Direct3D11UseDoubleBuffering() && SUCCEEDED(hr) &&
if (StaticPrefs::Direct3D11UseDoubleBuffering() && 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
@ -290,10 +290,10 @@ bool CompositorD3D11::Initialize(nsCString* const out_failureReason) {
}
bool CanUsePartialPresents(ID3D11Device* aDevice) {
if (gfxPrefs::PartialPresent() > 0) {
if (StaticPrefs::PartialPresent() > 0) {
return true;
}
if (gfxPrefs::PartialPresent() < 0) {
if (StaticPrefs::PartialPresent() < 0) {
return false;
}
if (DeviceManagerDx::Get()->IsWARP()) {
@ -1201,7 +1201,7 @@ void CompositorD3D11::BeginFrame(const nsIntRegion& aInvalidRegion,
}
}
if (gfxPrefs::LayersDrawFPS()) {
if (StaticPrefs::LayersDrawFPS()) {
uint32_t pixelsPerFrame = 0;
for (auto iter = mBackBufferInvalid.RectIter(); !iter.Done(); iter.Next()) {
pixelsPerFrame += iter.Get().Width() * iter.Get().Height();
@ -1246,7 +1246,7 @@ void CompositorD3D11::EndFrame() {
if (oldSize == mSize) {
Present();
if (gfxPrefs::CompositorClearState()) {
if (StaticPrefs::CompositorClearState()) {
mContext->ClearState();
}
} else {

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

@ -20,7 +20,7 @@
#include "MLGShaders.h"
#include "TextureD3D11.h"
#include "gfxConfig.h"
#include "gfxPrefs.h"
#include "mozilla/StaticPrefs.h"
namespace mozilla {
namespace layers {
@ -232,7 +232,7 @@ bool MLGSwapChainD3D11::Initialize(CompositorWidget* aWidget) {
}
RefPtr<IDXGIFactory2> dxgiFactory2;
if (gfxPrefs::Direct3D11UseDoubleBuffering() &&
if (StaticPrefs::Direct3D11UseDoubleBuffering() &&
SUCCEEDED(dxgiFactory->QueryInterface(dxgiFactory2.StartAssignment())) &&
dxgiFactory2 && IsWin10OrLater() && XRE_IsGPUProcess()) {
// DXGI_SCALING_NONE is not available on Windows 7 with the Platform Update:

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

@ -11,7 +11,7 @@
#include "ReadbackManagerD3D11.h"
#include "gfx2DGlue.h"
#include "gfxContext.h"
#include "gfxPrefs.h"
#include "mozilla/StaticPrefs.h"
#include "gfxWindowsPlatform.h"
#include "mozilla/gfx/DataSurfaceHelpers.h"
#include "mozilla/gfx/DeviceManagerDx.h"
@ -286,7 +286,7 @@ static void DestroyDrawTarget(RefPtr<DrawTarget>& aDT,
D3D11TextureData::~D3D11TextureData() {
if (mDrawTarget) {
if (PaintThread::Get() && gfxPrefs::Direct2DDestroyDTOnPaintThread()) {
if (PaintThread::Get() && StaticPrefs::Direct2DDestroyDTOnPaintThread()) {
RefPtr<DrawTarget> dt = mDrawTarget;
RefPtr<ID3D11Texture2D> tex = mTexture;
RefPtr<Runnable> task = NS_NewRunnableFunction(

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

@ -1004,7 +1004,7 @@ void CompositorBridgeParent::CompositeToTarget(VsyncId aId, DrawTarget* aTarget,
RenderTraceLayers(mLayerManager->GetRoot(), "0000");
#ifdef MOZ_DUMP_PAINTING
if (gfxPrefs::DumpHostLayers()) {
if (StaticPrefs::DumpHostLayers()) {
printf_stderr("Painting --- compositing layer tree:\n");
mLayerManager->Dump(/* aSorted = */ true);
}
@ -1044,7 +1044,7 @@ void CompositorBridgeParent::CompositeToTarget(VsyncId aId, DrawTarget* aTarget,
#endif
// 0 -> Full-tilt composite
if (gfxPrefs::LayersCompositionFrameRate() == 0 ||
if (StaticPrefs::LayersCompositionFrameRate() == 0 ||
mLayerManager->AlwaysScheduleComposite()) {
// Special full-tilt composite mode for performance testing
ScheduleComposition();
@ -1216,7 +1216,7 @@ void CompositorBridgeParent::ScheduleRotationOnCompositorThread(
"layers::CompositorBridgeParent::ForceComposition", this,
&CompositorBridgeParent::ForceComposition);
mForceCompositionTask = task;
ScheduleTask(task.forget(), gfxPrefs::OrientationSyncMillis());
ScheduleTask(task.forget(), StaticPrefs::OrientationSyncMillis());
}
}
@ -1554,7 +1554,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 (gfxPrefs::Direct3D11UseDoubleBuffering() && IsWin10OrLater() &&
if (StaticPrefs::Direct3D11UseDoubleBuffering() && IsWin10OrLater() &&
XRE_IsGPUProcess()) {
mWidget->AsWindows()->EnsureCompositorWindow();
}

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

@ -78,7 +78,7 @@ CompositorVsyncScheduler::CompositorVsyncScheduler(
// mAsapScheduling is set on the main thread during init,
// but is only accessed after on the compositor thread.
mAsapScheduling = gfxPrefs::LayersCompositionFrameRate() == 0 ||
mAsapScheduling = StaticPrefs::LayersCompositionFrameRate() == 0 ||
gfxPlatform::IsInLayoutAsapMode() ||
recordreplay::IsRecordingOrReplaying();
}

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

@ -11,7 +11,6 @@
#include "Layers.h" // for Layer, ContainerLayer, etc
#include "CompositableTransactionParent.h" // for EditReplyVector
#include "CompositorBridgeParent.h"
#include "gfxPrefs.h"
#include "mozilla/gfx/BasePoint3D.h" // for BasePoint3D
#include "mozilla/layers/AnimationHelper.h" // for GetAnimatedPropValue
#include "mozilla/layers/CanvasLayerComposite.h"
@ -472,9 +471,9 @@ mozilla::ipc::IPCResult LayerTransactionParent::RecvUpdate(
#endif
// Enable visual warning for long transaction when draw FPS option is enabled
bool drawFps = gfxPrefs::LayersDrawFPS();
bool drawFps = StaticPrefs::LayersDrawFPS();
if (drawFps) {
uint32_t visualWarningTrigger = gfxPrefs::LayerTransactionWarning();
uint32_t visualWarningTrigger = StaticPrefs::LayerTransactionWarning();
// The default theshold is 200ms to trigger, hit red when it take 4 times
// longer
TimeDuration latency = TimeStamp::Now() - aInfo.transactionStart();
@ -751,7 +750,7 @@ mozilla::ipc::IPCResult LayerTransactionParent::RecvGetTransform(
// containers are enabled, then the APZ transform might not be on |layer| but
// instead would be on the parent of |layer|, if that is the root scrollable
// metrics. So we special-case that behaviour.
if (gfxPrefs::LayoutUseContainersForRootFrames() &&
if (StaticPrefs::LayoutUseContainersForRootFrames() &&
!layer->HasScrollableFrameMetrics() && layer->GetParent() &&
layer->GetParent()->HasRootScrollableFrameMetrics()) {
transform *= layer->GetParent()->AsHostLayer()->GetShadowBaseTransform();

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

@ -546,7 +546,7 @@ bool ShadowLayerForwarder::EndTransaction(
}
Maybe<TimeStamp> startTime;
if (gfxPrefs::LayersDrawFPS()) {
if (StaticPrefs::LayersDrawFPS()) {
startTime = Some(TimeStamp::Now());
}

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

@ -5,7 +5,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "ContainerLayerMLGPU.h"
#include "gfxPrefs.h"
#include "mozilla/StaticPrefs.h"
#include "LayersLogging.h"
#include "LayerManagerMLGPU.h"
#include "MLGDevice.h"
@ -63,7 +63,7 @@ bool ContainerLayerMLGPU::OnPrepareToRender(FrameBuilder* aBuilder) {
mSurfaceCopyNeeded = surfaceCopyNeeded;
gfx::IntRect viewport(gfx::IntPoint(0, 0), mTargetSize);
if (!mRenderTarget || !gfxPrefs::AdvancedLayersUseInvalidation() ||
if (!mRenderTarget || !StaticPrefs::AdvancedLayersUseInvalidation() ||
mInvalidateEntireSurface) {
// Fine-grained invalidation is disabled, invalidate everything.
mInvalidRect = viewport;

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

@ -25,6 +25,7 @@
#include "CompositionRecorder.h"
#include "mozilla/layers/Diagnostics.h"
#include "mozilla/layers/TextRenderer.h"
#include "mozilla/StaticPrefs.h"
#ifdef XP_WIN
# include "mozilla/widget/WinCompositorWidget.h"
@ -262,8 +263,8 @@ void LayerManagerMLGPU::EndTransaction(const TimeStamp& aTimeStamp,
}
// Don't draw the diagnostic overlay if we want to snapshot the output.
mDrawDiagnostics = gfxPrefs::LayersDrawFPS() && !mTarget;
mUsingInvalidation = gfxPrefs::AdvancedLayersUseInvalidation();
mDrawDiagnostics = StaticPrefs::LayersDrawFPS() && !mTarget;
mUsingInvalidation = StaticPrefs::AdvancedLayersUseInvalidation();
mDebugFrameNumber++;
AL_LOG("--- Compositing frame %d ---\n", mDebugFrameNumber);
@ -550,7 +551,7 @@ void LayerManagerMLGPU::ClearCachedResources(Layer* aSubtree) {
}
void LayerManagerMLGPU::NotifyShadowTreeTransaction() {
if (gfxPrefs::LayersDrawFPS()) {
if (StaticPrefs::LayersDrawFPS()) {
mDiagnostics->AddTxnFrame();
}
}

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

@ -21,6 +21,7 @@
#include "gfxUtils.h" // for gfxUtils, etc
#include "mozilla/ArrayUtils.h" // for ArrayLength
#include "mozilla/Preferences.h" // for Preferences
#include "mozilla/StaticPrefs.h"
#include "mozilla/gfx/BasePoint.h" // for BasePoint
#include "mozilla/gfx/Matrix.h" // for Matrix4x4, Matrix
#include "mozilla/gfx/Triangle.h" // for Triangle
@ -805,10 +806,10 @@ void CompositorOGL::BeginFrame(const nsIntRegion& aInvalidRegion,
#if defined(MOZ_WIDGET_ANDROID)
if ((mSurfaceOrigin.x > 0) || (mSurfaceOrigin.y > 0)) {
mGLContext->fClearColor(gfxPrefs::CompositorOverrideClearColorR(),
gfxPrefs::CompositorOverrideClearColorG(),
gfxPrefs::CompositorOverrideClearColorB(),
gfxPrefs::CompositorOverrideClearColorA());
mGLContext->fClearColor(StaticPrefs::CompositorOverrideClearColorR(),
StaticPrefs::CompositorOverrideClearColorG(),
StaticPrefs::CompositorOverrideClearColorB(),
StaticPrefs::CompositorOverrideClearColorA());
} else {
mGLContext->fClearColor(mClearColor.r, mClearColor.g, mClearColor.b,
mClearColor.a);
@ -1233,7 +1234,7 @@ void CompositorOGL::DrawGeometry(const Geometry& aGeometry,
// Only apply DEAA to quads that have been transformed such that aliasing
// could be visible
bool bEnableAA =
gfxPrefs::LayersDEAAEnabled() && !aTransform.Is2DIntegerTranslation();
StaticPrefs::LayersDEAAEnabled() && !aTransform.Is2DIntegerTranslation();
bool colorMatrix = aEffectChain.mSecondaryEffects[EffectTypes::COLOR_MATRIX];
ShaderConfigOGL config =
@ -2026,7 +2027,7 @@ void PerUnitTexturePoolOGL::DestroyTextures() {
}
bool CompositorOGL::SupportsLayerGeometry() const {
return gfxPrefs::OGLLayerGeometry();
return StaticPrefs::OGLLayerGeometry();
}
void CompositorOGL::RegisterTextureSource(TextureSource* aTextureSource) {

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

@ -7,6 +7,7 @@
#include "mozilla/layers/WebRenderBridgeChild.h"
#include "gfxPlatform.h"
#include "gfxPrefs.h"
#include "mozilla/dom/TabGroup.h"
#include "mozilla/layers/CompositableClient.h"
#include "mozilla/layers/CompositorBridgeChild.h"

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

@ -2099,7 +2099,7 @@ void WebRenderBridgeParent::NotifyDidSceneBuild(
if (lastVsyncId == VsyncId() || !mMostRecentComposite ||
mMostRecentComposite >= lastVsync ||
((TimeStamp::Now() - lastVsync).ToMilliseconds() >
gfxPrefs::WebRenderLateSceneBuildThreshold())) {
StaticPrefs::WebRenderLateSceneBuildThreshold())) {
mCompositorScheduler->ScheduleComposition();
return;
}

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

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

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

@ -171,7 +171,7 @@ bool WebRenderLayerManager::BeginTransaction(const nsCString& aURL) {
// enabled in this process; it may be enabled in the parent process,
// and the parent process expects unique sequence numbers.
++mPaintSequenceNumber;
if (gfxPrefs::APZTestLoggingEnabled()) {
if (StaticPrefs::APZTestLoggingEnabled()) {
mApzTestData.StartNewPaint(mPaintSequenceNumber);
}
return true;
@ -692,7 +692,7 @@ void WebRenderLayerManager::FlushRendering() {
if (WrBridge()->GetCompositorUseDComp() && !resizing) {
cBridge->SendFlushRenderingAsync();
} else if (mWidget->SynchronouslyRepaintOnResize() ||
gfxPrefs::LayersForceSynchronousResize()) {
StaticPrefs::LayersForceSynchronousResize()) {
cBridge->SendFlushRendering();
} else {
cBridge->SendFlushRenderingAsync();
@ -726,7 +726,7 @@ WebRenderLayerManager::CreatePersistentBufferProvider(
// initialized with WebRender to reduce memory usage.
gfxPlatform::GetPlatform()->EnsureDevicesInitialized();
if (gfxPrefs::PersistentBufferProviderSharedEnabled()) {
if (StaticPrefs::PersistentBufferProviderSharedEnabled()) {
RefPtr<PersistentBufferProvider> provider =
PersistentBufferProviderShared::Create(aSize, aFormat,
AsKnowsCompositor());

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

@ -11,10 +11,10 @@
#include <unordered_map>
#include <vector>
#include "gfxPrefs.h"
#include "Layers.h"
#include "mozilla/Maybe.h"
#include "mozilla/MozPromise.h"
#include "mozilla/StaticPrefs.h"
#include "mozilla/layers/APZTestData.h"
#include "mozilla/layers/FocusTarget.h"
#include "mozilla/layers/IpcResourceUpdateQueue.h"
@ -154,13 +154,13 @@ class WebRenderLayerManager final : public LayerManager {
void LogTestDataForCurrentPaint(ScrollableLayerGuid::ViewID aScrollId,
const std::string& aKey,
const std::string& aValue) {
MOZ_ASSERT(gfxPrefs::APZTestLoggingEnabled(), "don't call me");
MOZ_ASSERT(StaticPrefs::APZTestLoggingEnabled(), "don't call me");
mApzTestData.LogTestDataForPaint(mPaintSequenceNumber, aScrollId, aKey,
aValue);
}
void LogAdditionalTestData(const std::string& aKey,
const std::string& aValue) {
MOZ_ASSERT(gfxPrefs::APZTestLoggingEnabled(), "don't call me");
MOZ_ASSERT(StaticPrefs::APZTestLoggingEnabled(), "don't call me");
mApzTestData.RecordAdditionalData(aKey, aValue);
}

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

@ -509,11 +509,11 @@ bool GLContextCrashGuard::UpdateEnvironment() {
#if defined(XP_WIN)
changed |= CheckAndUpdateBoolPref("gfx.driver-init.webgl-angle-force-d3d11",
gfxPrefs::WebGLANGLEForceD3D11());
StaticPrefs::WebGLANGLEForceD3D11());
changed |= CheckAndUpdateBoolPref("gfx.driver-init.webgl-angle-try-d3d11",
gfxPrefs::WebGLANGLETryD3D11());
StaticPrefs::WebGLANGLETryD3D11());
changed |= CheckAndUpdateBoolPref("gfx.driver-init.webgl-angle-force-warp",
gfxPrefs::WebGLANGLEForceWARP());
StaticPrefs::WebGLANGLEForceWARP());
changed |= CheckAndUpdateBoolPref(
"gfx.driver-init.webgl-angle",
FeatureEnabled(nsIGfxInfo::FEATURE_WEBGL_ANGLE, false));

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

@ -22,21 +22,6 @@ TEST(GfxPrefs, Singleton)
ASSERT_TRUE(gfxPrefs::SingletonExists());
}
TEST(GfxPrefs, LiveValues)
{
gfxPrefs::GetSingleton();
ASSERT_TRUE(gfxPrefs::SingletonExists());
// Live boolean, default false
ASSERT_FALSE(gfxPrefs::LayersDumpTexture());
// Live int32_t, default 23456
ASSERT_TRUE(gfxPrefs::LayerScopePort() == 23456);
// Live uint32_t, default 2
ASSERT_TRUE(gfxPrefs::MSAALevel() == 2);
}
TEST(GfxPrefs, OnceValues)
{
gfxPrefs::GetSingleton();
@ -46,13 +31,13 @@ TEST(GfxPrefs, OnceValues)
ASSERT_TRUE(gfxPrefs::WorkAroundDriverBugs());
// Once boolean, default false
ASSERT_FALSE(gfxPrefs::LayersDump());
ASSERT_FALSE(gfxPrefs::UseApitrace());
// Once uint32_t, default 5
ASSERT_TRUE(gfxPrefs::APZMaxVelocityQueueSize() == 5);
// Once float, default -1 (should be OK with ==)
ASSERT_TRUE(gfxPrefs::APZMaxVelocity() == -1.0f);
// Once float, default 0 (should be OK with ==)
ASSERT_TRUE(gfxPrefs::APZCurveFunctionX1() == 0.0f);
}
TEST(GfxPrefs, Set)
@ -61,25 +46,18 @@ TEST(GfxPrefs, Set)
ASSERT_TRUE(gfxPrefs::SingletonExists());
// Once boolean, default false
ASSERT_FALSE(gfxPrefs::LayersDump());
gfxPrefs::SetLayersDump(true);
ASSERT_TRUE(gfxPrefs::LayersDump());
gfxPrefs::SetLayersDump(false);
ASSERT_FALSE(gfxPrefs::LayersDump());
ASSERT_FALSE(gfxPrefs::UseApitrace());
gfxPrefs::SetUseApitrace(true);
ASSERT_TRUE(gfxPrefs::UseApitrace());
gfxPrefs::SetUseApitrace(false);
ASSERT_FALSE(gfxPrefs::UseApitrace());
// Live boolean, default false
ASSERT_FALSE(gfxPrefs::LayersDumpTexture());
gfxPrefs::SetLayersDumpTexture(true);
ASSERT_TRUE(gfxPrefs::LayersDumpTexture());
gfxPrefs::SetLayersDumpTexture(false);
ASSERT_FALSE(gfxPrefs::LayersDumpTexture());
// Once float, default -1
ASSERT_TRUE(gfxPrefs::APZMaxVelocity() == -1.0f);
gfxPrefs::SetAPZMaxVelocity(1.75f);
ASSERT_TRUE(gfxPrefs::APZMaxVelocity() == 1.75f);
gfxPrefs::SetAPZMaxVelocity(-1.0f);
ASSERT_TRUE(gfxPrefs::APZMaxVelocity() == -1.0f);
// Once float, default 0
ASSERT_TRUE(gfxPrefs::APZCurveFunctionX1() == 0.0f);
gfxPrefs::SetAPZCurveFunctionX1(1.75f);
ASSERT_TRUE(gfxPrefs::APZCurveFunctionX1() == 1.75f);
gfxPrefs::SetAPZCurveFunctionX1(0.0f);
ASSERT_TRUE(gfxPrefs::APZCurveFunctionX1() == 0.0f);
}
// Randomly test the function we use in nsExceptionHandler.cpp here:

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

@ -10,6 +10,7 @@
#include "gfxPrefs.h"
#include "gfxWindowsPlatform.h"
#include "mozilla/RefPtr.h"
#include "mozilla/StaticPrefs.h"
#include "mozilla/gfx/gfxVars.h"
#include "mozilla/gfx/Logging.h"
#include "mozilla/layers/TextureD3D11.h"
@ -448,7 +449,8 @@ bool D3D11Checks::DoesRemotePresentWork(IDXGIAdapter* adapter) {
};
auto doesP010Work = [&]() {
if (gfxVars::DXP010Blocked() && !gfxPrefs::PDMWMFForceAllowP010Format()) {
if (gfxVars::DXP010Blocked() &&
!StaticPrefs::PDMWMFForceAllowP010Format()) {
return false;
}
UINT formatSupport;
@ -457,7 +459,8 @@ bool D3D11Checks::DoesRemotePresentWork(IDXGIAdapter* adapter) {
};
auto doesP016Work = [&]() {
if (gfxVars::DXP016Blocked() && !gfxPrefs::PDMWMFForceAllowP010Format()) {
if (gfxVars::DXP016Blocked() &&
!StaticPrefs::PDMWMFForceAllowP010Format()) {
return false;
}
UINT formatSupport;

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

@ -10,6 +10,7 @@
#include "gfxPrefs.h"
#include "gfxWindowsPlatform.h"
#include "mozilla/D3DMessageUtils.h"
#include "mozilla/StaticPrefs.h"
#include "mozilla/Telemetry.h"
#include "mozilla/WindowsVersion.h"
#include "mozilla/gfx/GPUParent.h"
@ -404,7 +405,7 @@ bool DeviceManagerDx::CreateCompositorDeviceHelper(
FeatureState& aD3d11, IDXGIAdapter1* aAdapter, bool aAttemptVideoSupport,
RefPtr<ID3D11Device>& aOutDevice) {
// Check if a failure was injected for testing.
if (gfxPrefs::DeviceFailForTesting()) {
if (StaticPrefs::DeviceFailForTesting()) {
aD3d11.SetFailed(FeatureStatus::Failed,
"Direct3D11 device failure simulated by preference",
NS_LITERAL_CSTRING("FEATURE_FAILURE_D3D11_SIM"));
@ -707,13 +708,13 @@ RefPtr<ID3D11Device> DeviceManagerDx::CreateDecoderDevice() {
}
bool reuseDevice = false;
if (gfxPrefs::Direct3D11ReuseDecoderDevice() < 0) {
if (StaticPrefs::Direct3D11ReuseDecoderDevice() < 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 (gfxPrefs::Direct3D11ReuseDecoderDevice() > 0) {
} else if (StaticPrefs::Direct3D11ReuseDecoderDevice() > 0) {
reuseDevice = true;
}
@ -991,8 +992,8 @@ bool DeviceManagerDx::GetAnyDeviceRemovedReason(DeviceResetReason* aOutReason) {
}
if (XRE_IsParentProcess() && NS_IsMainThread() &&
gfxPrefs::DeviceResetForTesting()) {
gfxPrefs::SetDeviceResetForTesting(0);
StaticPrefs::DeviceResetForTesting()) {
StaticPrefs::SetDeviceResetForTesting(0);
*aOutReason = DeviceResetReason::FORCED_RESET;
return true;
}
@ -1091,7 +1092,7 @@ bool DeviceManagerDx::TextureSharingWorks() {
bool DeviceManagerDx::CanInitializeKeyedMutexTextures() {
MutexAutoLock lock(mDeviceLock);
return mDeviceStatus && gfxPrefs::Direct3D11AllowKeyedMutex() &&
return mDeviceStatus && StaticPrefs::Direct3D11AllowKeyedMutex() &&
gfxVars::AllowD3D11KeyedMutex();
}

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

@ -16,10 +16,8 @@
#include "gfxFontUtils.h"
#include "gfxMacPlatformFontList.h"
#include "gfxFontConstants.h"
#include "gfxPrefs.h"
#include "gfxTextRun.h"
#include "nsCocoaFeatures.h"
#include "cairo-quartz.h"
using namespace mozilla;
@ -201,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 &&
gfxPrefs::CoreTextEnabled()) {
StaticPrefs::CoreTextEnabled()) {
if (!mCoreTextShaper) {
mCoreTextShaper = MakeUnique<gfxCoreTextShaper>(this);
}

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

@ -20,6 +20,7 @@
#include "mozilla/gfx/GPUProcessManager.h"
#include "mozilla/gfx/GraphicsMessages.h"
#include "mozilla/ClearOnShutdown.h"
#include "mozilla/StaticPrefs.h"
#include "mozilla/Telemetry.h"
#include "mozilla/TimeStamp.h"
#include "mozilla/Unused.h"
@ -901,11 +902,11 @@ void gfxPlatform::Init() {
gfxPrefs::LayersD3D11ForceWARP());
// WebGL prefs
forcedPrefs.AppendPrintf(
"-W%d%d%d%d%d%d%d%d", gfxPrefs::WebGLANGLEForceD3D11(),
gfxPrefs::WebGLANGLEForceWARP(), gfxPrefs::WebGLDisabled(),
gfxPrefs::WebGLDisableANGLE(), gfxPrefs::WebGLDXGLEnabled(),
gfxPrefs::WebGLForceEnabled(), gfxPrefs::WebGLForceLayersReadback(),
gfxPrefs::WebGLForceMSAA());
"-W%d%d%d%d%d%d%d%d", StaticPrefs::WebGLANGLEForceD3D11(),
StaticPrefs::WebGLANGLEForceWARP(), StaticPrefs::WebGLDisabled(),
StaticPrefs::WebGLDisableANGLE(), StaticPrefs::WebGLDXGLEnabled(),
StaticPrefs::WebGLForceEnabled(), gfxPrefs::WebGLForceLayersReadback(),
StaticPrefs::WebGLForceMSAA());
// Prefs that don't fit into any of the other sections
forcedPrefs.AppendPrintf("-T%d%d%d) ", gfxPrefs::AndroidRGB16Force(),
0, // SkiaGL canvas no longer supported
@ -954,7 +955,7 @@ void gfxPlatform::Init() {
// the (rare) cases where they're used. Note that the GPU process where
// WebRender runs doesn't initialize gfxPlatform and performs explicit
// initialization of the bits it needs.
if (!gfxVars::UseWebRender()) {
if (!UseWebRender()) {
gPlatform->EnsureDevicesInitialized();
}
gPlatform->InitOMTPConfig();
@ -1048,7 +1049,7 @@ void gfxPlatform::Init() {
}
RegisterStrongMemoryReporter(new GfxMemoryImageReporter());
if (XRE_IsParentProcess() && gfxVars::UseWebRender()) {
if (XRE_IsParentProcess() && UseWebRender()) {
RegisterStrongAsyncMemoryReporter(new WebRenderMemoryReporter());
}
@ -1153,6 +1154,9 @@ bool gfxPlatform::IsHeadless() {
return headless;
}
/* static */
bool gfxPlatform::UseWebRender() { return gfx::gfxVars::UseWebRender(); }
static bool sLayersIPCIsUp = false;
/* static */
@ -1254,8 +1258,7 @@ void gfxPlatform::InitLayersIPC() {
}
if (XRE_IsParentProcess() || recordreplay::IsRecordingOrReplaying()) {
if (!gfxConfig::IsEnabled(Feature::GPU_PROCESS) &&
gfxVars::UseWebRender()) {
if (!gfxConfig::IsEnabled(Feature::GPU_PROCESS) && UseWebRender()) {
wr::RenderThread::Start();
image::ImageMemoryReporter::InitForWebRender();
}
@ -1274,7 +1277,7 @@ void gfxPlatform::ShutdownLayersIPC() {
if (XRE_IsContentProcess()) {
gfx::VRManagerChild::ShutDown();
// cf bug 1215265.
if (gfxPrefs::ChildProcessShutdown()) {
if (StaticPrefs::ChildProcessShutdown()) {
layers::CompositorManagerChild::Shutdown();
layers::ImageBridgeChild::ShutDown();
}
@ -1292,7 +1295,7 @@ void gfxPlatform::ShutdownLayersIPC() {
// This has to happen after shutting down the child protocols.
layers::CompositorThreadHolder::Shutdown();
image::ImageMemoryReporter::ShutdownForWebRender();
// There is a case that RenderThread exists when gfxVars::UseWebRender() is
// There is a case that RenderThread exists when UseWebRender() is
// false. This could happen when WebRender was fallbacked to compositor.
if (wr::RenderThread::Get()) {
wr::RenderThread::ShutDown();
@ -1840,16 +1843,16 @@ gfxFontEntry* gfxPlatform::MakePlatformFont(const nsACString& aFontName,
mozilla::layers::DiagnosticTypes gfxPlatform::GetLayerDiagnosticTypes() {
mozilla::layers::DiagnosticTypes type = DiagnosticTypes::NO_DIAGNOSTIC;
if (gfxPrefs::DrawLayerBorders()) {
if (StaticPrefs::DrawLayerBorders()) {
type |= mozilla::layers::DiagnosticTypes::LAYER_BORDERS;
}
if (gfxPrefs::DrawTileBorders()) {
if (StaticPrefs::DrawTileBorders()) {
type |= mozilla::layers::DiagnosticTypes::TILE_BORDERS;
}
if (gfxPrefs::DrawBigImageBorders()) {
if (StaticPrefs::DrawBigImageBorders()) {
type |= mozilla::layers::DiagnosticTypes::BIGIMAGE_BORDERS;
}
if (gfxPrefs::FlashLayerBorders()) {
if (StaticPrefs::FlashLayerBorders()) {
type |= mozilla::layers::DiagnosticTypes::FLASH_BORDERS;
}
return type;
@ -1963,12 +1966,12 @@ bool gfxPlatform::OffMainThreadCompositingEnabled() {
eCMSMode gfxPlatform::GetCMSMode() {
if (!gCMSInitialized) {
int32_t mode = gfxPrefs::CMSMode();
int32_t mode = StaticPrefs::CMSMode();
if (mode >= 0 && mode < eCMSMode_AllCount) {
gCMSMode = static_cast<eCMSMode>(mode);
}
bool enableV4 = gfxPrefs::CMSEnableV4();
bool enableV4 = StaticPrefs::CMSEnableV4();
if (enableV4) {
qcms_enable_iccv4();
}
@ -1978,14 +1981,14 @@ eCMSMode gfxPlatform::GetCMSMode() {
}
int gfxPlatform::GetRenderingIntent() {
// gfxPrefs.h is using 0 as the default for the rendering
// StaticPrefs.h is using 0 as the default for the rendering
// intent preference, based on that being the value for
// QCMS_INTENT_DEFAULT. Assert here to catch if that ever
// changes and we can then figure out what to do about it.
MOZ_ASSERT(QCMS_INTENT_DEFAULT == 0);
/* Try to query the pref system for a rendering intent. */
int32_t pIntent = gfxPrefs::CMSRenderingIntent();
int32_t pIntent = StaticPrefs::CMSRenderingIntent();
if ((pIntent < QCMS_INTENT_MIN) || (pIntent > QCMS_INTENT_MAX)) {
/* If the pref is out of range, use embedded profile. */
pIntent = -1;
@ -2428,7 +2431,7 @@ void gfxPlatform::InitGPUProcessPrefs() {
NS_LITERAL_CSTRING("FEATURE_FAILURE_SAFE_MODE"));
return;
}
if (gfxPrefs::LayerScopeEnabled()) {
if (StaticPrefs::LayerScopeEnabled()) {
gpuProc.ForceDisable(FeatureStatus::Blocked,
"LayerScope does not work in the GPU process",
NS_LITERAL_CSTRING("FEATURE_FAILURE_LAYERSCOPE"));
@ -2769,7 +2772,7 @@ void gfxPlatform::InitWebRenderConfig() {
// The parent process runs through all the real decision-making code
// later in this function. For other processes we still want to report
// the state of the feature for crash reports.
if (gfxVars::UseWebRender()) {
if (UseWebRender()) {
reporter.SetSuccessful();
}
return;
@ -2888,8 +2891,7 @@ void gfxPlatform::InitWebRenderConfig() {
#ifdef XP_WIN
if (Preferences::GetBool("gfx.webrender.dcomp-win.enabled", false)) {
// XXX relax win version to windows 8.
if (IsWin10OrLater() && gfxVars::UseWebRender() &&
gfxVars::UseWebRenderANGLE()) {
if (IsWin10OrLater() && UseWebRender() && gfxVars::UseWebRenderANGLE()) {
gfxVars::SetUseWebRenderDCompWin(true);
}
}
@ -3138,7 +3140,8 @@ void gfxPlatform::GetApzSupportInfo(mozilla::widget::InfoObject& aObj) {
aObj.DefineProperty("ApzDragInput", 1);
}
if (SupportsApzKeyboardInput() && !gfxPrefs::AccessibilityBrowseWithCaret()) {
if (SupportsApzKeyboardInput() &&
!StaticPrefs::AccessibilityBrowseWithCaret()) {
aObj.DefineProperty("ApzKeyboardInput", 1);
}
@ -3242,7 +3245,7 @@ bool gfxPlatform::AsyncPanZoomEnabled() {
}
/*static*/
bool gfxPlatform::PerfWarnings() { return gfxPrefs::PerfWarnings(); }
bool gfxPlatform::PerfWarnings() { return StaticPrefs::PerfWarnings(); }
void gfxPlatform::GetAcceleratedCompositorBackends(
nsTArray<LayersBackend>& aBackends) {
@ -3354,7 +3357,7 @@ bool gfxPlatform::SupportsApzTouchInput() const {
}
bool gfxPlatform::SupportsApzDragInput() const {
return gfxPrefs::APZDragEnabled();
return StaticPrefs::APZDragEnabled();
}
bool gfxPlatform::SupportsApzKeyboardInput() const {
@ -3362,7 +3365,7 @@ bool gfxPlatform::SupportsApzKeyboardInput() const {
}
bool gfxPlatform::SupportsApzAutoscrolling() const {
return gfxPrefs::APZAutoscrollEnabled();
return StaticPrefs::APZAutoscrollEnabled();
}
void gfxPlatform::InitOpenGLConfig() {

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

@ -203,6 +203,8 @@ class gfxPlatform : public mozilla::layers::MemoryPressureListener {
static bool IsHeadless();
static bool UseWebRender();
/**
* Create an offscreen surface of the given dimensions
* and image format.

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

@ -289,164 +289,24 @@ class gfxPrefs final {
// will keep these in an alphabetical order to make it easier to see if a
// method accessing a pref already exists. Just add yours in the list.
DECL_GFX_PREF(Live, "accessibility.browsewithcaret", AccessibilityBrowseWithCaret, bool, false);
// The apz prefs are explained in AsyncPanZoomController.cpp
DECL_GFX_PREF(Live, "apz.allow_double_tap_zooming", APZAllowDoubleTapZooming, bool, true);
DECL_GFX_PREF(Live, "apz.allow_immediate_handoff", APZAllowImmediateHandoff, bool, true);
DECL_GFX_PREF(Live, "apz.allow_zooming", APZAllowZooming, bool, false);
DECL_GFX_PREF(Live, "apz.android.chrome_fling_physics.enabled", APZUseChromeFlingPhysics, bool, false);
DECL_GFX_PREF(Live, "apz.android.chrome_fling_physics.friction", APZChromeFlingPhysicsFriction, float, 0.015f);
DECL_GFX_PREF(Live, "apz.android.chrome_fling_physics.inflexion", APZChromeFlingPhysicsInflexion, float, 0.35f);
DECL_GFX_PREF(Live, "apz.android.chrome_fling_physics.stop_threshold", APZChromeFlingPhysicsStopThreshold, float, 0.1f);
DECL_GFX_PREF(Live, "apz.autoscroll.enabled", APZAutoscrollEnabled, bool, false);
DECL_GFX_PREF(Live, "apz.axis_lock.breakout_angle", APZAxisBreakoutAngle, float, float(M_PI / 8.0) /* 22.5 degrees */);
DECL_GFX_PREF(Live, "apz.axis_lock.breakout_threshold", APZAxisBreakoutThreshold, float, 1.0f / 32.0f);
DECL_GFX_PREF(Live, "apz.axis_lock.direct_pan_angle", APZAllowedDirectPanAngle, float, float(M_PI / 3.0) /* 60 degrees */);
DECL_GFX_PREF(Live, "apz.axis_lock.lock_angle", APZAxisLockAngle, float, float(M_PI / 6.0) /* 30 degrees */);
DECL_GFX_PREF(Live, "apz.axis_lock.mode", APZAxisLockMode, int32_t, 0);
DECL_GFX_PREF(Live, "apz.content_response_timeout", APZContentResponseTimeout, int32_t, 400);
DECL_GFX_PREF(Live, "apz.danger_zone_x", APZDangerZoneX, int32_t, 50);
DECL_GFX_PREF(Live, "apz.danger_zone_y", APZDangerZoneY, int32_t, 100);
DECL_GFX_PREF(Live, "apz.disable_for_scroll_linked_effects", APZDisableForScrollLinkedEffects, bool, false);
DECL_GFX_PREF(Live, "apz.displayport_expiry_ms", APZDisplayPortExpiryTime, uint32_t, 15000);
DECL_GFX_PREF(Live, "apz.drag.enabled", APZDragEnabled, bool, false);
DECL_GFX_PREF(Live, "apz.drag.initial.enabled", APZDragInitiationEnabled, bool, false);
DECL_GFX_PREF(Live, "apz.drag.touch.enabled", APZTouchDragEnabled, bool, false);
DECL_GFX_PREF(Live, "apz.enlarge_displayport_when_clipped", APZEnlargeDisplayPortWhenClipped, bool, false);
DECL_GFX_PREF(Live, "apz.fixed-margin-override.enabled", APZFixedMarginOverrideEnabled, bool, false);
DECL_GFX_PREF(Live, "apz.fixed-margin-override.bottom", APZFixedMarginOverrideBottom, int32_t, 0);
DECL_GFX_PREF(Live, "apz.fixed-margin-override.top", APZFixedMarginOverrideTop, int32_t, 0);
DECL_GFX_PREF(Live, "apz.fling_accel_base_mult", APZFlingAccelBaseMultiplier, float, 1.0f);
DECL_GFX_PREF(Live, "apz.fling_accel_interval_ms", APZFlingAccelInterval, int32_t, 500);
DECL_GFX_PREF(Live, "apz.fling_accel_supplemental_mult", APZFlingAccelSupplementalMultiplier, float, 1.0f);
DECL_GFX_PREF(Live, "apz.fling_accel_min_velocity", APZFlingAccelMinVelocity, float, 1.5f);
DECL_GFX_PREF(Once, "apz.fling_curve_function_x1", APZCurveFunctionX1, float, 0.0f);
DECL_GFX_PREF(Once, "apz.fling_curve_function_x2", APZCurveFunctionX2, float, 1.0f);
DECL_GFX_PREF(Once, "apz.fling_curve_function_y1", APZCurveFunctionY1, float, 0.0f);
DECL_GFX_PREF(Once, "apz.fling_curve_function_y2", APZCurveFunctionY2, float, 1.0f);
DECL_GFX_PREF(Live, "apz.fling_curve_threshold_inches_per_ms", APZCurveThreshold, float, -1.0f);
DECL_GFX_PREF(Live, "apz.fling_friction", APZFlingFriction, float, 0.002f);
DECL_GFX_PREF(Live, "apz.fling_min_velocity_threshold", APZFlingMinVelocityThreshold, float, 0.5f);
DECL_GFX_PREF(Live, "apz.fling_stop_on_tap_threshold", APZFlingStopOnTapThreshold, float, 0.05f);
DECL_GFX_PREF(Live, "apz.fling_stopped_threshold", APZFlingStoppedThreshold, float, 0.01f);
DECL_GFX_PREF(Live, "apz.frame_delay.enabled", APZFrameDelayEnabled, bool, false);
DECL_GFX_PREF(Once, "apz.keyboard.enabled", APZKeyboardEnabled, bool, false);
DECL_GFX_PREF(Live, "apz.keyboard.passive-listeners", APZKeyboardPassiveListeners, bool, false);
DECL_GFX_PREF(Live, "apz.max_tap_time", APZMaxTapTime, int32_t, 300);
DECL_GFX_PREF(Live, "apz.max_velocity_inches_per_ms", APZMaxVelocity, float, -1.0f);
DECL_GFX_PREF(Once, "apz.max_velocity_queue_size", APZMaxVelocityQueueSize, uint32_t, 5);
DECL_GFX_PREF(Live, "apz.min_skate_speed", APZMinSkateSpeed, float, 1.0f);
DECL_GFX_PREF(Live, "apz.minimap.enabled", APZMinimap, bool, false);
DECL_GFX_PREF(Live, "apz.one_touch_pinch.enabled", APZOneTouchPinchEnabled, bool, true);
DECL_GFX_PREF(Live, "apz.overscroll.enabled", APZOverscrollEnabled, bool, false);
DECL_GFX_PREF(Live, "apz.overscroll.min_pan_distance_ratio", APZMinPanDistanceRatio, float, 1.0f);
DECL_GFX_PREF(Live, "apz.overscroll.spring_stiffness", APZOverscrollSpringStiffness, float, 0.001f);
DECL_GFX_PREF(Live, "apz.overscroll.stop_distance_threshold", APZOverscrollStopDistanceThreshold, float, 5.0f);
DECL_GFX_PREF(Live, "apz.paint_skipping.enabled", APZPaintSkipping, bool, true);
DECL_GFX_PREF(Live, "apz.peek_messages.enabled", APZPeekMessages, bool, true);
DECL_GFX_PREF(Live, "apz.pinch_lock.mode", APZPinchLockMode, int32_t, 1);
DECL_GFX_PREF(Live, "apz.pinch_lock.scroll_lock_threshold", APZPinchLockScrollLockThreshold, float, 1.0f / 32.0f);
DECL_GFX_PREF(Live, "apz.pinch_lock.span_breakout_threshold", APZPinchLockSpanBreakoutThreshold, float, 1.0f / 32.0f);
DECL_GFX_PREF(Live, "apz.pinch_lock.span_lock_threshold", APZPinchLockSpanLockThreshold, float, 1.0f / 32.0f);
DECL_GFX_PREF(Once, "apz.pinch_lock.buffer_max_age", APZPinchLockBufferMaxAge, int32_t, 50);
DECL_GFX_PREF(Live, "apz.popups.enabled", APZPopupsEnabled, bool, false);
DECL_GFX_PREF(Live, "apz.printtree", APZPrintTree, bool, false);
DECL_GFX_PREF(Live, "apz.record_checkerboarding", APZRecordCheckerboarding, bool, false);
DECL_GFX_PREF(Live, "apz.second_tap_tolerance", APZSecondTapTolerance, float, 0.5f);
DECL_GFX_PREF(Live, "apz.test.fails_with_native_injection", APZTestFailsWithNativeInjection, bool, false);
DECL_GFX_PREF(Live, "apz.test.logging_enabled", APZTestLoggingEnabled, bool, false);
DECL_GFX_PREF(Live, "apz.touch_move_tolerance", APZTouchMoveTolerance, float, 0.1f);
DECL_GFX_PREF(Live, "apz.touch_start_tolerance", APZTouchStartTolerance, float, 1.0f/4.5f);
DECL_GFX_PREF(Live, "apz.velocity_bias", APZVelocityBias, float, 0.0f);
DECL_GFX_PREF(Live, "apz.velocity_relevance_time_ms", APZVelocityRelevanceTime, uint32_t, 150);
DECL_GFX_PREF(Live, "apz.x_skate_highmem_adjust", APZXSkateHighMemAdjust, float, 0.0f);
DECL_GFX_PREF(Live, "apz.x_skate_size_multiplier", APZXSkateSizeMultiplier, float, 1.5f);
DECL_GFX_PREF(Live, "apz.x_stationary_size_multiplier", APZXStationarySizeMultiplier, float, 3.0f);
DECL_GFX_PREF(Live, "apz.y_skate_highmem_adjust", APZYSkateHighMemAdjust, float, 0.0f);
DECL_GFX_PREF(Live, "apz.y_skate_size_multiplier", APZYSkateSizeMultiplier, float, 2.5f);
DECL_GFX_PREF(Live, "apz.y_stationary_size_multiplier", APZYStationarySizeMultiplier, float, 3.5f);
DECL_GFX_PREF(Live, "apz.zoom_animation_duration_ms", APZZoomAnimationDuration, int32_t, 250);
DECL_GFX_PREF(Live, "apz.scale_repaint_delay_ms", APZScaleRepaintDelay, int32_t, 500);
DECL_GFX_PREF(Live, "apz.relative-update.enabled", APZRelativeUpdate, bool, false);
DECL_GFX_PREF(Live, "browser.ui.scroll-toolbar-threshold", ToolbarScrollThreshold, int32_t, 10);
DECL_GFX_PREF(Live, "browser.ui.zoom.force-user-scalable", ForceUserScalable, bool, false);
DECL_GFX_PREF(Live, "browser.viewport.desktopWidth", DesktopViewportWidth, int32_t, 980);
DECL_GFX_PREF(Live, "dom.ipc.plugins.asyncdrawing.enabled", PluginAsyncDrawingEnabled, bool, false);
DECL_GFX_PREF(Live, "dom.meta-viewport.enabled", MetaViewportEnabled, bool, false);
DECL_GFX_PREF(Once, "dom.vr.enabled", VREnabled, bool, false);
DECL_GFX_PREF(Live, "dom.vr.autoactivate.enabled", VRAutoActivateEnabled, bool, false);
DECL_GFX_PREF(Live, "dom.vr.controller_trigger_threshold", VRControllerTriggerThreshold, float, 0.1f);
DECL_GFX_PREF(Once, "dom.vr.external.enabled", VRExternalEnabled, bool, false);
DECL_GFX_PREF(Live, "dom.vr.external.notdetected.timeout", VRExternalNotDetectedTimeout, int32_t, 60000);
DECL_GFX_PREF(Live, "dom.vr.external.quit.timeout", VRExternalQuitTimeout, int32_t, 10000);
DECL_GFX_PREF(Live, "dom.vr.navigation.timeout", VRNavigationTimeout, int32_t, 1000);
DECL_GFX_PREF(Once, "dom.vr.oculus.enabled", VROculusEnabled, bool, true);
DECL_GFX_PREF(Live, "dom.vr.oculus.invisible.enabled", VROculusInvisibleEnabled, bool, true);
DECL_GFX_PREF(Live, "dom.vr.oculus.present.timeout", VROculusPresentTimeout, int32_t, 500);
DECL_GFX_PREF(Live, "dom.vr.oculus.quit.timeout", VROculusQuitTimeout, int32_t, 10000);
DECL_GFX_PREF(Once, "dom.vr.openvr.enabled", VROpenVREnabled, bool, false);
DECL_GFX_PREF(Once, "dom.vr.openvr.action_input", VROpenVRActionInputEnabled, bool, true);
DECL_GFX_PREF(Once, "dom.vr.openvr.action_input", VROpenVRActionInputEnabled, bool, true);
DECL_GFX_PREF(Once, "dom.vr.osvr.enabled", VROSVREnabled, bool, false);
DECL_GFX_PREF(Live, "dom.vr.controller.enumerate.interval", VRControllerEnumerateInterval, int32_t, 1000);
DECL_GFX_PREF(Live, "dom.vr.display.enumerate.interval", VRDisplayEnumerateInterval, int32_t, 5000);
DECL_GFX_PREF(Live, "dom.vr.inactive.timeout", VRInactiveTimeout, int32_t, 5000);
DECL_GFX_PREF(Live, "dom.vr.poseprediction.enabled", VRPosePredictionEnabled, bool, true);
DECL_GFX_PREF(Live, "dom.vr.require-gesture", VRRequireGesture, bool, true);
DECL_GFX_PREF(Live, "dom.vr.puppet.enabled", VRPuppetEnabled, bool, false);
DECL_GFX_PREF(Live, "dom.vr.puppet.submitframe", VRPuppetSubmitFrame, uint32_t, 0);
DECL_GFX_PREF(Live, "dom.vr.display.rafMaxDuration", VRDisplayRafMaxDuration, uint32_t, 50);
DECL_GFX_PREF(Once, "dom.vr.process.enabled", VRProcessEnabled, bool, false);
DECL_GFX_PREF(Once, "dom.vr.process.startup_timeout_ms", VRProcessTimeoutMs, int32_t, 5000);
DECL_GFX_PREF(Once, "dom.vr.service.enabled", VRServiceEnabled, bool, true);
DECL_GFX_PREF(Live, "dom.w3c_pointer_events.enabled", PointerEventsEnabled, bool, false);
DECL_GFX_PREF(Live, "general.smoothScroll", SmoothScrollEnabled, bool, true);
DECL_GFX_PREF(Live, "general.smoothScroll.currentVelocityWeighting",
SmoothScrollCurrentVelocityWeighting, float, 0.25);
DECL_GFX_PREF(Live, "general.smoothScroll.durationToIntervalRatio",
SmoothScrollDurationToIntervalRatio, int32_t, 200);
DECL_GFX_PREF(Live, "general.smoothScroll.lines.durationMaxMS",
LineSmoothScrollMaxDurationMs, int32_t, 150);
DECL_GFX_PREF(Live, "general.smoothScroll.lines.durationMinMS",
LineSmoothScrollMinDurationMs, int32_t, 150);
DECL_GFX_PREF(Live, "general.smoothScroll.mouseWheel", WheelSmoothScrollEnabled, bool, true);
DECL_GFX_PREF(Live, "general.smoothScroll.mouseWheel.durationMaxMS",
WheelSmoothScrollMaxDurationMs, int32_t, 400);
DECL_GFX_PREF(Live, "general.smoothScroll.mouseWheel.durationMinMS",
WheelSmoothScrollMinDurationMs, int32_t, 200);
DECL_GFX_PREF(Live, "general.smoothScroll.other.durationMaxMS",
OtherSmoothScrollMaxDurationMs, int32_t, 150);
DECL_GFX_PREF(Live, "general.smoothScroll.other.durationMinMS",
OtherSmoothScrollMinDurationMs, int32_t, 150);
DECL_GFX_PREF(Live, "general.smoothScroll.pages", PageSmoothScrollEnabled, bool, true);
DECL_GFX_PREF(Live, "general.smoothScroll.pages.durationMaxMS",
PageSmoothScrollMaxDurationMs, int32_t, 150);
DECL_GFX_PREF(Live, "general.smoothScroll.pages.durationMinMS",
PageSmoothScrollMinDurationMs, int32_t, 150);
DECL_GFX_PREF(Live, "general.smoothScroll.pixels.durationMaxMS",
PixelSmoothScrollMaxDurationMs, int32_t, 150);
DECL_GFX_PREF(Live, "general.smoothScroll.pixels.durationMinMS",
PixelSmoothScrollMinDurationMs, int32_t, 150);
DECL_GFX_PREF(Live, "general.smoothScroll.stopDecelerationWeighting",
SmoothScrollStopDecelerationWeighting, float, 0.4f);
DECL_GFX_PREF(Live, "general.smoothScroll.msdPhysics.enabled",
SmoothScrollMSDPhysicsEnabled, bool, false);
DECL_GFX_PREF(Live, "general.smoothScroll.msdPhysics.continuousMotionMaxDeltaMS",
SmoothScrollMSDPhysicsContinuousMotionMaxDeltaMS, int32_t, 120);
DECL_GFX_PREF(Live, "general.smoothScroll.msdPhysics.motionBeginSpringConstant",
SmoothScrollMSDPhysicsMotionBeginSpringConstant, int32_t, 1250);
DECL_GFX_PREF(Live, "general.smoothScroll.msdPhysics.slowdownMinDeltaMS",
SmoothScrollMSDPhysicsSlowdownMinDeltaMS, int32_t, 12);
DECL_GFX_PREF(Live, "general.smoothScroll.msdPhysics.slowdownMinDeltaRatio",
SmoothScrollMSDPhysicsSlowdownMinDeltaRatio, float, 1.3f);
DECL_GFX_PREF(Live, "general.smoothScroll.msdPhysics.slowdownSpringConstant",
SmoothScrollMSDPhysicsSlowdownSpringConstant, int32_t, 2000);
DECL_GFX_PREF(Live, "general.smoothScroll.msdPhysics.regularSpringConstant",
SmoothScrollMSDPhysicsRegularSpringConstant, int32_t, 1000);
DECL_GFX_PREF(Once, "gfx.android.rgb16.force", AndroidRGB16Force, bool, false);
DECL_GFX_PREF(Once, "gfx.apitrace.enabled", UseApitrace, bool, false);
@ -456,54 +316,20 @@ class gfxPrefs final {
#else
DECL_GFX_PREF(Once, "gfx.blocklist.all", BlocklistAll, int32_t, 0);
#endif
#if defined(MOZ_WIDGET_ANDROID)
// Overrides the glClear color used when the surface origin is not (0, 0)
// Used for drawing a border around the content.
DECL_GFX_PREF(Live, "gfx.compositor.override.clear-color.r", CompositorOverrideClearColorR, float, 0.0f);
DECL_GFX_PREF(Live, "gfx.compositor.override.clear-color.g", CompositorOverrideClearColorG, float, 0.0f);
DECL_GFX_PREF(Live, "gfx.compositor.override.clear-color.b", CompositorOverrideClearColorB, float, 0.0f);
DECL_GFX_PREF(Live, "gfx.compositor.override.clear-color.a", CompositorOverrideClearColorA, float, 0.0f);
#endif // defined(MOZ_WIDGET_ANDROID)
DECL_GFX_PREF(Live, "gfx.compositor.clearstate", CompositorClearState, bool, false);
DECL_GFX_PREF(Live, "gfx.compositor.glcontext.opaque", CompositorGLContextOpaque, bool, false);
// 0x7fff is the maximum supported xlib surface size and is more than enough for canvases.
DECL_GFX_PREF(Live, "gfx.canvas.max-size", MaxCanvasSize, int32_t, 0x7fff);
DECL_GFX_PREF(Live, "gfx.color_management.enablev4", CMSEnableV4, bool, false);
DECL_GFX_PREF(Live, "gfx.color_management.mode", CMSMode, int32_t,-1);
// The zero default here should match QCMS_INTENT_DEFAULT from qcms.h
DECL_GFX_PREF(Live, "gfx.color_management.rendering_intent", CMSRenderingIntent, int32_t, 0);
DECL_GFX_PREF(Live, "gfx.content.always-paint", AlwaysPaint, bool, false);
// Size in megabytes
DECL_GFX_PREF(Once, "gfx.content.skia-font-cache-size", SkiaContentFontCacheSize, int32_t, 5);
DECL_GFX_PREF(Once, "gfx.device-reset.limit", DeviceResetLimitCount, int32_t, 10);
DECL_GFX_PREF(Once, "gfx.device-reset.threshold-ms", DeviceResetThresholdMilliseconds, int32_t, -1);
DECL_GFX_PREF(Once, "gfx.direct2d.disabled", Direct2DDisabled, bool, false);
DECL_GFX_PREF(Once, "gfx.direct2d.force-enabled", Direct2DForceEnabled, bool, false);
DECL_GFX_PREF(Live, "gfx.direct2d.destroy-dt-on-paintthread",Direct2DDestroyDTOnPaintThread, bool, true);
DECL_GFX_PREF(Live, "gfx.direct3d11.reuse-decoder-device", Direct3D11ReuseDecoderDevice, int32_t, -1);
DECL_GFX_PREF(Live, "gfx.direct3d11.allow-keyed-mutex", Direct3D11AllowKeyedMutex, bool, true);
DECL_GFX_PREF(Live, "gfx.direct3d11.use-double-buffering", Direct3D11UseDoubleBuffering, bool, false);
DECL_GFX_PREF(Once, "gfx.direct3d11.enable-debug-layer", Direct3D11EnableDebugLayer, bool, false);
DECL_GFX_PREF(Once, "gfx.direct3d11.break-on-error", Direct3D11BreakOnError, bool, false);
DECL_GFX_PREF(Once, "gfx.direct3d11.sleep-on-create-device", Direct3D11SleepOnCreateDevice, int32_t, 0);
DECL_GFX_PREF(Live, "gfx.downloadable_fonts.keep_color_bitmaps", KeepColorBitmaps, bool, false);
DECL_GFX_PREF(Live, "gfx.downloadable_fonts.validate_variation_tables", ValidateVariationTables, bool, true);
DECL_GFX_PREF(Live, "gfx.downloadable_fonts.otl_validation", ValidateOTLTables, bool, true);
DECL_GFX_PREF(Live, "gfx.draw-color-bars", CompositorDrawColorBars, bool, false);
DECL_GFX_PREF(Once, "gfx.e10s.hide-plugins-for-scroll", HidePluginsForScroll, bool, true);
DECL_GFX_PREF(Once, "gfx.e10s.font-list.shared", SharedFontList, bool, false);
#if defined(XP_MACOSX)
DECL_GFX_PREF(Live, "gfx.font_rendering.coretext.enabled", CoreTextEnabled, bool, false);
#endif
DECL_GFX_PREF(Live, "gfx.layerscope.enabled", LayerScopeEnabled, bool, false);
DECL_GFX_PREF(Live, "gfx.layerscope.port", LayerScopePort, int32_t, 23456);
// Note that "gfx.logging.level" is defined in Logging.h.
DECL_GFX_PREF(Live, "gfx.logging.level", GfxLoggingLevel, int32_t, mozilla::gfx::LOG_DEFAULT);
DECL_GFX_PREF(Once, "gfx.logging.crash.length", GfxLoggingCrashLength, uint32_t, 16);
DECL_GFX_PREF(Live, "gfx.logging.painted-pixel-count.enabled",GfxLoggingPaintedPixelCountEnabled, bool, false);
// The maximums here are quite conservative, we can tighten them if problems show up.
DECL_GFX_PREF(Once, "gfx.logging.texture-usage.enabled", GfxLoggingTextureUsageEnabled, bool, false);
DECL_GFX_PREF(Once, "gfx.logging.peak-texture-usage.enabled",GfxLoggingPeakTextureUsageEnabled, bool, false);
@ -512,21 +338,14 @@ class gfxPrefs final {
DECL_GFX_PREF(Once, "gfx.max-alloc-size", MaxAllocSizeDoNotUseDirectly, int32_t, (int32_t)500000000);
// Use gfxPlatform::MaxTextureSize instead of the pref directly
DECL_GFX_PREF(Once, "gfx.max-texture-size", MaxTextureSizeDoNotUseDirectly, int32_t, (int32_t)32767);
DECL_GFX_PREF(Live, "gfx.partialpresent.force", PartialPresent, int32_t, 0);
DECL_GFX_PREF(Live, "gfx.perf-warnings.enabled", PerfWarnings, bool, false);
DECL_GFX_PREF(Live, "gfx.testing.device-reset", DeviceResetForTesting, int32_t, 0);
DECL_GFX_PREF(Live, "gfx.testing.device-fail", DeviceFailForTesting, bool, false);
DECL_GFX_PREF(Once, "gfx.text.disable-aa", DisableAllTextAA, bool, false);
DECL_GFX_PREF(Live, "gfx.ycbcr.accurate-conversion", YCbCrAccurateConversion, bool, false);
// Disable surface sharing due to issues with compatible FBConfigs on
// NVIDIA drivers as described in bug 1193015.
DECL_GFX_PREF(Live, "gfx.use-glx-texture-from-pixmap", UseGLXTextureFromPixmap, bool, false);
DECL_GFX_PREF(Once, "gfx.use-iosurface-textures", UseIOSurfaceTextures, bool, false);
DECL_GFX_PREF(Once, "gfx.use-mutex-on-present", UseMutexOnPresent, bool, false);
DECL_GFX_PREF(Once, "gfx.use-surfacetexture-textures", UseSurfaceTextureTextures, bool, false);
DECL_GFX_PREF(Once, "gfx.allow-texture-direct-mapping", AllowTextureDirectMapping, bool, true);
DECL_GFX_PREF(Live, "gfx.vsync.collect-scroll-transforms", CollectScrollTransforms, bool, false);
DECL_GFX_PREF(Once, "gfx.vsync.compositor.unobserve-count", CompositorUnobserveCount, int32_t, 10);
DECL_GFX_PREF(Once, "gfx.webrender.all", WebRenderAll, bool, false);
@ -536,72 +355,31 @@ class gfxPrefs final {
WebRenderAllQualifiedDefault,
bool,
false);
DECL_GFX_PREF(Live, "gfx.webrender.blob-images", WebRenderBlobImages, bool, true);
DECL_GFX_PREF(Live, "gfx.webrender.blob.invalidation", WebRenderBlobInvalidation, bool, false);
DECL_GFX_PREF(Live, "gfx.webrender.blob.paint-flashing", WebRenderBlobPaintFlashing, bool, false);
DECL_GFX_PREF(Live, "gfx.webrender.dl.dump-parent", WebRenderDLDumpParent, bool, false);
DECL_GFX_PREF(Live, "gfx.webrender.dl.dump-content", WebRenderDLDumpContent, bool, false);
DECL_GFX_PREF(Once, "gfx.webrender.enabled", WebRenderEnabledDoNotUseDirectly, bool, false);
DECL_GFX_PREF(Once, "gfx.webrender.force-disabled", WebRenderForceDisabled, bool, false);
DECL_GFX_PREF(Live, "gfx.webrender.highlight-painted-layers",WebRenderHighlightPaintedLayers, bool, false);
DECL_GFX_PREF(Live, "gfx.webrender.late-scenebuild-threshold", WebRenderLateSceneBuildThreshold, int32_t, 4);
DECL_GFX_PREF(Live, "gfx.webrender.max-filter-ops-per-chain", WebRenderMaxFilterOpsPerChain, uint32_t, 64);
DECL_GFX_PREF(Live, "gfx.webrender.picture-caching", WebRenderPictureCaching, bool, false);
DECL_GFX_PREF(Once, "gfx.webrender.split-render-roots", WebRenderSplitRenderRoots, bool, false);
DECL_GFX_PREF(Live, "gfx.webrender.start-debug-server", WebRenderStartDebugServer, bool, false);
// Use vsync events generated by hardware
DECL_GFX_PREF(Once, "gfx.work-around-driver-bugs", WorkAroundDriverBugs, bool, true);
DECL_GFX_PREF(Live, "gl.allow-high-power", GLAllowHighPower, bool, true);
DECL_GFX_PREF(Live, "gl.ignore-dx-interop2-blacklist", IgnoreDXInterop2Blacklist, bool, false);
DECL_GFX_PREF(Live, "gl.msaa-level", MSAALevel, uint32_t, 2);
#if defined(XP_MACOSX)
DECL_GFX_PREF(Live, "gl.multithreaded", GLMultithreaded, bool, false);
#endif
DECL_GFX_PREF(Live, "gl.require-hardware", RequireHardwareGL, bool, false);
DECL_GFX_PREF(Live, "gl.use-tls-is-current", UseTLSIsCurrent, int32_t, 0);
DECL_GFX_PREF(Live, "image.animated.decode-on-demand.threshold-kb", ImageAnimatedDecodeOnDemandThresholdKB, uint32_t, 20480);
DECL_GFX_PREF(Live, "image.animated.decode-on-demand.batch-size", ImageAnimatedDecodeOnDemandBatchSize, uint32_t, 6);
DECL_GFX_PREF(Live, "image.animated.decode-on-demand.recycle", ImageAnimatedDecodeOnDemandRecycle, bool, false);
DECL_GFX_PREF(Live, "image.animated.resume-from-last-displayed", ImageAnimatedResumeFromLastDisplayed, bool, false);
DECL_GFX_PREF(Live, "image.cache.factor2.threshold-surfaces", ImageCacheFactor2ThresholdSurfaces, int32_t, -1);
DECL_GFX_PREF(Live, "image.cache.max-rasterized-svg-threshold-kb", ImageCacheMaxRasterizedSVGThresholdKB, int32_t, 90*1024);
DECL_GFX_PREF(Once, "image.cache.size", ImageCacheSize, int32_t, 5*1024*1024);
DECL_GFX_PREF(Once, "image.cache.timeweight", ImageCacheTimeWeight, int32_t, 500);
DECL_GFX_PREF(Live, "image.decode-immediately.enabled", ImageDecodeImmediatelyEnabled, bool, false);
DECL_GFX_PREF(Live, "image.downscale-during-decode.enabled", ImageDownscaleDuringDecodeEnabled, bool, true);
DECL_GFX_PREF(Live, "image.infer-src-animation.threshold-ms", ImageInferSrcAnimationThresholdMS, uint32_t, 2000);
DECL_GFX_PREF(Live, "image.layout_network_priority", ImageLayoutNetworkPriority, bool, true);
DECL_GFX_PREF(Once, "image.mem.decode_bytes_at_a_time", ImageMemDecodeBytesAtATime, uint32_t, 200000);
DECL_GFX_PREF(Live, "image.mem.discardable", ImageMemDiscardable, bool, false);
DECL_GFX_PREF(Once, "image.mem.animated.discardable", ImageMemAnimatedDiscardable, bool, false);
DECL_GFX_PREF(Live, "image.mem.animated.use_heap", ImageMemAnimatedUseHeap, bool, false);
DECL_GFX_PREF(Live, "image.mem.debug-reporting", ImageMemDebugReporting, bool, false);
DECL_GFX_PREF(Live, "image.mem.shared", ImageMemShared, bool, true);
DECL_GFX_PREF(Once, "image.mem.surfacecache.discard_factor", ImageMemSurfaceCacheDiscardFactor, uint32_t, 1);
DECL_GFX_PREF(Once, "image.mem.surfacecache.max_size_kb", ImageMemSurfaceCacheMaxSizeKB, uint32_t, 100 * 1024);
DECL_GFX_PREF(Once, "image.mem.surfacecache.min_expiration_ms", ImageMemSurfaceCacheMinExpirationMS, uint32_t, 60*1000);
DECL_GFX_PREF(Once, "image.mem.surfacecache.size_factor", ImageMemSurfaceCacheSizeFactor, uint32_t, 64);
DECL_GFX_PREF(Live, "image.mem.volatile.min_threshold_kb", ImageMemVolatileMinThresholdKB, int32_t, -1);
DECL_GFX_PREF(Once, "image.multithreaded_decoding.limit", ImageMTDecodingLimit, int32_t, -1);
DECL_GFX_PREF(Once, "image.multithreaded_decoding.idle_timeout", ImageMTDecodingIdleTimeout, int32_t, -1);
DECL_GFX_PREF(Live, "image.webp.enabled", ImageWebPEnabled, bool, false);
DECL_GFX_PREF(Once, "layers.acceleration.disabled", LayersAccelerationDisabledDoNotUseDirectly, bool, false);
// Instead, use gfxConfig::IsEnabled(Feature::HW_COMPOSITING).
DECL_GFX_PREF(Live, "layers.acceleration.draw-fps", LayersDrawFPS, bool, false);
DECL_GFX_PREF(Live, "layers.acceleration.draw-fps.print-histogram", FPSPrintHistogram, bool, false);
DECL_GFX_PREF(Live, "layers.acceleration.draw-fps.write-to-file", WriteFPSToFile, bool, false);
DECL_GFX_PREF(Once, "layers.acceleration.force-enabled", LayersAccelerationForceEnabledDoNotUseDirectly, bool, false);
DECL_GFX_PREF(Live, "layers.advanced.basic-layer.enabled", LayersAdvancedBasicLayerEnabled, bool, false);
DECL_GFX_PREF(Once, "layers.amd-switchable-gfx.enabled", LayersAMDSwitchableGfxEnabled, bool, false);
DECL_GFX_PREF(Once, "layers.async-pan-zoom.enabled", AsyncPanZoomEnabledDoNotUseDirectly, bool, true);
DECL_GFX_PREF(Live, "layers.bench.enabled", LayersBenchEnabled, bool, false);
DECL_GFX_PREF(Once, "layers.bufferrotation.enabled", BufferRotationEnabled, bool, true);
DECL_GFX_PREF(Live, "layers.child-process-shutdown", ChildProcessShutdown, bool, true);
#ifdef MOZ_GFX_OPTIMIZE_MOBILE
// If MOZ_GFX_OPTIMIZE_MOBILE is defined, we force component alpha off
// and ignore the preference.
@ -612,61 +390,30 @@ class gfxPrefs final {
DECL_GFX_PREF(Once, "layers.componentalpha.enabled", ComponentAlphaEnabled, bool, true);
#endif
DECL_GFX_PREF(Once, "layers.d3d11.force-warp", LayersD3D11ForceWARP, bool, false);
DECL_GFX_PREF(Live, "layers.deaa.enabled", LayersDEAAEnabled, bool, false);
DECL_GFX_PREF(Live, "layers.draw-bigimage-borders", DrawBigImageBorders, bool, false);
DECL_GFX_PREF(Live, "layers.draw-borders", DrawLayerBorders, bool, false);
DECL_GFX_PREF(Live, "layers.draw-tile-borders", DrawTileBorders, bool, false);
DECL_GFX_PREF(Live, "layers.draw-layer-info", DrawLayerInfo, bool, false);
DECL_GFX_PREF(Live, "layers.dump", LayersDump, bool, false);
DECL_GFX_PREF(Live, "layers.dump-texture", LayersDumpTexture, bool, false);
#ifdef MOZ_DUMP_PAINTING
DECL_GFX_PREF(Live, "layers.dump-client-layers", DumpClientLayers, bool, false);
DECL_GFX_PREF(Live, "layers.dump-decision", LayersDumpDecision, bool, false);
DECL_GFX_PREF(Live, "layers.dump-host-layers", DumpHostLayers, bool, false);
#endif
// 0 is "no change" for contrast, positive values increase it, negative values
// decrease it until we hit mid gray at -1 contrast, after that it gets weird.
DECL_GFX_PREF(Live, "layers.effect.contrast", LayersEffectContrast, float, 0.0f);
DECL_GFX_PREF(Live, "layers.effect.grayscale", LayersEffectGrayscale, bool, false);
DECL_GFX_PREF(Live, "layers.effect.invert", LayersEffectInvert, bool, false);
DECL_GFX_PREF(Once, "layers.enable-tiles", LayersTilesEnabled, bool, false);
DECL_GFX_PREF(Once, "layers.enable-tiles-if-skia-pomtp", LayersTilesEnabledIfSkiaPOMTP, bool, false);
DECL_GFX_PREF(Live, "layers.flash-borders", FlashLayerBorders, bool, false);
DECL_GFX_PREF(Once, "layers.force-shmem-tiles", ForceShmemTiles, bool, false);
DECL_GFX_PREF(Once, "layers.gpu-process.allow-software", GPUProcessAllowSoftware, bool, false);
DECL_GFX_PREF(Once, "layers.gpu-process.enabled", GPUProcessEnabled, bool, false);
DECL_GFX_PREF(Once, "layers.gpu-process.force-enabled", GPUProcessForceEnabled, bool, false);
DECL_GFX_PREF(Once, "layers.gpu-process.ipc_reply_timeout_ms", GPUProcessIPCReplyTimeoutMs, int32_t, 10000);
DECL_GFX_PREF(Live, "layers.gpu-process.max_restarts", GPUProcessMaxRestarts, int32_t, 1);
// Note: This pref will only be used if it is less than layers.gpu-process.max_restarts.
DECL_GFX_PREF(Live, "layers.gpu-process.max_restarts_with_decoder", GPUProcessMaxRestartsWithDecoder, int32_t, 0);
DECL_GFX_PREF(Once, "layers.gpu-process.startup_timeout_ms", GPUProcessTimeoutMs, int32_t, 5000);
DECL_GFX_PREF(Live, "layers.low-precision-buffer", UseLowPrecisionBuffer, bool, false);
DECL_GFX_PREF(Live, "layers.low-precision-opacity", LowPrecisionOpacity, float, 1.0f);
DECL_GFX_PREF(Live, "layers.low-precision-resolution", LowPrecisionResolution, float, 0.25f);
DECL_GFX_PREF(Live, "layers.max-active", MaxActiveLayers, int32_t, -1);
DECL_GFX_PREF(Once, "layers.mlgpu.enabled", AdvancedLayersEnabledDoNotUseDirectly, bool, false);
DECL_GFX_PREF(Once, "layers.mlgpu.enable-buffer-cache", AdvancedLayersEnableBufferCache, bool, true);
DECL_GFX_PREF(Once, "layers.mlgpu.enable-buffer-sharing", AdvancedLayersEnableBufferSharing, bool, true);
DECL_GFX_PREF(Once, "layers.mlgpu.enable-clear-view", AdvancedLayersEnableClearView, bool, true);
DECL_GFX_PREF(Once, "layers.mlgpu.enable-cpu-occlusion", AdvancedLayersEnableCPUOcclusion, bool, true);
DECL_GFX_PREF(Once, "layers.mlgpu.enable-depth-buffer", AdvancedLayersEnableDepthBuffer, bool, false);
DECL_GFX_PREF(Live, "layers.mlgpu.enable-invalidation", AdvancedLayersUseInvalidation, bool, true);
DECL_GFX_PREF(Once, "layers.mlgpu.enable-on-windows7", AdvancedLayersEnableOnWindows7, bool, false);
DECL_GFX_PREF(Once, "layers.mlgpu.enable-container-resizing", AdvancedLayersEnableContainerResizing, bool, true);
DECL_GFX_PREF(Once, "layers.offmainthreadcomposition.force-disabled", LayersOffMainThreadCompositionForceDisabled, bool, false);
DECL_GFX_PREF(Live, "layers.offmainthreadcomposition.frame-rate", LayersCompositionFrameRate, int32_t,-1);
DECL_GFX_PREF(Once, "layers.omtp.capture-limit", LayersOMTPCaptureLimit, uint32_t, 25 * 1024 * 1024);
DECL_GFX_PREF(Live, "layers.omtp.dump-capture", LayersOMTPDumpCapture, bool, false);
DECL_GFX_PREF(Once, "layers.omtp.paint-workers", LayersOMTPPaintWorkers, int32_t, 1);
DECL_GFX_PREF(Live, "layers.omtp.release-capture-on-main-thread", LayersOMTPReleaseCaptureOnMainThread, bool, false);
DECL_GFX_PREF(Live, "layers.orientation.sync.timeout", OrientationSyncMillis, uint32_t, (uint32_t)0);
DECL_GFX_PREF(Once, "layers.prefer-opengl", LayersPreferOpenGL, bool, false);
DECL_GFX_PREF(Live, "layers.progressive-paint", ProgressivePaint, bool, false);
DECL_GFX_PREF(Live, "layers.shared-buffer-provider.enabled", PersistentBufferProviderSharedEnabled, bool, false);
DECL_GFX_PREF(Live, "layers.single-tile.enabled", LayersSingleTileEnabled, bool, true);
DECL_GFX_PREF(Live, "layers.force-synchronous-resize", LayersForceSynchronousResize, bool, true);
DECL_GFX_PREF(Once, "layers.windowrecording.path", LayersWindowRecordingPath, std::string, std::string());
// We allow for configurable and rectangular tile size to avoid wasting memory on devices whose
@ -679,150 +426,22 @@ class gfxPrefs final {
DECL_GFX_PREF(Once, "layers.tile-pool-shrink-timeout", LayersTilePoolShrinkTimeout, uint32_t, (uint32_t)50);
DECL_GFX_PREF(Once, "layers.tile-pool-clear-timeout", LayersTilePoolClearTimeout, uint32_t, (uint32_t)5000);
DECL_GFX_PREF(Once, "layers.tiles.adjust", LayersTilesAdjust, bool, true);
DECL_GFX_PREF(Live, "layers.tiles.retain-back-buffer", LayersTileRetainBackBuffer, bool, true);
DECL_GFX_PREF(Once, "layers.tiles.edge-padding", TileEdgePaddingEnabled, bool, false);
DECL_GFX_PREF(Live, "layers.tiles.fade-in.enabled", LayerTileFadeInEnabled, bool, false);
DECL_GFX_PREF(Live, "layers.tiles.fade-in.duration-ms", LayerTileFadeInDuration, uint32_t, 250);
DECL_GFX_PREF(Live, "layers.transaction.warning-ms", LayerTransactionWarning, uint32_t, 200);
DECL_GFX_PREF(Once, "layers.uniformity-info", UniformityInfo, bool, false);
DECL_GFX_PREF(Once, "layers.use-image-offscreen-surfaces", UseImageOffscreenSurfaces, bool, true);
DECL_GFX_PREF(Live, "layers.draw-mask-debug", DrawMaskLayer, bool, false);
DECL_GFX_PREF(Live, "layers.geometry.opengl.enabled", OGLLayerGeometry, bool, false);
DECL_GFX_PREF(Live, "layers.geometry.basic.enabled", BasicLayerGeometry, bool, false);
DECL_GFX_PREF(Live, "layers.geometry.d3d11.enabled", D3D11LayerGeometry, bool, false);
DECL_GFX_PREF(Live, "layout.animation.prerender.partial", PartiallyPrerenderAnimatedContent, bool, false);
DECL_GFX_PREF(Live, "layout.animation.prerender.viewport-ratio-limit-x", AnimationPrerenderViewportRatioLimitX, float, 1.125f);
DECL_GFX_PREF(Live, "layout.animation.prerender.viewport-ratio-limit-y", AnimationPrerenderViewportRatioLimitY, float, 1.125f);
DECL_GFX_PREF(Live, "layout.animation.prerender.absolute-limit-x", AnimationPrerenderAbsoluteLimitX, uint32_t, 4096);
DECL_GFX_PREF(Live, "layout.animation.prerender.absolute-limit-y", AnimationPrerenderAbsoluteLimitY, uint32_t, 4096);
DECL_GFX_PREF(Live, "layout.css.paint-order.enabled", PaintOrderEnabled, bool, false);
DECL_GFX_PREF(Live, "layout.css.scroll-behavior.damping-ratio", ScrollBehaviorDampingRatio, float, 1.0f);
DECL_GFX_PREF(Live, "layout.css.scroll-behavior.enabled", ScrollBehaviorEnabled, bool, true);
DECL_GFX_PREF(Live, "layout.css.scroll-behavior.spring-constant", ScrollBehaviorSpringConstant, float, 250.0f);
DECL_GFX_PREF(Live, "layout.css.scroll-snap.prediction-max-velocity", ScrollSnapPredictionMaxVelocity, int32_t, 2000);
DECL_GFX_PREF(Live, "layout.css.scroll-snap.prediction-sensitivity", ScrollSnapPredictionSensitivity, float, 0.750f);
DECL_GFX_PREF(Live, "layout.css.scroll-snap.proximity-threshold", ScrollSnapProximityThreshold, int32_t, 200);
DECL_GFX_PREF(Live, "layout.css.touch_action.enabled", TouchActionEnabled, bool, false);
DECL_GFX_PREF(Live, "layout.display-list.build-twice", LayoutDisplayListBuildTwice, bool, false);
DECL_GFX_PREF(Live, "layout.display-list.retain", LayoutRetainDisplayList, bool, true);
DECL_GFX_PREF(Live, "layout.display-list.retain.chrome", LayoutRetainDisplayListChrome, bool, false);
DECL_GFX_PREF(Live, "layout.display-list.retain.verify", LayoutVerifyRetainDisplayList, bool, false);
DECL_GFX_PREF(Live, "layout.display-list.retain.verify.order", LayoutVerifyRetainDisplayListOrder, bool, false);
DECL_GFX_PREF(Live, "layout.display-list.rebuild-frame-limit", LayoutRebuildFrameLimit, uint32_t, 500);
DECL_GFX_PREF(Live, "layout.display-list.dump", LayoutDumpDisplayList, bool, false);
DECL_GFX_PREF(Live, "layout.display-list.dump-content", LayoutDumpDisplayListContent, bool, false);
DECL_GFX_PREF(Live, "layout.display-list.dump-parent", LayoutDumpDisplayListParent, bool, false);
DECL_GFX_PREF(Live, "layout.display-list.show-rebuild-area", LayoutDisplayListShowArea, bool, false);
DECL_GFX_PREF(Live, "layout.display-list.flatten-transform", LayoutFlattenTransform, bool, true);
DECL_GFX_PREF(Live, "layout.frame_rate", LayoutFrameRate, int32_t, -1);
DECL_GFX_PREF(Live, "layout.min-active-layer-size", LayoutMinActiveLayerSize, int, 64);
DECL_GFX_PREF(Once, "layout.paint_rects_separately", LayoutPaintRectsSeparately, bool, true);
// This and code dependent on it should be removed once containerless scrolling looks stable.
DECL_GFX_PREF(Live, "layout.scroll.root-frame-containers", LayoutUseContainersForRootFrames, bool, false);
// This pref is to be set by test code only.
DECL_GFX_PREF(Live, "layout.scrollbars.always-layerize-track", AlwaysLayerizeScrollbarTrackTestOnly, bool, false);
DECL_GFX_PREF(Live, "layout.smaller-painted-layers", LayoutSmallerPaintedLayers, bool, false);
DECL_GFX_PREF(Once, "media.hardware-video-decoding.force-enabled",
HardwareVideoDecodingForceEnabled, bool, false);
#ifdef XP_WIN
DECL_GFX_PREF(Live, "media.wmf.dxva.d3d11.enabled", PDMWMFAllowD3D11, bool, true);
DECL_GFX_PREF(Live, "media.wmf.dxva.max-videos", PDMWMFMaxDXVAVideos, uint32_t, 8);
DECL_GFX_PREF(Live, "media.wmf.use-nv12-format", PDMWMFUseNV12Format, bool, true);
DECL_GFX_PREF(Live, "media.wmf.force.allow-p010-format", PDMWMFForceAllowP010Format, bool, false);
DECL_GFX_PREF(Once, "media.wmf.use-sync-texture", PDMWMFUseSyncTexture, bool, true);
DECL_GFX_PREF(Live, "media.wmf.low-latency.enabled", PDMWMFLowLatencyEnabled, bool, false);
DECL_GFX_PREF(Live, "media.wmf.low-latency.force-disabled", PDMWMFLowLatencyForceDisabled, bool, false);
DECL_GFX_PREF(Live, "media.wmf.skip-blacklist", PDMWMFSkipBlacklist, bool, false);
DECL_GFX_PREF(Live, "media.wmf.deblacklisting-for-telemetry-in-gpu-process", PDMWMFDeblacklistingForTelemetryInGPUProcess, bool, false);
DECL_GFX_PREF(Live, "media.wmf.amd.highres.enabled", PDMWMFAMDHighResEnabled, bool, true);
DECL_GFX_PREF(Live, "media.wmf.allow-unsupported-resolutions", PDMWMFAllowUnsupportedResolutions, bool, false);
DECL_GFX_PREF(Once, "media.wmf.vp9.enabled", MediaWmfVp9Enabled, bool, true);
#endif
// These affect how line scrolls from wheel events will be accelerated.
DECL_GFX_PREF(Live, "mousewheel.acceleration.factor", MouseWheelAccelerationFactor, int32_t, -1);
DECL_GFX_PREF(Live, "mousewheel.acceleration.start", MouseWheelAccelerationStart, int32_t, -1);
// This affects whether events will be routed through APZ or not.
DECL_GFX_PREF(Live, "mousewheel.system_scroll_override_on_root_content.enabled",
MouseWheelHasRootScrollDeltaOverride, bool, false);
DECL_GFX_PREF(Live, "mousewheel.system_scroll_override_on_root_content.horizontal.factor",
MouseWheelRootScrollHorizontalFactor, int32_t, 0);
DECL_GFX_PREF(Live, "mousewheel.system_scroll_override_on_root_content.vertical.factor",
MouseWheelRootScrollVerticalFactor, int32_t, 0);
DECL_GFX_PREF(Live, "mousewheel.transaction.ignoremovedelay",MouseWheelIgnoreMoveDelayMs, int32_t, (int32_t)100);
DECL_GFX_PREF(Live, "mousewheel.transaction.timeout", MouseWheelTransactionTimeoutMs, int32_t, (int32_t)1500);
DECL_GFX_PREF(Live, "nglayout.debug.widget_update_flashing", WidgetUpdateFlashing, bool, false);
DECL_GFX_PREF(Live, "print.font-variations-as-paths", PrintFontVariationsAsPaths, bool, true);
DECL_GFX_PREF(Live, "privacy.resistFingerprinting", ResistFingerprinting, bool, false);
DECL_GFX_PREF(Once, "slider.snapMultiplier", SliderSnapMultiplier, int32_t, 0);
DECL_GFX_PREF(Live, "test.events.async.enabled", TestEventsAsyncEnabled, bool, false);
DECL_GFX_PREF(Live, "test.mousescroll", MouseScrollTestingEnabled, bool, false);
DECL_GFX_PREF(Live, "toolkit.scrollbox.horizontalScrollDistance", ToolkitHorizontalScrollDistance, int32_t, 5);
DECL_GFX_PREF(Live, "toolkit.scrollbox.verticalScrollDistance", ToolkitVerticalScrollDistance, int32_t, 3);
DECL_GFX_PREF(Live, "ui.click_hold_context_menus.delay", UiClickHoldContextMenusDelay, int32_t, 500);
// WebGL (for pref access from Worker threads)
DECL_GFX_PREF(Live, "webgl.1.allow-core-profiles", WebGL1AllowCoreProfile, bool, false);
DECL_GFX_PREF(Live, "webgl.all-angle-options", WebGLAllANGLEOptions, bool, false);
DECL_GFX_PREF(Live, "webgl.angle.force-d3d11", WebGLANGLEForceD3D11, bool, false);
DECL_GFX_PREF(Live, "webgl.angle.try-d3d11", WebGLANGLETryD3D11, bool, false);
DECL_GFX_PREF(Live, "webgl.angle.force-warp", WebGLANGLEForceWARP, bool, false);
DECL_GFX_PREF(Live, "webgl.can-lose-context-in-foreground", WebGLCanLoseContextInForeground, bool, true);
DECL_GFX_PREF(Live, "webgl.default-low-power", WebGLDefaultLowPower, bool, false);
DECL_GFX_PREF(Live, "webgl.default-no-alpha", WebGLDefaultNoAlpha, bool, false);
DECL_GFX_PREF(Live, "webgl.disable-angle", WebGLDisableANGLE, bool, false);
DECL_GFX_PREF(Live, "webgl.disable-wgl", WebGLDisableWGL, bool, false);
DECL_GFX_PREF(Live, "webgl.disable-extensions", WebGLDisableExtensions, bool, false);
DECL_GFX_PREF(Live, "webgl.dxgl.enabled", WebGLDXGLEnabled, bool, false);
DECL_GFX_PREF(Live, "webgl.dxgl.needs-finish", WebGLDXGLNeedsFinish, bool, false);
DECL_GFX_PREF(Live, "webgl.disable-fail-if-major-performance-caveat",
WebGLDisableFailIfMajorPerformanceCaveat, bool, false);
DECL_GFX_PREF(Live, "webgl.disable-DOM-blit-uploads",
WebGLDisableDOMBlitUploads, bool, false);
DECL_GFX_PREF(Live, "webgl.disabled", WebGLDisabled, bool, false);
DECL_GFX_PREF(Live, "webgl.enable-draft-extensions", WebGLDraftExtensionsEnabled, bool, false);
DECL_GFX_PREF(Live, "webgl.enable-privileged-extensions", WebGLPrivilegedExtensionsEnabled, bool, false);
DECL_GFX_PREF(Live, "webgl.enable-surface-texture", WebGLSurfaceTextureEnabled, bool, false);
DECL_GFX_PREF(Live, "webgl.enable-webgl2", WebGL2Enabled, bool, true);
DECL_GFX_PREF(Live, "webgl.force-enabled", WebGLForceEnabled, bool, false);
DECL_GFX_PREF(Once, "webgl.force-layers-readback", WebGLForceLayersReadback, bool, false);
DECL_GFX_PREF(Live, "webgl.force-index-validation", WebGLForceIndexValidation, int32_t, 0);
DECL_GFX_PREF(Live, "webgl.lose-context-on-memory-pressure", WebGLLoseContextOnMemoryPressure, bool, false);
DECL_GFX_PREF(Live, "webgl.max-contexts", WebGLMaxContexts, uint32_t, 32);
DECL_GFX_PREF(Live, "webgl.max-contexts-per-principal", WebGLMaxContextsPerPrincipal, uint32_t, 16);
DECL_GFX_PREF(Live, "webgl.max-warnings-per-context", WebGLMaxWarningsPerContext, uint32_t, 32);
DECL_GFX_PREF(Live, "webgl.min_capability_mode", WebGLMinCapabilityMode, bool, false);
DECL_GFX_PREF(Live, "webgl.msaa-force", WebGLForceMSAA, bool, false);
DECL_GFX_PREF(Live, "webgl.msaa-samples", WebGLMsaaSamples, uint32_t, 4);
DECL_GFX_PREF(Live, "webgl.prefer-16bpp", WebGLPrefer16bpp, bool, false);
DECL_GFX_PREF(Live, "webgl.allow-immediate-queries", WebGLImmediateQueries, bool, false);
DECL_GFX_PREF(Live, "webgl.allow-fb-invalidation", WebGLFBInvalidation, bool, false);
DECL_GFX_PREF(Live, "webgl.perf.max-warnings", WebGLMaxPerfWarnings, int32_t, 0);
DECL_GFX_PREF(Live, "webgl.perf.max-acceptable-fb-status-invals", WebGLMaxAcceptableFBStatusInvals, int32_t, 0);
DECL_GFX_PREF(Live, "webgl.perf.spew-frame-allocs", WebGLSpewFrameAllocs, bool, true);
DECL_GFX_PREF(Live, "widget.window-transforms.disabled", WindowTransformsDisabled, bool, false);
// WARNING:
// Please make sure that you've added your new preference to the list above

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

@ -7,12 +7,12 @@
#include "gfxUserFontSet.h"
#include "gfxPlatform.h"
#include "gfxPrefs.h"
#include "nsIProtocolHandler.h"
#include "gfxFontConstants.h"
#include "mozilla/FontPropertyTypes.h"
#include "mozilla/Preferences.h"
#include "mozilla/Services.h"
#include "mozilla/StaticPrefs.h"
#include "mozilla/Telemetry.h"
#include "mozilla/gfx/2D.h"
#include "gfxPlatformFontList.h"
@ -186,11 +186,11 @@ class MOZ_STACK_CLASS gfxOTSContext : public ots::OTSContext {
explicit gfxOTSContext(gfxUserFontEntry* aUserFontEntry)
: mUserFontEntry(aUserFontEntry) {
// Whether to apply OTS validation to OpenType Layout tables
mCheckOTLTables = gfxPrefs::ValidateOTLTables();
mCheckOTLTables = StaticPrefs::ValidateOTLTables();
// Whether to preserve Variation tables in downloaded fonts
mCheckVariationTables = gfxPrefs::ValidateVariationTables();
mCheckVariationTables = StaticPrefs::ValidateVariationTables();
// Whether to preserve color bitmap glyphs
mKeepColorBitmaps = gfxPrefs::KeepColorBitmaps();
mKeepColorBitmaps = StaticPrefs::KeepColorBitmaps();
}
virtual ots::TableAction GetTableAction(uint32_t aTag) override {

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

@ -1461,9 +1461,11 @@ void gfxUtils::RemoveShaderCacheFromDiskIfNecessary() {
/* static */
bool gfxUtils::DumpDisplayList() {
return gfxPrefs::LayoutDumpDisplayList() ||
(gfxPrefs::LayoutDumpDisplayListParent() && XRE_IsParentProcess()) ||
(gfxPrefs::LayoutDumpDisplayListContent() && XRE_IsContentProcess());
return StaticPrefs::LayoutDumpDisplayList() ||
(StaticPrefs::LayoutDumpDisplayListParent() &&
XRE_IsParentProcess()) ||
(StaticPrefs::LayoutDumpDisplayListContent() &&
XRE_IsContentProcess());
}
wr::RenderRoot gfxUtils::GetContentRenderRoot() {

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