Bug 1006198 - Apply Y flip if necessary to tiled Textures in ImageHost. r=nical
authorMatt Woodrow <mwoodrow@mozilla.com>
Tue, 13 May 2014 14:20:26 +1200
changeset 182817 98a354e678c2ae67b5f1284ba8380d60be5d9a15
parent 182816 a34412a9f079d9b00800b56fb2ffc60a384e96cc
child 182818 d60356c63c4fd7563361aff218bd5d2d2f7543a8
push id43403
push usermwoodrow@mozilla.com
push dateTue, 13 May 2014 09:12:47 +0000
treeherdermozilla-inbound@0ff7d00bb9fb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnical
bugs1006198
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 1006198 - Apply Y flip if necessary to tiled Textures in ImageHost. r=nical
gfx/layers/composite/ImageHost.cpp
--- a/gfx/layers/composite/ImageHost.cpp
+++ b/gfx/layers/composite/ImageHost.cpp
@@ -119,16 +119,20 @@ ImageHost::Composite(EffectChain& aEffec
         rect = rect.Intersect(pictureRect);
         effect->mTextureCoords = Rect(Float(rect.x - tileRect.x)/ tileRect.width,
                                       Float(rect.y - tileRect.y) / tileRect.height,
                                       Float(rect.width) / tileRect.width,
                                       Float(rect.height) / tileRect.height);
       } else {
         effect->mTextureCoords = Rect(0, 0, 1, 1);
       }
+      if (mFrontBuffer->GetFlags() & TextureFlags::NEEDS_Y_FLIP) {
+        effect->mTextureCoords.y = effect->mTextureCoords.YMost();
+        effect->mTextureCoords.height = -effect->mTextureCoords.height;
+      }
       GetCompositor()->DrawQuad(rect, aClipRect, aEffectChain,
                                 aOpacity, aTransform);
       GetCompositor()->DrawDiagnostics(DiagnosticFlags::IMAGE | DiagnosticFlags::BIGIMAGE,
                                        rect, aClipRect, aTransform, mFlashCounter);
     } while (it->NextTile());
     it->EndBigImageIteration();
     // layer border
     GetCompositor()->DrawDiagnostics(DiagnosticFlags::IMAGE,