Bug 792663: Temporarily require opting in to allocating cross-process xlib surfaces. r=karl
authorChris Jones <jones.chris.g@gmail.com>
Mon, 24 Sep 2012 14:54:01 -0700
changeset 108054 cf7824a17b2b835911490c77cd764e54cc08f7e0
parent 108053 ab3709368125a9aefb112c7aa2a4a6a3532b65eb
child 108055 780a4b8551e61eb945c759c44598c40b4e51bb7f
push id82
push usershu@rfrn.org
push dateFri, 05 Oct 2012 13:20:22 +0000
reviewerskarl
bugs792663
milestone18.0a1
Bug 792663: Temporarily require opting in to allocating cross-process xlib surfaces. r=karl
gfx/layers/ipc/ShadowLayerUtilsX11.cpp
--- a/gfx/layers/ipc/ShadowLayerUtilsX11.cpp
+++ b/gfx/layers/ipc/ShadowLayerUtilsX11.cpp
@@ -89,16 +89,19 @@ SurfaceDescriptorX11::OpenForeign() cons
 }
 
 bool
 ShadowLayerForwarder::PlatformAllocBuffer(const gfxIntSize& aSize,
                                           gfxASurface::gfxContentType aContent,
                                           uint32_t aCaps,
                                           SurfaceDescriptor* aBuffer)
 {
+  if (!PR_GetEnv("MOZ_LAYERS_ENABLE_XLIB_SURFACES")) {
+      return false;
+  }
   if (!UsingXCompositing()) {
     // If we're not using X compositing, we're probably compositing on
     // the client side, in which case X surfaces would just slow
     // things down.  Use Shmem instead.
     return false;
   }
   if (MAP_AS_IMAGE_SURFACE & aCaps) {
     // We can't efficiently map pixmaps as gfxImageSurface, in