Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(42)

Unified Diff: third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp

Issue 1767633002: Support canvas size as default object size (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@pass-default-object-size
Patch Set: Save image size on stack Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 aaccff3a99f7516d92b398f7d484a43982bbf4e2..f566ad8fc0254dd67929948c13d1a8cbbf0fbe04 100644
--- a/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp
+++ b/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp
@@ -261,7 +261,7 @@ void SVGImage::drawForContainer(SkCanvas* canvas, const SkPaint& paint, const Fl
PassRefPtr<SkImage> SVGImage::imageForCurrentFrame()
{
- return imageForCurrentFrameForContainer(KURL());
+ return imageForCurrentFrameForContainer(KURL(), FloatSize(size()));
}
void SVGImage::drawPatternForContainer(GraphicsContext& context, const FloatSize containerSize,
@@ -301,14 +301,14 @@ void SVGImage::drawPatternForContainer(GraphicsContext& context, const FloatSize
context.drawRect(dstRect, paint);
}
-PassRefPtr<SkImage> SVGImage::imageForCurrentFrameForContainer(const KURL& url)
+PassRefPtr<SkImage> SVGImage::imageForCurrentFrameForContainer(const KURL& url, const FloatSize& containerSize)
{
if (!m_page)
return nullptr;
SkPictureRecorder recorder;
SkCanvas* canvas = recorder.beginRecording(width(), height());
- drawForContainer(canvas, SkPaint(), FloatSize(size()), 1, rect(), rect(), url);
+ drawForContainer(canvas, SkPaint(), containerSize, 1, rect(), rect(), url);
RefPtr<SkPicture> picture = adoptRef(recorder.endRecording());
return adoptRef(

Powered by Google App Engine
This is Rietveld 408576698