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

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: rebase 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 d814994ba1b81b080c15bc276c6b3fcfea28093f..7ed92b6519451a28632b62f57b4895c3ebea6a3e 100644
--- a/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp
+++ b/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp
@@ -584,6 +584,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