Bug 962041 - Fix component apha with the new ContentClient/Host. r=mattwoodrow
authorNicolas Silva <nical@mozilla.com>
Thu, 23 Jan 2014 15:14:58 +0100
changeset 180855 4ba9cf2966f6d1cbc3a26f92ab594d76c5f33638
parent 180854 d97cb0a0873a4843919f1d3a26bd58d6ccb740b9
child 180856 26984019ff59372e30681d3c1f692df87a5064ae
push id3343
push userffxbld
push dateMon, 17 Mar 2014 21:55:32 +0000
treeherdermozilla-beta@2f7d3415f79f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattwoodrow
bugs962041
milestone29.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 962041 - Fix component apha with the new ContentClient/Host. r=mattwoodrow
gfx/layers/client/ContentClient.cpp
gfx/layers/composite/ContentHost.cpp
--- a/gfx/layers/client/ContentClient.cpp
+++ b/gfx/layers/client/ContentClient.cpp
@@ -276,16 +276,19 @@ ContentClientRemoteBuffer::Updated(const
                                    bool aDidSelfCopy)
 {
   nsIntRegion updatedRegion = GetUpdatedRegion(aRegionToDraw,
                                                aVisibleRegion,
                                                aDidSelfCopy);
 
   MOZ_ASSERT(mTextureClient);
   mForwarder->UseTexture(this, mTextureClient);
+  if (mTextureClientOnWhite) {
+    mForwarder->UseTexture(this, mTextureClientOnWhite);
+  }
   mForwarder->UpdateTextureRegion(this,
                                   ThebesBufferData(BufferRect(),
                                                    BufferRotation()),
                                   updatedRegion);
 }
 
 void
 ContentClientRemoteBuffer::SwapBuffers(const nsIntRegion& aFrontUpdatedRegion)
--- a/gfx/layers/composite/ContentHost.cpp
+++ b/gfx/layers/composite/ContentHost.cpp
@@ -122,17 +122,17 @@ ContentHostBase::Composite(EffectChain& 
   }
 
   TileIterator* tileIter = source->AsTileIterator();
   TileIterator* iterOnWhite = nullptr;
   if (tileIter) {
     tileIter->BeginTileIteration();
   }
 
-  if (mTextureHostOnWhite) {
+  if (sourceOnWhite) {
     iterOnWhite = sourceOnWhite->AsTileIterator();
     MOZ_ASSERT(!tileIter || tileIter->GetTileCount() == iterOnWhite->GetTileCount(),
                "Tile count mismatch on component alpha texture");
     if (iterOnWhite) {
       iterOnWhite->BeginTileIteration();
     }
   }
 
@@ -216,21 +216,19 @@ ContentHostBase::Composite(EffectChain& 
   GetCompositor()->DrawDiagnostics(diagnostics, *aVisibleRegion, aClipRect, aTransform);
 }
 
 
 void
 ContentHostBase::UseTextureHost(TextureHost* aTexture)
 {
   if (aTexture->GetFlags() & TEXTURE_ON_WHITE) {
-    mTextureHost = nullptr;
     mTextureHostOnWhite = aTexture;
     mTextureHostOnWhite->SetCompositor(GetCompositor());
   } else {
-    mTextureHostOnWhite = nullptr;
     mTextureHost = aTexture;
     mTextureHost->SetCompositor(GetCompositor());
   }
 }
 
 void
 ContentHostBase::SetCompositor(Compositor* aCompositor)
 {