Chromium Code Reviews| 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..e89db0777892b39cdb65680483d63fa70bb55ef2 100644 |
| --- a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp |
| +++ b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp |
| @@ -649,6 +649,22 @@ ImageBitmap* WebGLRenderingContextBase::transferToImageBitmapBase() |
| return ImageBitmap::create(drawingBuffer()->transferToStaticBitmapImage()); |
| } |
| +void WebGLRenderingContextBase::commit(ExceptionState& exceptionState) |
| +{ |
| + if (!getOffscreenCanvas()) { |
| + exceptionState.throwDOMException(InvalidStateError, "No OffscreenCanvas exist, abort commit()."); |
|
xlai (Olivia)
2016/09/09 20:30:41
Could you add a sub-test to OffscreenCanvas-commit
Ken Russell (switch to Gerrit)
2016/09/09 21:38:17
Also, nit: exist -> exists
|
| + return; |
| + } |
| + // no HTMLCanvas associated, thrown InvalidStateError |
| + if (getOffscreenCanvas()->getAssociatedCanvasId() == -1) { |
| + exceptionState.throwDOMException(InvalidStateError, "The OffscreenCanvas has no associated HTMLCanvasElement, abort commit()."); |
|
xlai (Olivia)
2016/09/09 20:30:41
Could you change the exception message to "Commit(
|
| + return; |
| + } |
| + if (!drawingBuffer()) |
| + return; |
| + getOffscreenCanvas()->getOrCreateFrameDispatcher()->dispatchFrame(drawingBuffer()->transferToStaticBitmapImage()); |
| +} |
| + |
| PassRefPtr<Image> WebGLRenderingContextBase::getImage(AccelerationHint hint, SnapshotReason reason) const |
| { |
| if (!drawingBuffer()) |