Index: third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp |
diff --git a/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp b/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp |
index 04e8195e089bea7d5ee2afa1b9a2a414a97d1c22..1dde804a5e7eb1f5d5f6d623b4340da3c9233479 100644 |
--- a/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp |
+++ b/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp |
@@ -218,16 +218,7 @@ void SVGImage::drawForContainer(SkCanvas* canvas, const SkPaint& paint, const Fl |
PassRefPtr<SkImage> SVGImage::imageForCurrentFrame() |
{ |
- if (!m_page) |
- return nullptr; |
- |
- SkPictureRecorder recorder; |
- SkCanvas* canvas = recorder.beginRecording(width(), height()); |
- drawForContainer(canvas, SkPaint(), FloatSize(size()), 1, rect(), rect(), KURL()); |
- RefPtr<SkPicture> picture = adoptRef(recorder.endRecording()); |
- |
- return adoptRef( |
- SkImage::NewFromPicture(picture.get(), SkISize::Make(width(), height()), nullptr, nullptr)); |
+ return imageForCurrentFrameForContainer(KURL()); |
} |
void SVGImage::drawPatternForContainer(GraphicsContext* context, const FloatSize containerSize, |
@@ -267,6 +258,20 @@ void SVGImage::drawPatternForContainer(GraphicsContext* context, const FloatSize |
context->drawRect(dstRect, paint); |
} |
+PassRefPtr<SkImage> SVGImage::imageForCurrentFrameForContainer(const KURL& url) |
+{ |
+ if (!m_page) |
+ return nullptr; |
+ |
+ SkPictureRecorder recorder; |
+ SkCanvas* canvas = recorder.beginRecording(width(), height()); |
+ drawForContainer(canvas, SkPaint(), FloatSize(size()), 1, rect(), rect(), url); |
+ RefPtr<SkPicture> picture = adoptRef(recorder.endRecording()); |
+ |
+ return adoptRef( |
+ SkImage::NewFromPicture(picture.get(), SkISize::Make(width(), height()), nullptr, nullptr)); |
+} |
+ |
static bool drawNeedsLayer(const SkPaint& paint) |
{ |
if (SkColorGetA(paint.getColor()) < 255) |