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

Side by Side Diff: third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.cpp

Issue 2328463004: Implement WebGL's commit on the main thread (Closed)
Patch Set: fix compile error on win_dbg 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.h" 5 #include "modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.h"
6 6
7 #include "bindings/modules/v8/OffscreenCanvasRenderingContext2DOrWebGLRenderingC ontextOrWebGL2RenderingContext.h" 7 #include "bindings/modules/v8/OffscreenCanvasRenderingContext2DOrWebGLRenderingC ontextOrWebGL2RenderingContext.h"
8 #include "core/frame/ImageBitmap.h" 8 #include "core/frame/ImageBitmap.h"
9 #include "core/frame/Settings.h" 9 #include "core/frame/Settings.h"
10 #include "core/workers/WorkerGlobalScope.h" 10 #include "core/workers/WorkerGlobalScope.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 46
47 void OffscreenCanvasRenderingContext2D::commit(ExceptionState& exceptionState) 47 void OffscreenCanvasRenderingContext2D::commit(ExceptionState& exceptionState)
48 { 48 {
49 if (getOffscreenCanvas()->getAssociatedCanvasId() < 0) { 49 if (getOffscreenCanvas()->getAssociatedCanvasId() < 0) {
50 // If an OffscreenCanvas has no associated canvas Id, it indicates that 50 // If an OffscreenCanvas has no associated canvas Id, it indicates that
51 // it is not an OffscreenCanvas created by transfering control from html 51 // it is not an OffscreenCanvas created by transfering control from html
52 // canvas. 52 // canvas.
53 exceptionState.throwDOMException(InvalidStateError, "Commit() was called on a context whose OffscreenCanvas is not associated with a canvas element."); 53 exceptionState.throwDOMException(InvalidStateError, "Commit() was called on a context whose OffscreenCanvas is not associated with a canvas element.");
54 return; 54 return;
55 } 55 }
56 getOffscreenCanvas()->getOrCreateFrameDispatcher()->dispatchFrame(); 56 getOffscreenCanvas()->getOrCreateFrameDispatcher()->dispatchFrame(nullptr);
57 } 57 }
58 58
59 // BaseRenderingContext2D implementation 59 // BaseRenderingContext2D implementation
60 bool OffscreenCanvasRenderingContext2D::originClean() const 60 bool OffscreenCanvasRenderingContext2D::originClean() const
61 { 61 {
62 return getOffscreenCanvas()->originClean(); 62 return getOffscreenCanvas()->originClean();
63 } 63 }
64 64
65 void OffscreenCanvasRenderingContext2D::setOriginTainted() 65 void OffscreenCanvasRenderingContext2D::setOriginTainted()
66 { 66 {
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 bool OffscreenCanvasRenderingContext2D::isContextLost() const 210 bool OffscreenCanvasRenderingContext2D::isContextLost() const
211 { 211 {
212 return false; 212 return false;
213 } 213 }
214 214
215 bool OffscreenCanvasRenderingContext2D::isPaintable() const 215 bool OffscreenCanvasRenderingContext2D::isPaintable() const
216 { 216 {
217 return this->imageBuffer(); 217 return this->imageBuffer();
218 } 218 }
219 } 219 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698