| 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" |
| 11 #include "core/workers/WorkerSettings.h" | 11 #include "core/workers/WorkerSettings.h" |
| 12 #include "platform/graphics/ImageBuffer.h" | 12 #include "platform/graphics/ImageBuffer.h" |
| 13 #include "platform/graphics/StaticBitmapImage.h" | 13 #include "platform/graphics/StaticBitmapImage.h" |
| 14 #include "wtf/Assertions.h" | 14 #include "wtf/Assertions.h" |
| 15 | 15 |
| 16 #define UNIMPLEMENTED ASSERT_NOT_REACHED | 16 #define UNIMPLEMENTED ASSERT_NOT_REACHED |
| 17 | 17 |
| 18 namespace blink { | 18 namespace blink { |
| 19 | 19 |
| 20 OffscreenCanvasRenderingContext2D::~OffscreenCanvasRenderingContext2D() | 20 OffscreenCanvasRenderingContext2D::~OffscreenCanvasRenderingContext2D() |
| 21 { | 21 { |
| 22 } | 22 } |
| 23 | 23 |
| 24 OffscreenCanvasRenderingContext2D::OffscreenCanvasRenderingContext2D(ScriptState
* scriptState, OffscreenCanvas* canvas, const CanvasContextCreationAttributes& a
ttrs) | 24 OffscreenCanvasRenderingContext2D::OffscreenCanvasRenderingContext2D(ScriptState
* scriptState, OffscreenCanvas* canvas, const CanvasContextCreationAttributes& a
ttrs) |
| 25 : CanvasRenderingContext(nullptr, canvas) | 25 : CanvasRenderingContext(nullptr, canvas, attrs.colorSpace()) |
| 26 , m_hasAlpha(attrs.alpha()) | 26 , m_hasAlpha(attrs.alpha()) |
| 27 { | 27 { |
| 28 ExecutionContext* executionContext = scriptState->getExecutionContext(); | 28 ExecutionContext* executionContext = scriptState->getExecutionContext(); |
| 29 if (executionContext->isDocument()) { | 29 if (executionContext->isDocument()) { |
| 30 if (toDocument(executionContext)->settings()->disableReadingFromCanvas()
) | 30 if (toDocument(executionContext)->settings()->disableReadingFromCanvas()
) |
| 31 canvas->setDisableReadingFromCanvasTrue(); | 31 canvas->setDisableReadingFromCanvasTrue(); |
| 32 return; | 32 return; |
| 33 } | 33 } |
| 34 | 34 |
| 35 WorkerSettings* workerSettings = toWorkerGlobalScope(executionContext)->work
erSettings(); | 35 WorkerSettings* workerSettings = toWorkerGlobalScope(executionContext)->work
erSettings(); |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 } | 170 } |
| 171 #endif | 171 #endif |
| 172 } | 172 } |
| 173 | 173 |
| 174 bool OffscreenCanvasRenderingContext2D::isContextLost() const | 174 bool OffscreenCanvasRenderingContext2D::isContextLost() const |
| 175 { | 175 { |
| 176 return false; | 176 return false; |
| 177 } | 177 } |
| 178 | 178 |
| 179 } | 179 } |
| OLD | NEW |