OLD | NEW |
---|---|
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 Loading... | |
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(563858/xlai): implement commit() on worker thread; currently, do | |
danakj
2016/09/02 21:51:00
Sorry it should be
TODO(xlai): Stuff to do etc, s
xlai (Olivia)
2016/09/02 23:41:28
Done.
| |
51 // nothing for worker thread. | |
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 Loading... | |
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 } |
OLD | NEW |