Bug 1071256 - Fix OS X tiling codepath to deal with low-precision tiles. r=mattwoodrow
authorKartikaya Gupta <kgupta@mozilla.com>
Mon, 22 Sep 2014 17:52:21 -0400
changeset 206597 3201d7690fc57d09d0eb465912e0912a8fc0a17c
parent 206596 034dc794140bf5c43b909fd7749648cb4424ccf6
child 206598 2c42e54473e29289a994f88dc04b20745aefc387
push idunknown
push userunknown
push dateunknown
reviewersmattwoodrow
bugs1071256
milestone35.0a1
Bug 1071256 - Fix OS X tiling codepath to deal with low-precision tiles. r=mattwoodrow
gfx/layers/client/TiledContentClient.cpp
--- a/gfx/layers/client/TiledContentClient.cpp
+++ b/gfx/layers/client/TiledContentClient.cpp
@@ -1060,16 +1060,18 @@ ClientTiledLayerBuffer::PostValidate(con
   if (gfxPrefs::TiledDrawTargetEnabled() && mMoz2DTiles.size() > 0) {
     gfx::TileSet tileset;
     tileset.mTiles = &mMoz2DTiles[0];
     tileset.mTileCount = mMoz2DTiles.size();
     RefPtr<DrawTarget> drawTarget = gfx::Factory::CreateTiledDrawTarget(tileset);
     drawTarget->SetTransform(Matrix());
 
     RefPtr<gfxContext> ctx = new gfxContext(drawTarget);
+    ctx->SetMatrix(
+      ctx->CurrentMatrix().Scale(mResolution, mResolution));
 
     mCallback(mThebesLayer, ctx, aPaintRegion, DrawRegionClip::DRAW, nsIntRegion(), mCallbackData);
     mMoz2DTiles.clear();
   }
 }
 
 void
 ClientTiledLayerBuffer::UnlockTile(TileClient aTile)
@@ -1177,17 +1179,17 @@ ClientTiledLayerBuffer::ValidateTile(Til
     RefPtr<DrawTarget> dt = backBuffer->BorrowDrawTarget();
     RefPtr<DrawTarget> dtOnWhite;
     if (backBufferOnWhite) {
       dtOnWhite = backBufferOnWhite->BorrowDrawTarget();
       moz2DTile.mDrawTarget = Factory::CreateDualDrawTarget(dt, dtOnWhite);
     } else {
       moz2DTile.mDrawTarget = dt;
     }
-    moz2DTile.mTileOrigin = gfx::IntPoint(aTileOrigin.x, aTileOrigin.y);
+    moz2DTile.mTileOrigin = gfx::IntPoint(aTileOrigin.x * mResolution, aTileOrigin.y * mResolution);
     if (!dt || (backBufferOnWhite && !dtOnWhite)) {
       aTile.DiscardFrontBuffer();
       return aTile;
     }
 
     mMoz2DTiles.push_back(moz2DTile);
 
     nsIntRegionRectIterator it(aDirtyRegion);