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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 // If an OffscreenCanvas has no associated canvas Id, it indicates that | 53 // If an OffscreenCanvas has no associated canvas Id, it indicates that |
54 // it is not an OffscreenCanvas created by transfering control from html | 54 // it is not an OffscreenCanvas created by transfering control from html |
55 // canvas. | 55 // canvas. |
56 exceptionState.throwDOMException(InvalidStateError, | 56 exceptionState.throwDOMException(InvalidStateError, |
57 "Commit() was called on a context whose " | 57 "Commit() was called on a context whose " |
58 "OffscreenCanvas is not associated with a " | 58 "OffscreenCanvas is not associated with a " |
59 "canvas element."); | 59 "canvas element."); |
60 return; | 60 return; |
61 } | 61 } |
62 double commitStartTime = WTF::monotonicallyIncreasingTime(); | 62 double commitStartTime = WTF::monotonicallyIncreasingTime(); |
63 RefPtr<StaticBitmapImage> image = this->transferToStaticBitmapImage(); | 63 RefPtr<StaticBitmapImage> image = transferToStaticBitmapImage(); |
64 getOffscreenCanvas()->getOrCreateFrameDispatcher()->dispatchFrame( | 64 getOffscreenCanvas()->getOrCreateFrameDispatcher()->dispatchFrame( |
65 std::move(image), commitStartTime); | 65 std::move(image), commitStartTime); |
66 } | 66 } |
67 | 67 |
68 // BaseRenderingContext2D implementation | 68 // BaseRenderingContext2D implementation |
69 bool OffscreenCanvasRenderingContext2D::originClean() const { | 69 bool OffscreenCanvasRenderingContext2D::originClean() const { |
70 return getOffscreenCanvas()->originClean(); | 70 return getOffscreenCanvas()->originClean(); |
71 } | 71 } |
72 | 72 |
73 void OffscreenCanvasRenderingContext2D::setOriginTainted() { | 73 void OffscreenCanvasRenderingContext2D::setOriginTainted() { |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 } | 246 } |
247 | 247 |
248 bool OffscreenCanvasRenderingContext2D::isContextLost() const { | 248 bool OffscreenCanvasRenderingContext2D::isContextLost() const { |
249 return false; | 249 return false; |
250 } | 250 } |
251 | 251 |
252 bool OffscreenCanvasRenderingContext2D::isPaintable() const { | 252 bool OffscreenCanvasRenderingContext2D::isPaintable() const { |
253 return this->imageBuffer(); | 253 return this->imageBuffer(); |
254 } | 254 } |
255 } | 255 } |
OLD | NEW |