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

Unified Diff: third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp

Issue 2328463004: Implement WebGL's commit on the main thread (Closed)
Patch Set: written as a gpu pixel test Created 4 years, 3 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/webgl/WebGLRenderingContextBase.cpp
diff --git a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
index fa89b61043337bef639bdfac0d77ade1298c2e68..6ce5018bad77b1e254497d56dff3e0a7f68f9a3f 100644
--- a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
+++ b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
@@ -649,6 +649,20 @@ ImageBitmap* WebGLRenderingContextBase::transferToImageBitmapBase()
return ImageBitmap::create(drawingBuffer()->transferToStaticBitmapImage());
}
+void WebGLRenderingContextBase::commit(ExceptionState& exceptionState)
+{
+ if (!getOffscreenCanvas())
Justin Novosad 2016/09/09 19:10:50 I think this case should throw as well.
xidachen 2016/09/09 19:23:41 Done.
+ return;
+ // no HTMLCanvas associated, thrown InvalidStateError
+ if (getOffscreenCanvas()->getAssociatedCanvasId() == -1) {
+ exceptionState.throwDOMException(InvalidStateError, "The OffscreenCanvas has no associated HTMLCanvasElement, abort commit().");
+ return;
+ }
+ if (!drawingBuffer())
+ return;
+ getOffscreenCanvas()->getOrCreateFrameDispatcher()->dispatchFrame(drawingBuffer()->transferToStaticBitmapImage());
+}
+
PassRefPtr<Image> WebGLRenderingContextBase::getImage(AccelerationHint hint, SnapshotReason reason) const
{
if (!drawingBuffer())

Powered by Google App Engine
This is Rietveld 408576698