| 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 "core/dom/Document.h" | 7 #include "core/dom/Document.h" |
| 8 #include "core/frame/FrameView.h" | 8 #include "core/frame/FrameView.h" |
| 9 #include "core/frame/ImageBitmap.h" | 9 #include "core/frame/ImageBitmap.h" |
| 10 #include "core/html/HTMLCanvasElement.h" | 10 #include "core/html/HTMLCanvasElement.h" |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 bool isRecording() const override { | 260 bool isRecording() const override { |
| 261 return true; | 261 return true; |
| 262 } // otherwise overwrites are not tracked | 262 } // otherwise overwrites are not tracked |
| 263 | 263 |
| 264 MOCK_METHOD0(willOverwriteCanvas, void()); | 264 MOCK_METHOD0(willOverwriteCanvas, void()); |
| 265 }; | 265 }; |
| 266 | 266 |
| 267 //============================================================================ | 267 //============================================================================ |
| 268 | 268 |
| 269 #define TEST_OVERDRAW_SETUP(EXPECTED_OVERDRAWS) \ | 269 #define TEST_OVERDRAW_SETUP(EXPECTED_OVERDRAWS) \ |
| 270 std::unique_ptr<MockImageBufferSurfaceForOverwriteTesting> mockSurface = \ | 270 std::unique_ptr<MockImageBufferSurfaceForOverwriteTesting> mock_surface = \ |
| 271 WTF::wrapUnique(new MockImageBufferSurfaceForOverwriteTesting( \ | 271 WTF::WrapUnique(new MockImageBufferSurfaceForOverwriteTesting( \ |
| 272 IntSize(10, 10), NonOpaque)); \ | 272 IntSize(10, 10), kNonOpaque)); \ |
| 273 MockImageBufferSurfaceForOverwriteTesting* surfacePtr = mockSurface.get(); \ | 273 MockImageBufferSurfaceForOverwriteTesting* surface_ptr = mock_surface.get(); \ |
| 274 canvasElement().createImageBufferUsingSurfaceForTesting( \ | 274 CanvasElement().CreateImageBufferUsingSurfaceForTesting( \ |
| 275 std::move(mockSurface)); \ | 275 std::move(mock_surface)); \ |
| 276 EXPECT_CALL(*surfacePtr, willOverwriteCanvas()).Times(EXPECTED_OVERDRAWS); \ | 276 EXPECT_CALL(*surface_ptr, WillOverwriteCanvas()).Times(EXPECTED_OVERDRAWS); \ |
| 277 context2d()->save(); | 277 Context2d()->save(); |
| 278 | 278 |
| 279 #define TEST_OVERDRAW_FINALIZE \ | 279 #define TEST_OVERDRAW_FINALIZE \ |
| 280 context2d()->restore(); \ | 280 context2d()->restore(); \ |
| 281 Mock::VerifyAndClearExpectations(surfacePtr); | 281 Mock::VerifyAndClearExpectations(surfacePtr); |
| 282 | 282 |
| 283 #define TEST_OVERDRAW_1(EXPECTED_OVERDRAWS, CALL1) \ | 283 #define TEST_OVERDRAW_1(EXPECTED_OVERDRAWS, CALL1) \ |
| 284 do { \ | 284 do { \ |
| 285 TEST_OVERDRAW_SETUP(EXPECTED_OVERDRAWS) \ | 285 TEST_OVERDRAW_SETUP(EXPECTED_OVERDRAWS) \ |
| 286 context2d()->CALL1; \ | 286 context2d()->CALL1; \ |
| 287 TEST_OVERDRAW_FINALIZE \ | 287 TEST_OVERDRAW_FINALIZE \ |
| (...skipping 1073 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1361 | 1361 |
| 1362 RuntimeEnabledFeatures::setExperimentalCanvasFeaturesEnabled( | 1362 RuntimeEnabledFeatures::setExperimentalCanvasFeaturesEnabled( |
| 1363 experimentalCanvasFeaturesRuntimeFlag); | 1363 experimentalCanvasFeaturesRuntimeFlag); |
| 1364 RuntimeEnabledFeatures::setColorCorrectRenderingEnabled( | 1364 RuntimeEnabledFeatures::setColorCorrectRenderingEnabled( |
| 1365 colorCorrectRenderingRuntimeFlag); | 1365 colorCorrectRenderingRuntimeFlag); |
| 1366 RuntimeEnabledFeatures::setColorCorrectRenderingDefaultModeEnabled( | 1366 RuntimeEnabledFeatures::setColorCorrectRenderingDefaultModeEnabled( |
| 1367 colorCorrectRenderingDefaultModeRuntimeFlag); | 1367 colorCorrectRenderingDefaultModeRuntimeFlag); |
| 1368 } | 1368 } |
| 1369 | 1369 |
| 1370 } // namespace blink | 1370 } // namespace blink |
| OLD | NEW |