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

Side by Side 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Rob Buis <buis@kde.org>
4 * Copyright (C) 2006 Alexander Kellett <lypanov@kde.org> 4 * Copyright (C) 2006 Alexander Kellett <lypanov@kde.org>
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 // A previous loader update may have failed to actually fetch the image if 188 // A previous loader update may have failed to actually fetch the image if
189 // the document was inactive. In that case, force a re-update (but don't 189 // the document was inactive. In that case, force a re-update (but don't
190 // clear previous errors). 190 // clear previous errors).
191 if (!imageLoader().image()) 191 if (!imageLoader().image())
192 imageLoader().updateFromElement(); 192 imageLoader().updateFromElement();
193 } 193 }
194 194
195 return InsertionDone; 195 return InsertionDone;
196 } 196 }
197 197
198 FloatSize SVGImageElement::sourceDefaultObjectSize() {
199 if (layoutObject())
200 return toLayoutSVGImage(layoutObject())->objectBoundingBox().size();
201 SVGLengthContext lengthContext(this);
202 return FloatSize(m_width->currentValue()->value(lengthContext),
203 m_height->currentValue()->value(lengthContext));
204 }
205
198 const AtomicString SVGImageElement::imageSourceURL() const { 206 const AtomicString SVGImageElement::imageSourceURL() const {
199 return AtomicString(hrefString()); 207 return AtomicString(hrefString());
200 } 208 }
201 209
202 void SVGImageElement::didMoveToNewDocument(Document& oldDocument) { 210 void SVGImageElement::didMoveToNewDocument(Document& oldDocument) {
203 imageLoader().elementDidMoveToNewDocument(); 211 imageLoader().elementDidMoveToNewDocument();
204 SVGGraphicsElement::didMoveToNewDocument(oldDocument); 212 SVGGraphicsElement::didMoveToNewDocument(oldDocument);
205 } 213 }
206 214
207 } // namespace blink 215 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698