Bug 756601 - Fix a few small layers refactoring bugs. r=Bas
authorMatt Woodrow <mwoodrow@mozilla.com>
Fri, 10 May 2013 09:02:49 +1200
changeset 142388 b5a96574e077543ff1cbbe9500fc1f08e91b11b8
parent 142387 74ff7b69c638b51c49c98fba397b5700292ff582
child 142389 01443bd094b967c6287ac2a9d2fff10d662fa954
push id2579
push userakeybl@mozilla.com
push dateMon, 24 Jun 2013 18:52:47 +0000
treeherdermozilla-beta@b69b7de8a05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersBas
bugs756601
milestone23.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 756601 - Fix a few small layers refactoring bugs. r=Bas
gfx/layers/client/ClientImageLayer.cpp
gfx/layers/client/ClientLayerManager.h
gfx/layers/client/ContentClient.cpp
--- a/gfx/layers/client/ClientImageLayer.cpp
+++ b/gfx/layers/client/ClientImageLayer.cpp
@@ -109,22 +109,26 @@ ClientImageLayer::RenderLayer()
   }
 
   if (!mContainer) {
      return;
   }
 
   if (!mImageClient ||
       !mImageClient->UpdateImage(mContainer, GetContentFlags())) {
-    mImageClient = ImageClient::CreateImageClient(GetImageClientType(),
+    CompositableType type = GetImageClientType();
+    if (type == BUFFER_UNKNOWN) {
+      return;
+    }
+    mImageClient = ImageClient::CreateImageClient(type,
                                                   ClientManager(),
                                                   mForceSingleTile
                                                     ? ForceSingleTile
                                                     : 0);
-    if (GetImageClientType() == BUFFER_BRIDGE) {
+    if (type == BUFFER_BRIDGE) {
       static_cast<ImageClientBridge*>(mImageClient.get())->SetLayer(this);
     }
 
     if (!mImageClient) {
       return;
     }
     if (HasShadow() && !mContainer->IsAsync()) {
       mImageClient->Connect();
--- a/gfx/layers/client/ClientLayerManager.h
+++ b/gfx/layers/client/ClientLayerManager.h
@@ -33,16 +33,19 @@ public:
   virtual void BeginTransaction();
   virtual bool EndEmptyTransaction(EndTransactionFlags aFlags = END_DEFAULT);
   virtual void EndTransaction(DrawThebesLayerCallback aCallback,
                               void* aCallbackData,
                               EndTransactionFlags aFlags = END_DEFAULT);
 
   virtual LayersBackend GetBackendType() { return LAYERS_CLIENT; }
   virtual void GetBackendName(nsAString& name);
+#ifdef MOZ_LAYERS_HAVE_LOG
+  virtual const char* Name() const { return "Client"; }
+#endif // MOZ_LAYERS_HAVE_LOG
 
   virtual void SetRoot(Layer* aLayer);
 
   virtual void Mutated(Layer* aLayer);
 
   virtual already_AddRefed<ThebesLayer> CreateThebesLayer();
   virtual already_AddRefed<ContainerLayer> CreateContainerLayer();
   virtual already_AddRefed<ImageLayer> CreateImageLayer();
--- a/gfx/layers/client/ContentClient.cpp
+++ b/gfx/layers/client/ContentClient.cpp
@@ -184,17 +184,18 @@ ContentClientRemote::CreateBuffer(Conten
                                   const nsIntRect& aRect,
                                   uint32_t aFlags,
                                   gfxASurface** aWhiteSurface)
 {
   BuildTextureClients(aType, aRect, aFlags);
 
   nsRefPtr<gfxASurface> ret = mTextureClient->LockSurface();
   if (aFlags & BUFFER_COMPONENT_ALPHA) {
-    *aWhiteSurface = mTextureClientOnWhite->LockSurface();
+    nsRefPtr<gfxASurface> retWhite = mTextureClientOnWhite->LockSurface();
+    *aWhiteSurface = retWhite.forget().get();
   }
   return ret.forget();
 }
 
 nsIntRegion
 ContentClientRemote::GetUpdatedRegion(const nsIntRegion& aRegionToDraw,
                                       const nsIntRegion& aVisibleRegion,
                                       bool aDidSelfCopy)