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

Unified Diff: third_party/WebKit/Source/core/svg/SVGImageElement.cpp

Issue 2723093004: Adds SVGImageElement as a CanvasImageSource (Closed)
Patch Set: Moved from circle to rect, to avoid aliasing Created 3 years, 9 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/SVGImageElement.cpp
diff --git a/third_party/WebKit/Source/core/svg/SVGImageElement.cpp b/third_party/WebKit/Source/core/svg/SVGImageElement.cpp
index 99f083eae214dccc6296751d4afa06fb065655c7..41784f57f801f07cb0544398f7c727e2fec8eaab 100644
--- a/third_party/WebKit/Source/core/svg/SVGImageElement.cpp
+++ b/third_party/WebKit/Source/core/svg/SVGImageElement.cpp
@@ -195,6 +195,14 @@ Node::InsertionNotificationRequest SVGImageElement::insertedInto(
return InsertionDone;
}
+FloatSize SVGImageElement::sourceDefaultObjectSize() {
+ if (layoutObject())
+ return toLayoutSVGImage(layoutObject())->objectBoundingBox().size();
+ SVGLengthContext lengthContext(this);
+ return FloatSize(m_width->currentValue()->value(lengthContext),
+ m_height->currentValue()->value(lengthContext));
+}
+
const AtomicString SVGImageElement::imageSourceURL() const {
return AtomicString(hrefString());
}

Powered by Google App Engine
This is Rietveld 408576698