Bug 1603207 - Only enable native compositor if picture caching enabled. r=sotaro
authorGlenn Watson <git@intuitionlibrary.com>
Thu, 12 Dec 2019 00:08:38 +0000
changeset 506593 73b2a65e1bfb1b8c561b79e9ece2dbde069159b6
parent 506592 a37d83819f44c542699e5069b4609b47584b2c9e
child 506594 384c1998a98268fb8d109cad8317285266c82d53
push id36908
push usermalexandru@mozilla.com
push dateThu, 12 Dec 2019 09:53:26 +0000
treeherdermozilla-central@192e0e33eb59 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssotaro
bugs1603207
milestone73.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1603207 - Only enable native compositor if picture caching enabled. r=sotaro Differential Revision: https://phabricator.services.mozilla.com/D56817
gfx/webrender_bindings/RenderCompositorANGLE.cpp
gfx/webrender_bindings/RenderCompositorOGL.cpp
--- a/gfx/webrender_bindings/RenderCompositorANGLE.cpp
+++ b/gfx/webrender_bindings/RenderCompositorANGLE.cpp
@@ -719,17 +719,18 @@ bool RenderCompositorANGLE::IsContextLos
   // Then this function just uses GetDeviceRemovedReason().
   if (mDevice->GetDeviceRemovedReason() != S_OK) {
     return true;
   }
   return false;
 }
 
 bool RenderCompositorANGLE::UseCompositor() {
-  if (!mDCLayerTree || !gfx::gfxVars::UseWebRenderCompositor()) {
+  if (!mDCLayerTree || !gfx::gfxVars::UseWebRenderCompositor() ||
+      !StaticPrefs::gfx_webrender_picture_caching()) {
     return false;
   }
   return true;
 }
 
 bool RenderCompositorANGLE::ShouldUseNativeCompositor() {
   return UseCompositor();
 }
--- a/gfx/webrender_bindings/RenderCompositorOGL.cpp
+++ b/gfx/webrender_bindings/RenderCompositorOGL.cpp
@@ -148,17 +148,18 @@ void RenderCompositorOGL::Pause() {}
 
 bool RenderCompositorOGL::Resume() { return true; }
 
 LayoutDeviceIntSize RenderCompositorOGL::GetBufferSize() {
   return mWidget->GetClientSize();
 }
 
 bool RenderCompositorOGL::ShouldUseNativeCompositor() {
-  return mNativeLayerRoot && gfx::gfxVars::UseWebRenderCompositor();
+  return mNativeLayerRoot && gfx::gfxVars::UseWebRenderCompositor() &&
+         StaticPrefs::gfx_webrender_picture_caching();
 }
 
 uint32_t RenderCompositorOGL::GetMaxUpdateRects() {
   if (ShouldUseNativeCompositor() &&
       StaticPrefs::gfx_webrender_compositor_max_update_rects_AtStartup() > 0) {
     return 1;
   }
   return 0;