Bug 826093 (Part 4) - Use ClippedImage instead of ExtractFrame for border-image. r=bz

This commit is contained in:
Seth Fowler 2013-03-26 16:29:13 -07:00
parent 39d87d0383
commit 66aa6729ef

View File

@ -3316,19 +3316,9 @@ DrawBorderImageComponent(nsRenderingContext& aRenderingContext,
if (aFill.IsEmpty() || aSrc.IsEmpty())
return;
// Don't bother trying to cache sub images if the border image is animated
// We can only sucessfully call GetAnimated() if we are fully decoded, so default to true
bool animated = true;
aImage->GetAnimated(&animated);
nsCOMPtr<imgIContainer> subImage;
if (animated || (subImage = aStyleBorder.GetSubImage(aIndex)) == 0) {
if (NS_FAILED(aImage->ExtractFrame(imgIContainer::FRAME_CURRENT, aSrc,
imgIContainer::FLAG_SYNC_DECODE,
getter_AddRefs(subImage))))
return;
if (!animated)
if ((subImage = aStyleBorder.GetSubImage(aIndex)) == nullptr) {
subImage = ImageOps::Clip(aImage, aSrc);
aStyleBorder.SetSubImage(aIndex, subImage);
}