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

Unified Diff: third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp

Issue 2723093004: Adds SVGImageElement as a CanvasImageSource (Closed)
Patch Set: y Created 3 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/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 c57036dd49aab7e91a0c1e0bac266a63448e9e4d..3c9e5c7c9fa1e21e1f0341d346f99885f83259d6 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"
@@ -932,6 +933,10 @@ static inline CanvasImageSource* toImageSourceInternal(
}
return value.getAsOffscreenCanvas();
}
+ if (value.isSVGImageElement()) {
+ SVGImageElement* image = value.getAsSVGImageElement();
+ return image;
+ }
NOTREACHED();
return nullptr;
}

Powered by Google App Engine
This is Rietveld 408576698