Bug 895116: Lock the mask texture before compositing with BasicCompositor r=bas
authorDavid Zbarsky <dzbarsky@gmail.com>
Mon, 29 Jul 2013 16:04:09 -0700
changeset 140476 922e7f0eb53afd00b790e0c9fb3e21453725977a
parent 140475 a0868fe02c2a6b597086aa33ddb9ff495404af74
child 140477 505ad1c506cc6ac3f258b9f1d4284eda4026b1e4
push id1970
push userryanvm@gmail.com
push dateTue, 30 Jul 2013 17:12:32 +0000
treeherderfx-team@72240998c094 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbas
bugs895116
milestone25.0a1
Bug 895116: Lock the mask texture before compositing with BasicCompositor r=bas
gfx/layers/basic/BasicCompositor.cpp
--- a/gfx/layers/basic/BasicCompositor.cpp
+++ b/gfx/layers/basic/BasicCompositor.cpp
@@ -286,16 +286,17 @@ BasicCompositor::DrawQuad(const gfx::Rec
   Matrix newTransform = aTransform.As2D();
   newTransform.Translate(-aOffset.x, -aOffset.y);
   dest->SetTransform(newTransform);
 
   RefPtr<SourceSurface> sourceMask;
   Matrix maskTransform;
   if (aEffectChain.mSecondaryEffects[EFFECT_MASK]) {
     EffectMask *effectMask = static_cast<EffectMask*>(aEffectChain.mSecondaryEffects[EFFECT_MASK].get());
+    static_cast<DeprecatedTextureHost*>(effectMask->mMaskTexture)->Lock();
     sourceMask = effectMask->mMaskTexture->AsSourceBasic()->GetSurface();
     MOZ_ASSERT(effectMask->mMaskTransform.Is2D(), "How did we end up with a 3D transform here?!");
     MOZ_ASSERT(!effectMask->mIs3D);
     maskTransform = effectMask->mMaskTransform.As2D();
   }
 
   switch (aEffectChain.mPrimaryEffect->mType) {
     case EFFECT_SOLID_COLOR: {
@@ -343,16 +344,21 @@ BasicCompositor::DrawQuad(const gfx::Rec
       break;
     }
     default: {
       NS_RUNTIMEABORT("Invalid effect type!");
       break;
     }
   }
 
+  if (aEffectChain.mSecondaryEffects[EFFECT_MASK]) {
+    EffectMask *effectMask = static_cast<EffectMask*>(aEffectChain.mSecondaryEffects[EFFECT_MASK].get());
+    static_cast<DeprecatedTextureHost*>(effectMask->mMaskTexture)->Unlock();
+  }
+
   dest->SetTransform(oldTransform);
   dest->PopClip();
 }
 
 void
 BasicCompositor::BeginFrame(const gfx::Rect *aClipRectIn,
                             const gfxMatrix& aTransform,
                             const gfx::Rect& aRenderBounds,