mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-24 21:58:06 +00:00
Bug 1122631 - Fix wrong logic in DrawTargetTiled::CopySurface. r=jrmuizel
This commit is contained in:
parent
8f0bbe8884
commit
682d07b50e
@ -178,19 +178,14 @@ DrawTargetTiled::CopySurface(SourceSurface *aSurface,
|
||||
const IntRect &aSourceRect,
|
||||
const IntPoint &aDestination)
|
||||
{
|
||||
// CopySurface ignores the transform, account for that here.
|
||||
for (size_t i = 0; i < mTiles.size(); i++) {
|
||||
IntRect src = aSourceRect;
|
||||
src.x += mTiles[i].mTileOrigin.x;
|
||||
src.width -= mTiles[i].mTileOrigin.x;
|
||||
src.y = mTiles[i].mTileOrigin.y;
|
||||
src.height -= mTiles[i].mTileOrigin.y;
|
||||
|
||||
if (src.width <= 0 || src.height <= 0) {
|
||||
IntPoint tileOrigin = mTiles[i].mTileOrigin;
|
||||
IntSize tileSize = mTiles[i].mDrawTarget->GetSize();
|
||||
if (!IntRect(aDestination, aSourceRect.Size()).Intersects(IntRect(tileOrigin, tileSize))) {
|
||||
continue;
|
||||
}
|
||||
|
||||
mTiles[i].mDrawTarget->CopySurface(aSurface, src, aDestination);
|
||||
// CopySurface ignores the transform, account for that here.
|
||||
mTiles[i].mDrawTarget->CopySurface(aSurface, aSourceRect, aDestination - tileOrigin);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user