| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/canvas2d/CanvasRenderingContext2D.h" | 5 #include "modules/canvas2d/CanvasRenderingContext2D.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include "bindings/core/v8/V8Binding.h" |
| 8 #include "bindings/core/v8/V8BindingForTesting.h" | 9 #include "bindings/core/v8/V8BindingForTesting.h" |
| 9 #include "core/dom/Document.h" | 10 #include "core/dom/Document.h" |
| 10 #include "core/frame/FrameView.h" | 11 #include "core/frame/FrameView.h" |
| 11 #include "core/frame/ImageBitmap.h" | 12 #include "core/frame/ImageBitmap.h" |
| 12 #include "core/html/HTMLCanvasElement.h" | 13 #include "core/html/HTMLCanvasElement.h" |
| 13 #include "core/html/ImageData.h" | 14 #include "core/html/ImageData.h" |
| 14 #include "core/imagebitmap/ImageBitmapOptions.h" | 15 #include "core/imagebitmap/ImageBitmapOptions.h" |
| 15 #include "core/loader/EmptyClients.h" | 16 #include "core/loader/EmptyClients.h" |
| 16 #include "core/testing/DummyPageHolder.h" | 17 #include "core/testing/DummyPageHolder.h" |
| 17 #include "modules/canvas2d/CanvasGradient.h" | 18 #include "modules/canvas2d/CanvasGradient.h" |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 return ImageBuffer::getGlobalAcceleratedImageBufferCount(); | 119 return ImageBuffer::getGlobalAcceleratedImageBufferCount(); |
| 119 } | 120 } |
| 120 intptr_t getCurrentGPUMemoryUsage() const { | 121 intptr_t getCurrentGPUMemoryUsage() const { |
| 121 return canvasElement().buffer()->getGPUMemoryUsage(); | 122 return canvasElement().buffer()->getGPUMemoryUsage(); |
| 122 } | 123 } |
| 123 | 124 |
| 124 void createContext(OpacityMode, | 125 void createContext(OpacityMode, |
| 125 String colorSpace = String(), | 126 String colorSpace = String(), |
| 126 LinearPixelMathState = LinearPixelMathDisabled); | 127 LinearPixelMathState = LinearPixelMathDisabled); |
| 127 ScriptState* getScriptState() { | 128 ScriptState* getScriptState() { |
| 128 return ScriptState::forMainWorld(m_canvasElement->frame()); | 129 return toScriptStateForMainWorld(m_canvasElement->frame()); |
| 129 } | 130 } |
| 130 | 131 |
| 131 void TearDown(); | 132 void TearDown(); |
| 132 void unrefCanvas(); | 133 void unrefCanvas(); |
| 133 PassRefPtr<Canvas2DLayerBridge> makeBridge( | 134 PassRefPtr<Canvas2DLayerBridge> makeBridge( |
| 134 std::unique_ptr<FakeWebGraphicsContext3DProvider>, | 135 std::unique_ptr<FakeWebGraphicsContext3DProvider>, |
| 135 const IntSize&, | 136 const IntSize&, |
| 136 Canvas2DLayerBridge::AccelerationMode); | 137 Canvas2DLayerBridge::AccelerationMode); |
| 137 | 138 |
| 138 private: | 139 private: |
| (...skipping 1231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1370 | 1371 |
| 1371 RuntimeEnabledFeatures::setExperimentalCanvasFeaturesEnabled( | 1372 RuntimeEnabledFeatures::setExperimentalCanvasFeaturesEnabled( |
| 1372 experimentalCanvasFeaturesRuntimeFlag); | 1373 experimentalCanvasFeaturesRuntimeFlag); |
| 1373 RuntimeEnabledFeatures::setColorCorrectRenderingEnabled( | 1374 RuntimeEnabledFeatures::setColorCorrectRenderingEnabled( |
| 1374 colorCorrectRenderingRuntimeFlag); | 1375 colorCorrectRenderingRuntimeFlag); |
| 1375 RuntimeEnabledFeatures::setColorCorrectRenderingDefaultModeEnabled( | 1376 RuntimeEnabledFeatures::setColorCorrectRenderingDefaultModeEnabled( |
| 1376 colorCorrectRenderingDefaultModeRuntimeFlag); | 1377 colorCorrectRenderingDefaultModeRuntimeFlag); |
| 1377 } | 1378 } |
| 1378 | 1379 |
| 1379 } // namespace blink | 1380 } // namespace blink |
| OLD | NEW |