Bug 1186911 - Fix progressive paint when using tiled-drawtarget. r=nical

The commit for bug 1176077 did not correctly handle the code path for
when both progressive paint and tiled-drawtarget are enabled. This
fixes it.
This commit is contained in:
Jamie Nicol 2015-07-24 10:42:12 +01:00
parent a232c81262
commit aadf5f2161
2 changed files with 13 additions and 8 deletions

View File

@ -953,7 +953,7 @@ ClientTiledLayerBuffer::PaintThebes(const nsIntRegion& aNewValidRegion,
js::ProfileEntry::Category::GRAPHICS);
mNewValidRegion = aNewValidRegion;
Update(aNewValidRegion, aPaintRegion);
Update(aNewValidRegion, aPaintRegion, aDirtyRegion);
#ifdef GFX_TILEDLAYER_PREF_WARNINGS
if (PR_IntervalNow() - start > 10) {
@ -1049,7 +1049,8 @@ void PadDrawTargetOutFromRegion(RefPtr<DrawTarget> drawTarget, nsIntRegion &regi
}
void
ClientTiledLayerBuffer::PostValidate(const nsIntRegion& aPaintRegion)
ClientTiledLayerBuffer::PostValidate(const nsIntRegion& aPaintRegion,
const nsIntRegion& aDirtyRegion)
{
if (gfxPrefs::TiledDrawTargetEnabled() && mMoz2DTiles.size() > 0) {
gfx::TileSet tileset;
@ -1065,7 +1066,7 @@ ClientTiledLayerBuffer::PostValidate(const nsIntRegion& aPaintRegion)
ctx->SetMatrix(
ctx->CurrentMatrix().Scale(mResolution, mResolution).Translate(ThebesPoint(-mTilingOrigin)));
mCallback(mPaintedLayer, ctx, aPaintRegion, aPaintRegion,
mCallback(mPaintedLayer, ctx, aPaintRegion, aDirtyRegion,
DrawRegionClip::DRAW, nsIntRegion(), mCallbackData);
mMoz2DTiles.clear();
// Reset:
@ -1095,7 +1096,8 @@ ClientTiledLayerBuffer::UnlockTile(TileClient& aTile)
}
void ClientTiledLayerBuffer::Update(const nsIntRegion& newValidRegion,
const nsIntRegion& aPaintRegion)
const nsIntRegion& aPaintRegion,
const nsIntRegion& aDirtyRegion)
{
const IntSize scaledTileSize = GetScaledTileSize();
const gfx::IntRect newBounds = newValidRegion.GetBounds();
@ -1148,7 +1150,7 @@ void ClientTiledLayerBuffer::Update(const nsIntRegion& newValidRegion,
}
}
PostValidate(aPaintRegion);
PostValidate(aPaintRegion, aDirtyRegion);
for (TileClient& tile : mRetainedTiles) {
UnlockTile(tile);

View File

@ -419,7 +419,9 @@ public:
LayerManager::DrawPaintedLayerCallback aCallback,
void* aCallbackData);
void Update(const nsIntRegion& aNewValidRegion, const nsIntRegion& aPaintRegion);
void Update(const nsIntRegion& aNewValidRegion,
const nsIntRegion& aPaintRegion,
const nsIntRegion& aDirtyRegion);
void ReadLock();
@ -449,7 +451,7 @@ public:
return;
}
Update(nsIntRegion(), nsIntRegion());
Update(nsIntRegion(), nsIntRegion(), nsIntRegion());
mResolution = aResolution;
}
@ -467,7 +469,8 @@ protected:
const nsIntPoint& aTileRect,
const nsIntRegion& dirtyRect);
void PostValidate(const nsIntRegion& aPaintRegion);
void PostValidate(const nsIntRegion& aPaintRegion,
const nsIntRegion& aDirtyRegion);
void UnlockTile(TileClient& aTile);