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

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

Issue 2316643003: Reland Submit Compositor Frame from OffscreenCanvas on main (Closed)
Patch Set: 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 26 matching lines...) Expand all
37 if (workerSettings && workerSettings->disableReadingFromCanvas()) 37 if (workerSettings && workerSettings->disableReadingFromCanvas())
38 canvas->setDisableReadingFromCanvasTrue(); 38 canvas->setDisableReadingFromCanvasTrue();
39 } 39 }
40 40
41 DEFINE_TRACE(OffscreenCanvasRenderingContext2D) 41 DEFINE_TRACE(OffscreenCanvasRenderingContext2D)
42 { 42 {
43 CanvasRenderingContext::trace(visitor); 43 CanvasRenderingContext::trace(visitor);
44 BaseRenderingContext2D::trace(visitor); 44 BaseRenderingContext2D::trace(visitor);
45 } 45 }
46 46
47 void OffscreenCanvasRenderingContext2D::commit(ExecutionContext* executionContex t)
48 {
49 if (executionContext->isWorkerGlobalScope()) {
50 // TODO(xlai): implement commit() on worker thread; currently, do
51 // nothing for worker thread. See crbug.com/563858.
52 return;
53 }
54 getOffscreenCanvas()->getOrCreateFrameDispatcher()->dispatchFrame();
55 }
56
47 // BaseRenderingContext2D implementation 57 // BaseRenderingContext2D implementation
48 bool OffscreenCanvasRenderingContext2D::originClean() const 58 bool OffscreenCanvasRenderingContext2D::originClean() const
49 { 59 {
50 return getOffscreenCanvas()->originClean(); 60 return getOffscreenCanvas()->originClean();
51 } 61 }
52 62
53 void OffscreenCanvasRenderingContext2D::setOriginTainted() 63 void OffscreenCanvasRenderingContext2D::setOriginTainted()
54 { 64 {
55 return getOffscreenCanvas()->setOriginTainted(); 65 return getOffscreenCanvas()->setOriginTainted();
56 } 66 }
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 bool OffscreenCanvasRenderingContext2D::isContextLost() const 211 bool OffscreenCanvasRenderingContext2D::isContextLost() const
202 { 212 {
203 return false; 213 return false;
204 } 214 }
205 215
206 bool OffscreenCanvasRenderingContext2D::isPaintable() const 216 bool OffscreenCanvasRenderingContext2D::isPaintable() const
207 { 217 {
208 return this->imageBuffer(); 218 return this->imageBuffer();
209 } 219 }
210 } 220 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698