Bug 1064855 - Handle zero area destination rects during image snapping. r=roc

--HG--
extra : rebase_source : 8b0c9cb123577fc19359036f466a12aab7148443
This commit is contained in:
Seth Fowler 2014-09-16 16:18:49 -07:00
parent 394683aacb
commit 1cc3af62ea
2 changed files with 5 additions and 1 deletions

View File

@ -3664,7 +3664,7 @@ RasterImage::OptimalImageSizeForDest(const gfxSize& aDest, uint32_t aWhichFrame,
aDest.height >= 0 || ceil(aDest.height) <= INT32_MAX,
"Unexpected destination size");
if (mSize.IsEmpty()) {
if (mSize.IsEmpty() || aDest.IsEmpty()) {
return nsIntSize(0, 0);
}

View File

@ -5091,6 +5091,10 @@ ComputeSnappedImageDrawingParameters(gfxContext* aCtx,
NSAppUnitsToIntPixels(dest.height * destScale.height,
aAppUnitsPerDevPixel));
if (snappedDest.IsEmpty()) {
return SnappedImageDrawingParameters();
}
nsIntSize intImageSize =
aImage->OptimalImageSizeForDest(snappedDest,
imgIContainer::FRAME_CURRENT,