Bug 1078337 - Use the clipped image in DrawSingleImage if one was requested. r=seth
--- a/layout/base/nsLayoutUtils.cpp
+++ b/layout/base/nsLayoutUtils.cpp
@@ -5328,25 +5328,23 @@ nsLayoutUtils::DrawSingleImage(nsRenderi
image = ImageOps::Clip(aImage, subRect);
} else {
nscoord appUnitsPerCSSPixel = nsDeviceContext::AppUnitsPerCSSPixel();
source.SizeTo(imageSize.width*appUnitsPerCSSPixel,
imageSize.height*appUnitsPerCSSPixel);
image = aImage;
}
- nsRect dest = nsLayoutUtils::GetWholeImageDestination(imageSize, source,
- aDest);
// Ensure that only a single image tile is drawn. If aSourceArea extends
// outside the image bounds, we want to honor the aSourceArea-to-aDest
// transform but we don't want to actually tile the image.
nsRect fill;
- fill.IntersectRect(aDest, dest);
- return DrawImageInternal(aRenderingContext, aPresContext, aImage,
- aGraphicsFilter, dest, fill, fill.TopLeft(),
+ fill.IntersectRect(aDest, aDest);
+ return DrawImageInternal(aRenderingContext, aPresContext, image,
+ aGraphicsFilter, aDest, fill, fill.TopLeft(),
aDirty, aSVGContext, aImageFlags);
}
/* static */ void
nsLayoutUtils::ComputeSizeForDrawing(imgIContainer *aImage,
nsIntSize& aImageSize, /*outparam*/
nsSize& aIntrinsicRatio, /*outparam*/
bool& aGotWidth, /*outparam*/