Backed out changeset d1b4c5874493 (bug 1265112)
authorSebastian Hengst <archaeopteryx@coole-files.de>
Sat, 30 Apr 2016 00:49:45 +0200
changeset 295583 1f97dbd1e199c8dc8b6ea350ae96f4b2cea416fb
parent 295582 d1b4c58744933a651ff6ff4e88726c8b31c0f059
child 295584 99d3b89fb9552b518906f7753e1d0ed42233c83d
push id19015
push usercbook@mozilla.com
push dateMon, 02 May 2016 09:39:23 +0000
treeherderfx-team@2080375bc69d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1265112
milestone49.0a1
backs outd1b4c58744933a651ff6ff4e88726c8b31c0f059
Backed out changeset d1b4c5874493 (bug 1265112)
gfx/layers/opengl/CompositorOGL.cpp
--- a/gfx/layers/opengl/CompositorOGL.cpp
+++ b/gfx/layers/opengl/CompositorOGL.cpp
@@ -1087,17 +1087,16 @@ CompositorOGL::DrawQuad(const Rect& aRec
     color.g *= opacity;
     color.b *= opacity;
     color.a = opacity;
 
     // We can fold opacity into the color, so no need to consider it further.
     aOpacity = 1.f;
   }
 
-  bool createdMixBlendBackdropTexture = false;
   GLuint mixBlendBackdrop = 0;
   gfx::CompositionOp blendMode = gfx::CompositionOp::OP_OVER;
 
   if (aEffectChain.mSecondaryEffects[EffectTypes::BLEND_MODE]) {
     EffectBlendMode *blendEffect =
       static_cast<EffectBlendMode*>(aEffectChain.mSecondaryEffects[EffectTypes::BLEND_MODE].get());
     blendMode = blendEffect->mBlendMode;
   }
@@ -1120,29 +1119,19 @@ CompositorOGL::DrawQuad(const Rect& aRec
   if (colorMatrix) {
       EffectColorMatrix* effectColorMatrix =
         static_cast<EffectColorMatrix*>(aEffectChain.mSecondaryEffects[EffectTypes::COLOR_MATRIX].get());
       program->SetColorMatrix(effectColorMatrix->mColorMatrix);
   }
 
   if (BlendOpIsMixBlendMode(blendMode)) {
     gfx::Matrix4x4 backdropTransform;
+    gfx::IntRect rect = ComputeBackdropCopyRect(aRect, aClipRect, aTransform, &backdropTransform);
 
-    if (gl()->IsExtensionSupported(GLContext::NV_texture_barrier)) {
-      // The NV_texture_barrier extension lets us read directly from the
-      // backbuffer. Let's do that.
-      // We need to tell OpenGL about this, so that it can make sure everything
-      // on the GPU is happening in the right order.
-      gl()->fTextureBarrier();
-      mixBlendBackdrop = mCurrentRenderTarget->GetTextureHandle();
-    } else {
-      gfx::IntRect rect = ComputeBackdropCopyRect(aRect, aClipRect, aTransform, &backdropTransform);
-      mixBlendBackdrop = CreateTexture(rect, true, mCurrentRenderTarget->GetFBO());
-      createdMixBlendBackdropTexture = true;
-    }
+    mixBlendBackdrop = CreateTexture(rect, true, mCurrentRenderTarget->GetFBO());
     program->SetBackdropTransform(backdropTransform);
   }
 
   program->SetRenderOffset(offset.x, offset.y);
   LayerScope::SetRenderOffset(offset.x, offset.y);
 
   if (aOpacity != 1.f)
     program->SetLayerOpacity(aOpacity);
@@ -1449,17 +1438,17 @@ CompositorOGL::DrawQuad(const Rect& aRec
     MOZ_ASSERT(false, "Unhandled effect type");
     break;
   }
 
   if (didSetBlendMode) {
     gl()->fBlendFuncSeparate(LOCAL_GL_ONE, LOCAL_GL_ONE_MINUS_SRC_ALPHA,
                              LOCAL_GL_ONE, LOCAL_GL_ONE_MINUS_SRC_ALPHA);
   }
-  if (createdMixBlendBackdropTexture) {
+  if (mixBlendBackdrop) {
     gl()->fDeleteTextures(1, &mixBlendBackdrop);
   }
 
   // in case rendering has used some other GL context
   MakeCurrent();
   LayerScope::DrawEnd(mGLContext, aEffectChain, aRect.width, aRect.height);
 }