Bug 1192192 - Fix quad culling method. r=nical, a=sledru
authorJerry Shih <hshih@mozilla.com>
Thu, 13 Aug 2015 08:22:58 -0700
changeset 289045 355d8a2719ac1b94e73863df675c8c8c1bb2fa78
parent 289044 0f8540c2a9d9ce0058e2107746e697c5f04bdd71
child 289046 2f6ef224bcb6421b0d5a98455b2bbb8ca0503ea2
push id5067
push userraliiev@mozilla.com
push dateMon, 21 Sep 2015 14:04:52 +0000
treeherdermozilla-beta@14221ffe5b2f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnical, sledru
bugs1192192
milestone42.0a2
Bug 1192192 - Fix quad culling method. r=nical, a=sledru
gfx/layers/opengl/CompositorOGL.cpp
--- a/gfx/layers/opengl/CompositorOGL.cpp
+++ b/gfx/layers/opengl/CompositorOGL.cpp
@@ -981,19 +981,22 @@ CompositorOGL::DrawQuad(const Rect& aRec
     return;
   }
 
   // XXX: This doesn't handle 3D transforms. It also doesn't handled rotated
   //      quads. Fix me.
   Rect destRect = aTransform.TransformBounds(aRect);
   mPixelsFilled += destRect.width * destRect.height;
 
+  IntPoint offset = mCurrentRenderTarget->GetOrigin();
+
   // Do a simple culling if this rect is out of target buffer.
   // Inflate a small size to avoid some numerical imprecision issue.
   destRect.Inflate(1, 1);
+  destRect.MoveBy(-offset);
   if (!mRenderBound.Intersects(destRect)) {
     return;
   }
 
   LayerScope::DrawBegin();
 
   Rect clipRect = aClipRect;
   // aClipRect is in destination coordinate space (after all
@@ -1083,17 +1086,16 @@ CompositorOGL::DrawQuad(const Rect& aRec
   program->SetLayerTransform(aTransform);
   LayerScope::SetLayerTransform(aTransform);
   if (colorMatrix) {
       EffectColorMatrix* effectColorMatrix =
         static_cast<EffectColorMatrix*>(aEffectChain.mSecondaryEffects[EffectTypes::COLOR_MATRIX].get());
       program->SetColorMatrix(effectColorMatrix->mColorMatrix);
   }
 
-  IntPoint offset = mCurrentRenderTarget->GetOrigin();
   program->SetRenderOffset(offset.x, offset.y);
   LayerScope::SetRenderOffset(offset.x, offset.y);
 
   if (aOpacity != 1.f)
     program->SetLayerOpacity(aOpacity);
   if (config.mFeatures & ENABLE_TEXTURE_RECT) {
     TexturedEffect* texturedEffect =
         static_cast<TexturedEffect*>(aEffectChain.mPrimaryEffect.get());