Bug 1130681. Part 2: Backout bug 1118876 for android reftest failures. r=jrmuizel

This commit is contained in:
Mason Chang 2015-02-13 16:36:45 +08:00
parent 1264802e7c
commit 9b60b2ec81
3 changed files with 23 additions and 34 deletions

View File

@ -558,15 +558,15 @@ TiledLayerBuffer<Derived, Tile>::Update(const nsIntRegion& newValidRegion,
x += width;
}
mRetainedTiles = newRetainedTiles;
AsDerived().PostValidate(aPaintRegion);
for (unsigned int i = 0; i < mRetainedTiles.Length(); ++i) {
AsDerived().UnlockTile(mRetainedTiles[i]);
for (unsigned int i = 0; i < newRetainedTiles.Length(); ++i) {
AsDerived().UnlockTile(newRetainedTiles[i]);
}
// At this point, oldTileCount should be zero
MOZ_ASSERT(oldTileCount == 0, "Failed to release old tiles");
mRetainedTiles = newRetainedTiles;
mValidRegion = newValidRegion;
mPaintedRegion.Or(mPaintedRegion, aPaintRegion);
}

View File

@ -517,7 +517,6 @@ TileClient::TileClient(const TileClient& o)
mManager = o.mManager;
mInvalidFront = o.mInvalidFront;
mInvalidBack = o.mInvalidBack;
mOrigin = o.mOrigin;
}
TileClient&
@ -537,7 +536,6 @@ TileClient::operator=(const TileClient& o)
mManager = o.mManager;
mInvalidFront = o.mInvalidFront;
mInvalidBack = o.mInvalidBack;
mOrigin = o.mOrigin;
return *this;
}
@ -1058,31 +1056,6 @@ ClientTiledLayerBuffer::PostValidate(const nsIntRegion& aPaintRegion)
mTilingOrigin = IntPoint(std::numeric_limits<int32_t>::max(),
std::numeric_limits<int32_t>::max());
}
for (size_t i = 0; i < mRetainedTiles.Length(); ++i) {
TileClient& tile = mRetainedTiles[i];
if (tile.mFrontBuffer && tile.mFrontBuffer->IsLocked()) {
// Only worry about padding when not doing low-res because it simplifies
// the math and the artifacts won't be noticable
// Edge padding prevents sampling artifacts when compositing.
if (mResolution == 1) {
nsIntRect unscaledTile = nsIntRect(tile.mOrigin.x, tile.mOrigin.y,
GetTileSize().width, GetTileSize().height);
nsIntRegion tileValidRegion = GetValidRegion();
tileValidRegion.OrWith(aPaintRegion);
// We only need to pad out if the tile has area that's not valid
if (!tileValidRegion.Contains(unscaledTile)) {
tileValidRegion = tileValidRegion.Intersect(unscaledTile);
// translate the region into tile space and pad
tileValidRegion.MoveBy(-nsIntPoint(unscaledTile.x, unscaledTile.y));
RefPtr<DrawTarget> drawTarget = tile.mFrontBuffer->BorrowDrawTarget();
PadDrawTargetOutFromRegion(drawTarget, tileValidRegion);
}
}
}
}
}
void
@ -1171,8 +1144,6 @@ ClientTiledLayerBuffer::ValidateTile(TileClient aTile,
}
}
aTile.mOrigin = gfx::ToIntPoint(aTileOrigin);
if (usingTiledDrawTarget) {
if (createdTextureClient) {
if (!mCompositableClient->AddTextureClient(backBuffer)) {
@ -1276,6 +1247,26 @@ ClientTiledLayerBuffer::ValidateTile(TileClient aTile,
aTile.mInvalidFront.Or(aTile.mInvalidFront, nsIntRect(copyTarget.x, copyTarget.y, copyRect.width, copyRect.height));
}
// only worry about padding when not doing low-res
// because it simplifies the math and the artifacts
// won't be noticable
if (mResolution == 1) {
nsIntRect unscaledTile = nsIntRect(aTileOrigin.x,
aTileOrigin.y,
GetTileSize().width,
GetTileSize().height);
nsIntRegion tileValidRegion = GetValidRegion();
tileValidRegion.Or(tileValidRegion, aDirtyRegion);
// We only need to pad out if the tile has area that's not valid
if (!tileValidRegion.Contains(unscaledTile)) {
tileValidRegion = tileValidRegion.Intersect(unscaledTile);
// translate the region into tile space and pad
tileValidRegion.MoveBy(-nsIntPoint(unscaledTile.x, unscaledTile.y));
PadDrawTargetOutFromRegion(drawTarget, tileValidRegion);
}
}
// The new buffer is now validated, remove the dirty region from it.
aTile.mInvalidBack.SubOut(offsetScaledDirtyRegion);

View File

@ -274,8 +274,6 @@ struct TileClient
nsIntRegion mInvalidBack;
nsExpirationState mExpirationState;
gfx::IntPoint mOrigin;
private:
// Copies dirty pixels from the front buffer into the back buffer,
// and records the copied region in aAddPaintedRegion.