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

Unified Diff: third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.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/modules/canvas2d/BaseRenderingContext2D.cpp
diff --git a/third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp b/third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp
index 51e317a4e5270974951d52035fefa1f2015d9036..15e865745b7ee9132c25e35a5e7ef7e1f0fef61d 100644
--- a/third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp
+++ b/third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp
@@ -15,6 +15,7 @@
#include "core/html/HTMLVideoElement.h"
#include "core/html/ImageData.h"
#include "core/offscreencanvas/OffscreenCanvas.h"
+#include "core/svg/SVGImageElement.h"
#include "modules/canvas2d/CanvasGradient.h"
#include "modules/canvas2d/CanvasPattern.h"
#include "modules/canvas2d/CanvasStyle.h"
@@ -913,6 +914,8 @@ static inline CanvasImageSource* toImageSourceInternal(
video->videoWillBeDrawnToCanvas();
return video;
}
+ if (value.isSVGImageElement())
+ return value.getAsSVGImageElement();
if (value.isHTMLCanvasElement())
return value.getAsHTMLCanvasElement();
if (value.isImageBitmap()) {

Powered by Google App Engine
This is Rietveld 408576698