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

Unified Diff: third_party/WebKit/Source/modules/canvas/HTMLCanvasElementModule.cpp

Issue 1836283002: Implement HTMLCanvasElement's transferControlToOffscreen (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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/canvas/HTMLCanvasElementModule.cpp
diff --git a/third_party/WebKit/Source/modules/canvas/HTMLCanvasElementModule.cpp b/third_party/WebKit/Source/modules/canvas/HTMLCanvasElementModule.cpp
index 09f992f2cf01f9b7b3e18e551a876c3e9d171f26..160307ad0acca6be77d8ae8fc19a90684652a995 100644
--- a/third_party/WebKit/Source/modules/canvas/HTMLCanvasElementModule.cpp
+++ b/third_party/WebKit/Source/modules/canvas/HTMLCanvasElementModule.cpp
@@ -17,4 +17,15 @@ void HTMLCanvasElementModule::getContext(HTMLCanvasElement& canvas, const String
}
}
+OffscreenCanvas* HTMLCanvasElementModule::transferControlToOffscreen(HTMLCanvasElement& canvas, ExceptionState& exceptionState)
+{
+ if (canvas.renderingContext()) {
+ exceptionState.throwDOMException(InvalidStateError, "Cannot transfer control from a canvas with context");
Justin Novosad 2016/03/29 20:32:58 "with context" -> "that has a rendering context."
xidachen 2016/03/30 13:32:30 Done.
+ return nullptr;
+ }
+ OffscreenCanvas* offscreenCanvas = OffscreenCanvas::create(canvas.width(), canvas.height());
+ offscreenCanvas->setOriginatedCanvas(&canvas);
Justin Novosad 2016/03/29 20:32:58 Please add a unit test for this. Test should crea
xidachen 2016/03/30 13:32:30 Done.
+ return offscreenCanvas;
+}
+
}

Powered by Google App Engine
This is Rietveld 408576698