| 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/V8Binding.h" |
| 9 #include "bindings/core/v8/V8BindingForTesting.h" | 9 #include "bindings/core/v8/V8BindingForTesting.h" |
| 10 #include "core/dom/Document.h" | 10 #include "core/dom/Document.h" |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 bool isRecording() const override { | 277 bool isRecording() const override { |
| 278 return true; | 278 return true; |
| 279 } // otherwise overwrites are not tracked | 279 } // otherwise overwrites are not tracked |
| 280 | 280 |
| 281 MOCK_METHOD0(willOverwriteCanvas, void()); | 281 MOCK_METHOD0(willOverwriteCanvas, void()); |
| 282 }; | 282 }; |
| 283 | 283 |
| 284 //============================================================================ | 284 //============================================================================ |
| 285 | 285 |
| 286 #define TEST_OVERDRAW_SETUP(EXPECTED_OVERDRAWS) \ | 286 #define TEST_OVERDRAW_SETUP(EXPECTED_OVERDRAWS) \ |
| 287 std::unique_ptr<MockImageBufferSurfaceForOverwriteTesting> mockSurface = \ | 287 std::unique_ptr<MockImageBufferSurfaceForOverwriteTesting> mock_surface = \ |
| 288 WTF::wrapUnique(new MockImageBufferSurfaceForOverwriteTesting( \ | 288 WTF::WrapUnique(new MockImageBufferSurfaceForOverwriteTesting( \ |
| 289 IntSize(10, 10), NonOpaque)); \ | 289 IntSize(10, 10), kNonOpaque)); \ |
| 290 MockImageBufferSurfaceForOverwriteTesting* surfacePtr = mockSurface.get(); \ | 290 MockImageBufferSurfaceForOverwriteTesting* surface_ptr = mock_surface.get(); \ |
| 291 canvasElement().createImageBufferUsingSurfaceForTesting( \ | 291 CanvasElement().CreateImageBufferUsingSurfaceForTesting( \ |
| 292 std::move(mockSurface)); \ | 292 std::move(mock_surface)); \ |
| 293 EXPECT_CALL(*surfacePtr, willOverwriteCanvas()).Times(EXPECTED_OVERDRAWS); \ | 293 EXPECT_CALL(*surface_ptr, WillOverwriteCanvas()).Times(EXPECTED_OVERDRAWS); \ |
| 294 context2d()->save(); | 294 Context2d()->save(); |
| 295 | 295 |
| 296 #define TEST_OVERDRAW_FINALIZE \ | 296 #define TEST_OVERDRAW_FINALIZE \ |
| 297 context2d()->restore(); \ | 297 context2d()->restore(); \ |
| 298 Mock::VerifyAndClearExpectations(surfacePtr); | 298 Mock::VerifyAndClearExpectations(surfacePtr); |
| 299 | 299 |
| 300 #define TEST_OVERDRAW_1(EXPECTED_OVERDRAWS, CALL1) \ | 300 #define TEST_OVERDRAW_1(EXPECTED_OVERDRAWS, CALL1) \ |
| 301 do { \ | 301 do { \ |
| 302 TEST_OVERDRAW_SETUP(EXPECTED_OVERDRAWS) \ | 302 TEST_OVERDRAW_SETUP(EXPECTED_OVERDRAWS) \ |
| 303 context2d()->CALL1; \ | 303 context2d()->CALL1; \ |
| 304 TEST_OVERDRAW_FINALIZE \ | 304 TEST_OVERDRAW_FINALIZE \ |
| (...skipping 1066 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1371 | 1371 |
| 1372 RuntimeEnabledFeatures::setExperimentalCanvasFeaturesEnabled( | 1372 RuntimeEnabledFeatures::setExperimentalCanvasFeaturesEnabled( |
| 1373 experimentalCanvasFeaturesRuntimeFlag); | 1373 experimentalCanvasFeaturesRuntimeFlag); |
| 1374 RuntimeEnabledFeatures::setColorCorrectRenderingEnabled( | 1374 RuntimeEnabledFeatures::setColorCorrectRenderingEnabled( |
| 1375 colorCorrectRenderingRuntimeFlag); | 1375 colorCorrectRenderingRuntimeFlag); |
| 1376 RuntimeEnabledFeatures::setColorCorrectRenderingDefaultModeEnabled( | 1376 RuntimeEnabledFeatures::setColorCorrectRenderingDefaultModeEnabled( |
| 1377 colorCorrectRenderingDefaultModeRuntimeFlag); | 1377 colorCorrectRenderingDefaultModeRuntimeFlag); |
| 1378 } | 1378 } |
| 1379 | 1379 |
| 1380 } // namespace blink | 1380 } // namespace blink |
| OLD | NEW |