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

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

Issue 1732563007: [NOT FOR COMMIT] Pass defaultObjectSize to get image size (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 b1141564d2424c0a8a97b91a158ab1d1b222863c..85aec357da64d3bc804e66464d66a1db247dd15d 100644
--- a/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp
+++ b/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp
@@ -293,12 +293,12 @@ PassRefPtr<SkImage> SVGImage::imageForCurrentFrameForContainer(const KURL& url)
return nullptr;
SkPictureRecorder recorder;
- SkCanvas* canvas = recorder.beginRecording(width(), height());
- drawForContainer(canvas, SkPaint(), FloatSize(size()), 1, rect(), rect(), url);
+ SkCanvas* canvas = recorder.beginRecording(defaultConcreteObjectSizeWidth(), defaultConcreteObjectSizeHeight());
+ drawForContainer(canvas, SkPaint(), FloatSize(defaultConcreteObjectSize()), 1, defaultConcreteObjectSizeRect(), defaultConcreteObjectSizeRect(), url);
RefPtr<SkPicture> picture = adoptRef(recorder.endRecording());
return adoptRef(
- SkImage::NewFromPicture(picture.get(), SkISize::Make(width(), height()), nullptr, nullptr));
+ SkImage::NewFromPicture(picture.get(), SkISize::Make(defaultConcreteObjectSizeWidth(), defaultConcreteObjectSizeHeight()), nullptr, nullptr));
}
static bool drawNeedsLayer(const SkPaint& paint)
@@ -541,6 +541,11 @@ bool SVGImage::dataChanged(bool allDataReceived)
return m_page;
}
+IntSize SVGImage::concreteObjectSize(const FloatSize& defaultObjectSize) const
+{
+ return roundedIntSize(calculateConcreteObjectSize(defaultObjectSize));
+}
+
String SVGImage::filenameExtension() const
{
return "svg";

Powered by Google App Engine
This is Rietveld 408576698