Bug 1017427 - Fix CompositorOGL RenderOffset not offsetting clipping rect. r=nical
☠☠ backed out by d778b67c4e9e ☠ ☠
authorChris Lord <chrislord.net@gmail.com>
Wed, 04 Jun 2014 13:26:57 +0100
changeset 206904 07a74e6e53b2829feff8205aa7630854ef239d3c
parent 206903 0f4eb14fcbd82aa5535d6f5371376b0655b05bb8
child 206905 2d06b7c9cc5bd0f1441598190e16d75e56043ebb
push id494
push userraliiev@mozilla.com
push dateMon, 25 Aug 2014 18:42:16 +0000
treeherdermozilla-release@a3cc3e46b571 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnical
bugs1017427
milestone32.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 1017427 - Fix CompositorOGL RenderOffset not offsetting clipping rect. r=nical
gfx/layers/opengl/CompositorOGL.cpp
--- a/gfx/layers/opengl/CompositorOGL.cpp
+++ b/gfx/layers/opengl/CompositorOGL.cpp
@@ -986,18 +986,20 @@ CompositorOGL::DrawQuad(const Rect& aRec
                         Float aOpacity,
                         const gfx::Matrix4x4 &aTransform)
 {
   PROFILER_LABEL("CompositorOGL", "DrawQuad",
     js::ProfileEntry::Category::GRAPHICS);
 
   MOZ_ASSERT(mFrameInProgress, "frame not started");
 
+  IntPoint offset = mCurrentRenderTarget->GetOrigin();
   IntRect intClipRect;
   aClipRect.ToIntRect(&intClipRect);
+  intClipRect.MoveBy(-offset.x, -offset.y);
 
   gl()->fScissor(intClipRect.x, FlipY(intClipRect.y + intClipRect.height),
                  intClipRect.width, intClipRect.height);
 
   LayerScope::SendEffectChain(mGLContext, aEffectChain,
                               aRect.width, aRect.height);
 
   MaskType maskType;
@@ -1061,17 +1063,16 @@ CompositorOGL::DrawQuad(const Rect& aRec
   }
 
   ShaderConfigOGL config = GetShaderConfigFor(aEffectChain.mPrimaryEffect, maskType, blendMode);
   config.SetOpacity(aOpacity != 1.f);
   ShaderProgramOGL *program = GetShaderProgramFor(config);
   program->Activate();
   program->SetProjectionMatrix(mProjMatrix);
   program->SetLayerTransform(aTransform);
-  IntPoint offset = mCurrentRenderTarget->GetOrigin();
   program->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());
     TextureSourceOGL* source = texturedEffect->mTexture->AsSourceOGL();
     // This is used by IOSurface that use 0,0...w,h coordinate rather then 0,0..1,1.