Bug 973892 - Fix b2g bustage on a CLOSED TREE.
☠☠ backed out by 995cfd42e045 ☠ ☠
authorNicolas Silva <nical@mozilla.com>
Wed, 19 Feb 2014 20:00:50 +0100
changeset 169900 a6831c02d8cf365d1e6f6a650020e326fca4f0fd
parent 169899 5ab4f97a322086eb7c3b11e9e88cf2bcad058fe8
child 169901 26487075b6ecf767ad8fd6a65c2d71e4bd6f1879
push id270
push userpvanderbeken@mozilla.com
push dateThu, 06 Mar 2014 09:24:21 +0000
bugs973892
milestone30.0a1
Bug 973892 - Fix b2g bustage on a CLOSED TREE.
gfx/layers/GrallocImages.cpp
gfx/layers/client/CompositableClient.cpp
gfx/layers/opengl/GrallocTextureClient.cpp
gfx/layers/opengl/GrallocTextureClient.h
--- a/gfx/layers/GrallocImages.cpp
+++ b/gfx/layers/GrallocImages.cpp
@@ -391,16 +391,16 @@ GrallocImage::GetTextureClient(Composita
       return nullptr;
     }
     const SurfaceDescriptorGralloc& desc = sd.get_SurfaceDescriptorGralloc();
     TextureFlags flags = desc.external() ? TEXTURE_DEALLOCATE_CLIENT : 0;
     if (desc.isRBSwapped()) {
       flags |= TEXTURE_RB_SWAPPED;
     }
     GrallocBufferActor* actor = static_cast<GrallocBufferActor*>(desc.bufferChild());
-    mTextureClient = new GrallocTextureClientOGL(actor, mSize, flags);
+    mTextureClient = new GrallocTextureClientOGL(actor, mSize, gfx::BackendType::NONE, flags);
     mTextureClient->SetGraphicBufferLocked(mGraphicBufferLocked);
   }
   return mTextureClient;
 }
 
 } // namespace layers
 } // namespace mozilla
--- a/gfx/layers/client/CompositableClient.cpp
+++ b/gfx/layers/client/CompositableClient.cpp
@@ -291,17 +291,18 @@ CompositableClient::CreateTextureClientF
   {
     result = new TextureClientX11(aFormat, aTextureFlags);
   }
 #endif
 #endif
 
 #ifdef MOZ_WIDGET_GONK
   if (!DisableGralloc(aFormat)) {
-    result = new GrallocTextureClientOGL(this, aFormat, aTextureFlags);
+    result = new GrallocTextureClientOGL(this, aFormat, aMoz2DBackend,
+                                         aTextureFlags);
   }
 #endif
 
   // Can't do any better than a buffer texture client.
   if (!result) {
     result = CreateBufferTextureClient(aFormat, aTextureFlags, aMoz2DBackend);
   }
 
--- a/gfx/layers/opengl/GrallocTextureClient.cpp
+++ b/gfx/layers/opengl/GrallocTextureClient.cpp
@@ -88,39 +88,42 @@ GrallocTextureClientOGL::DropTextureData
     mGrallocActor = nullptr;
     mGraphicBuffer = nullptr;
     return result;
   }
 }
 
 GrallocTextureClientOGL::GrallocTextureClientOGL(GrallocBufferActor* aActor,
                                                  gfx::IntSize aSize,
+                                                 gfx::BackendType aMoz2DBackend,
                                                  TextureFlags aFlags)
-: BufferTextureClient(nullptr, gfx::SurfaceFormat::UNKNOWN, aFlags)
+: BufferTextureClient(nullptr, gfx::SurfaceFormat::UNKNOWN, aMoz2DBackend, aFlags)
 , mAllocator(nullptr)
 , mMappedBuffer(nullptr)
 {
   InitWith(aActor, aSize);
   MOZ_COUNT_CTOR(GrallocTextureClientOGL);
 }
 
 GrallocTextureClientOGL::GrallocTextureClientOGL(CompositableClient* aCompositable,
                                                  gfx::SurfaceFormat aFormat,
+                                                 gfx::BackendType aMoz2DBackend,
                                                  TextureFlags aFlags)
-: BufferTextureClient(aCompositable, aFormat, aFlags)
+: BufferTextureClient(aCompositable, aFormat, aMoz2DBackend, aFlags)
 , mAllocator(nullptr)
 , mMappedBuffer(nullptr)
 {
   MOZ_COUNT_CTOR(GrallocTextureClientOGL);
 }
 
 GrallocTextureClientOGL::GrallocTextureClientOGL(ISurfaceAllocator* aAllocator,
                                                  gfx::SurfaceFormat aFormat,
+                                                 gfx::BackendType aMoz2DBackend,
                                                  TextureFlags aFlags)
-: BufferTextureClient(nullptr, aFormat, aFlags)
+: BufferTextureClient(nullptr, aFormat, aMoz2DBackend, aFlags)
 , mAllocator(aAllocator)
 , mMappedBuffer(nullptr)
 {
   MOZ_COUNT_CTOR(GrallocTextureClientOGL);
 }
 
 GrallocTextureClientOGL::~GrallocTextureClientOGL()
 {
--- a/gfx/layers/opengl/GrallocTextureClient.h
+++ b/gfx/layers/opengl/GrallocTextureClient.h
@@ -30,22 +30,25 @@ class GraphicBufferLocked;
  *
  * This is only used in Firefox OS
  */
 class GrallocTextureClientOGL : public BufferTextureClient
 {
 public:
   GrallocTextureClientOGL(GrallocBufferActor* aActor,
                           gfx::IntSize aSize,
+                          gfx::BackendType aMoz2DMackend,
                           TextureFlags aFlags = TEXTURE_FLAGS_DEFAULT);
   GrallocTextureClientOGL(CompositableClient* aCompositable,
                           gfx::SurfaceFormat aFormat,
+                          gfx::BackendType aMoz2DMackend,
                           TextureFlags aFlags = TEXTURE_FLAGS_DEFAULT);
   GrallocTextureClientOGL(ISurfaceAllocator* aAllocator,
                           gfx::SurfaceFormat aFormat,
+                          gfx::BackendType aMoz2DMackend,
                           TextureFlags aFlags = TEXTURE_FLAGS_DEFAULT);
 
   ~GrallocTextureClientOGL();
 
   virtual bool Lock(OpenMode aMode) MOZ_OVERRIDE;
 
   virtual void Unlock() MOZ_OVERRIDE;