From 296bc1c59b9aa625ec389338dcdaec8c50682b96 Mon Sep 17 00:00:00 2001 From: Seth Fowler Date: Tue, 26 Mar 2013 11:56:46 -0700 Subject: [PATCH] Bug 826093 (Part 4) - Use ClippedImage instead of ExtractFrame for border-image. r=bz --- layout/base/nsCSSRendering.cpp | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/layout/base/nsCSSRendering.cpp b/layout/base/nsCSSRendering.cpp index ec0445e168d..c0c63b5bf9e 100644 --- a/layout/base/nsCSSRendering.cpp +++ b/layout/base/nsCSSRendering.cpp @@ -3316,20 +3316,10 @@ 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 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) - aStyleBorder.SetSubImage(aIndex, subImage); + if ((subImage = aStyleBorder.GetSubImage(aIndex)) == nullptr) { + subImage = ImageOps::Clip(aImage, aSrc); + aStyleBorder.SetSubImage(aIndex, subImage); } gfxPattern::GraphicsFilter graphicsFilter =