Bug 1265824 - Guard client storage stuff behind a pref r?mattwoodrow draft
authorDoug Thayer <dothayer@mozilla.com>
Fri, 22 Jun 2018 11:10:41 -0700
changeset 821699 94842d63285801705881e545b7564b6c883f0639
parent 821698 80109e11edb05ec9a061d8b97db7f4cf567b3a7d
child 821700 76bd11fe76b670609d977a6644a1096fcfa468cb
push id117175
push userbmo:dothayer@mozilla.com
push dateMon, 23 Jul 2018 21:16:55 +0000
reviewersmattwoodrow
bugs1265824
milestone63.0a1
Bug 1265824 - Guard client storage stuff behind a pref r?mattwoodrow MozReview-Commit-ID: DjKhtMDJ91C
gfx/layers/opengl/CompositorOGL.cpp
gfx/thebes/gfxPrefs.h
--- a/gfx/layers/opengl/CompositorOGL.cpp
+++ b/gfx/layers/opengl/CompositorOGL.cpp
@@ -2018,16 +2018,20 @@ CompositorOGL::GetTemporaryTexture(GLenu
     mTexturePool = new PerUnitTexturePoolOGL(gl());
   }
   return mTexturePool->GetTexture(aTarget, aUnit);
 }
 
 bool
 CompositorOGL::SupportsTextureDirectMapping()
 {
+  if (!gfxPrefs::AllowTextureDirectMapping()) {
+    return false;
+  }
+
   if (mGLContext) {
     mGLContext->MakeCurrent();
     return mGLContext->IsExtensionSupported(gl::GLContext::APPLE_client_storage) &&
            mGLContext->IsExtensionSupported(gl::GLContext::APPLE_texture_range);
   }
 
   return false;
 }
--- a/gfx/thebes/gfxPrefs.h
+++ b/gfx/thebes/gfxPrefs.h
@@ -508,16 +508,22 @@ private:
 
   // 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);
 
+#if defined(RELEASE_OR_BETA)
+  DECL_GFX_PREF(Once, "gfx.allow-texture-direct-mapping",      AllowTextureDirectMapping, bool, false);
+#else
+  DECL_GFX_PREF(Once, "gfx.allow-texture-direct-mapping",      AllowTextureDirectMapping, bool, true);
+#endif
+
   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);
   DECL_GFX_PREF(Once, "gfx.webrender.all.qualified",           WebRenderAllQualified, 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.dl.dump-parent",          WebRenderDLDumpParent, bool, false);