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..7988132932fe846834bb47e377a9b4324e3b9a8f 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 that has a rendering context."); |
+ return nullptr; |
+ } |
+ OffscreenCanvas* offscreenCanvas = OffscreenCanvas::create(canvas.width(), canvas.height()); |
+ offscreenCanvas->setAssociatedCanvas(&canvas); |
+ return offscreenCanvas; |
+} |
+ |
} |