Bug 1207326 - Part 1: Correct projection clipping rectangle. r=matt.woodrow, a=lizzard
authorKearwood (Kip) Gilbert <kgilbert@mozilla.com>
Fri, 25 Sep 2015 13:43:52 -0700
changeset 296262 c4cd3a110e3fd8048698ff11b1a8d3f98dcb950f
parent 296261 35b3e4d35d2910419ec5971c8b8771b38f197cb4
child 296263 0def0c7e4d67a59f37bd1de96c92e83d59efddd5
push id5245
push userraliiev@mozilla.com
push dateThu, 29 Oct 2015 11:30:51 +0000
treeherdermozilla-beta@dac831dc1bd0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmatt, lizzard
bugs1207326
milestone43.0a2
Bug 1207326 - Part 1: Correct projection clipping rectangle. r=matt.woodrow, a=lizzard - The clipping rectangle used in a call to Matrix4x4::TransformAndClipRect within CompositorOGL::DrawQuad is now using mRenderBound, with an offset applied consistent with use later in the function.
gfx/layers/opengl/CompositorOGL.cpp
--- a/gfx/layers/opengl/CompositorOGL.cpp
+++ b/gfx/layers/opengl/CompositorOGL.cpp
@@ -983,23 +983,27 @@ CompositorOGL::DrawQuad(const Rect& aRec
   MOZ_ASSERT(mFrameInProgress, "frame not started");
   MOZ_ASSERT(mCurrentRenderTarget, "No destination");
 
   if (aEffectChain.mPrimaryEffect->mType == EffectTypes::VR_DISTORTION) {
     DrawVRDistortion(aRect, aClipRect, aEffectChain, aOpacity, aTransform);
     return;
   }
 
+  IntPoint offset = mCurrentRenderTarget->GetOrigin();
+  Rect renderBound = mRenderBound;
+  renderBound.IntersectRect(renderBound, aClipRect);
+  renderBound.MoveBy(offset);
+
+  Rect destRect = aTransform.TransformAndClipBounds(aRect, renderBound);
+
   // XXX: This doesn't handle 3D transforms. It also doesn't handled rotated
   //      quads. Fix me.
-  Rect destRect = aTransform.TransformAndClipBounds(aRect, aClipRect);
   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;
   }