mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-11-09 21:00:42 +02:00
Bug 826093 (Part 4) - Use ClippedImage instead of ExtractFrame for border-image. r=bz
This commit is contained in:
parent
71c2c2b7ae
commit
1620097925
1 changed files with 3 additions and 13 deletions
|
|
@ -3316,20 +3316,10 @@ DrawBorderImageComponent(nsRenderingContext& aRenderingContext,
|
||||||
if (aFill.IsEmpty() || aSrc.IsEmpty())
|
if (aFill.IsEmpty() || aSrc.IsEmpty())
|
||||||
return;
|
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;
|
nsCOMPtr<imgIContainer> subImage;
|
||||||
if (animated || (subImage = aStyleBorder.GetSubImage(aIndex)) == 0) {
|
if ((subImage = aStyleBorder.GetSubImage(aIndex)) == nullptr) {
|
||||||
if (NS_FAILED(aImage->ExtractFrame(imgIContainer::FRAME_CURRENT, aSrc,
|
subImage = ImageOps::Clip(aImage, aSrc);
|
||||||
imgIContainer::FLAG_SYNC_DECODE,
|
aStyleBorder.SetSubImage(aIndex, subImage);
|
||||||
getter_AddRefs(subImage))))
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (!animated)
|
|
||||||
aStyleBorder.SetSubImage(aIndex, subImage);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
gfxPattern::GraphicsFilter graphicsFilter =
|
gfxPattern::GraphicsFilter graphicsFilter =
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue