Bug 1333122 - Remove gfxPrefs::WebRenderEnabled() to avoid it being used inappopriately; do WR and APZ decision-making during compositor creation. r=dvander?

MozReview-Commit-ID: Fkv6G35BcFw
This commit is contained in:
Kartikaya Gupta 2017-01-24 08:03:08 -05:00
Родитель ce97934624
Коммит 2d5a95cae6
3 изменённых файлов: 12 добавлений и 14 удалений

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

@ -2464,12 +2464,6 @@ gfxPlatform::AsyncPanZoomEnabled()
if (!BrowserTabsRemoteAutostart()) {
return false;
}
#ifdef MOZ_ENABLE_WEBRENDER
// For webrender hacking we have a special pref to disable APZ even with e10s
if (gfxPrefs::WebRenderEnabled() && !gfxPrefs::APZAllowWithWebRender()) {
return false;
}
#endif // MOZ_ENABLE_WEBRENDER
#endif
#ifdef MOZ_WIDGET_ANDROID
return true;

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

@ -425,13 +425,6 @@ private:
// Use vsync events generated by hardware
DECL_GFX_PREF(Once, "gfx.work-around-driver-bugs", WorkAroundDriverBugs, bool, true);
DECL_GFX_PREF(Once, "gfx.screen-mirroring.enabled", ScreenMirroringEnabled, bool, false);
#ifdef MOZ_ENABLE_WEBRENDER
DECL_GFX_PREF(Once, "gfx.webrender.enabled", WebRenderEnabled, bool, false);
#else
public:
static bool WebRenderEnabled() { return false; }
private:
#endif
DECL_GFX_PREF(Live, "gl.ignore-dx-interop2-blacklist", IgnoreDXInterop2Blacklist, bool, false);
DECL_GFX_PREF(Live, "gl.msaa-level", MSAALevel, uint32_t, 2);

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

@ -1298,7 +1298,18 @@ void nsBaseWidget::CreateCompositor(int aWidth, int aHeight)
CreateCompositorVsyncDispatcher();
CompositorOptions options(UseAPZ(), gfxPrefs::WebRenderEnabled());
// 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 enableAPZ = UseAPZ();
if (enableWR && !gfxPrefs::APZAllowWithWebRender()) {
// Disable APZ on widgets using WebRender, since it doesn't work yet. Allow
// it on non-WR widgets or if the pref forces it on.
enableAPZ = false;
}
CompositorOptions options(enableAPZ, enableWR);
RefPtr<LayerManager> lm;
if (options.UseWebRender()) {