Bug 1337085 - Add a gfxVar to control whether or not webrender is enabled. r=sotaro
MozReview-Commit-ID: 8Ebc0DbhYbZ
This commit is contained in:
@@ -33,6 +33,7 @@ class gfxVarReceiver;
|
||||
_(PDMWMFDisableD3D11Dlls, nsCString, nsCString()) \
|
||||
_(PDMWMFDisableD3D9Dlls, nsCString, nsCString()) \
|
||||
_(DXInterop2Blocked, bool, false) \
|
||||
_(UseWebRender, bool, false) \
|
||||
|
||||
/* Add new entries above this line. */
|
||||
|
||||
|
||||
@@ -689,6 +689,18 @@ gfxPlatform::Init()
|
||||
#endif
|
||||
gPlatform->InitAcceleration();
|
||||
|
||||
#ifdef MOZ_ENABLE_WEBRENDER
|
||||
if (XRE_IsParentProcess()) {
|
||||
// XXX: right now this is just based on the pref. But we may want to
|
||||
// do other runtime detection of hardware support etc.
|
||||
// This pref defaults to true, so builds with --enable-webrender have it
|
||||
// turned on by default, but can have it disabled via pref. The ifdef
|
||||
// guards this entire block, so builds without --enable-webrender will
|
||||
// always have the gfxVar default to false.
|
||||
gfxVars::SetUseWebRender(Preferences::GetBool("gfx.webrender.enabled", true));
|
||||
}
|
||||
#endif
|
||||
|
||||
if (gfxConfig::IsEnabled(Feature::GPU_PROCESS)) {
|
||||
GPUProcessManager* gpu = GPUProcessManager::Get();
|
||||
gpu->LaunchGPUProcess();
|
||||
|
||||
@@ -64,6 +64,7 @@
|
||||
#include "mozilla/dom/ContentChild.h"
|
||||
#include "mozilla/dom/TabParent.h"
|
||||
#include "mozilla/gfx/GPUProcessManager.h"
|
||||
#include "mozilla/gfx/gfxVars.h"
|
||||
#include "mozilla/Move.h"
|
||||
#include "mozilla/Services.h"
|
||||
#include "mozilla/Sprintf.h"
|
||||
@@ -1300,11 +1301,7 @@ void nsBaseWidget::CreateCompositor(int aWidth, int aHeight)
|
||||
|
||||
CreateCompositorVsyncDispatcher();
|
||||
|
||||
// For now we decide whether or not to enable WR on this widget by the current
|
||||
// value of the pref (this is the only place in the code allowed to check the
|
||||
// value of the pref). We might want to change this eventually and drop the
|
||||
// pref entirely.
|
||||
bool enableWR = Preferences::GetBool("gfx.webrender.enabled", false);
|
||||
bool enableWR = gfx::gfxVars::UseWebRender();
|
||||
bool enableAPZ = UseAPZ();
|
||||
if (enableWR && !gfxPrefs::APZAllowWithWebRender()) {
|
||||
// Disable APZ on widgets using WebRender, since it doesn't work yet. Allow
|
||||
|
||||
Reference in New Issue
Block a user