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

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

Issue 2294383002: Make OffscreenCanvas a member of CanvasImageSource (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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/CanvasRenderingContext2D.cpp
diff --git a/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp b/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp
index 75de18b5922262c6f05804b5852b72ff231cf1b8..88cf799a97bbc597e27950e7dfdaf177d325f443 100644
--- a/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp
+++ b/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp
@@ -585,6 +585,13 @@ ImageBuffer* CanvasRenderingContext2D::imageBuffer() const
return canvas()->buffer();
}
+PassRefPtr<Image> blink::CanvasRenderingContext2D::getImage(SnapshotReason reason) const
+{
+ if (!hasImageBuffer())
+ return nullptr;
+ return canvas()->buffer()->newImageSnapshot(PreferAcceleration, reason);
+}
+
bool CanvasRenderingContext2D::parseColorOrCurrentColor(Color& color, const String& colorString) const
{
return ::blink::parseColorOrCurrentColor(color, colorString, canvas());

Powered by Google App Engine
This is Rietveld 408576698