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/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/Settings.h" | 9 #include "core/frame/Settings.h" |
10 #include "core/html/HTMLCanvasElement.h" | 10 #include "core/html/HTMLCanvasElement.h" |
11 #include "core/html/ImageData.h" | 11 #include "core/html/ImageData.h" |
12 #include "core/loader/EmptyClients.h" | 12 #include "core/loader/EmptyClients.h" |
13 #include "core/testing/DummyPageHolder.h" | 13 #include "core/testing/DummyPageHolder.h" |
14 #include "modules/accessibility/AXObject.h" | 14 #include "modules/accessibility/AXObject.h" |
15 #include "modules/accessibility/AXObjectCacheImpl.h" | 15 #include "modules/accessibility/AXObjectCacheImpl.h" |
16 #include "modules/canvas2d/CanvasGradient.h" | 16 #include "modules/canvas2d/CanvasGradient.h" |
17 #include "modules/canvas2d/CanvasPattern.h" | 17 #include "modules/canvas2d/CanvasPattern.h" |
18 #include "modules/canvas2d/HitRegionOptions.h" | 18 #include "modules/canvas2d/HitRegionOptions.h" |
19 #include "modules/canvas2d/Path2D.h" | 19 #include "modules/canvas2d/Path2D.h" |
20 #include "modules/webgl/WebGLRenderingContext.h" | 20 #include "modules/webgl/WebGLRenderingContext.h" |
21 #include "platform/RuntimeEnabledFeatures.h" | 21 #include "platform/RuntimeEnabledFeatures.h" |
22 #include "platform/graphics/StaticBitmapImage.h" | 22 #include "platform/graphics/StaticBitmapImage.h" |
23 #include "platform/graphics/UnacceleratedImageBufferSurface.h" | 23 #include "platform/graphics/UnacceleratedImageBufferSurface.h" |
24 #include "platform/loader/fetch/MemoryCache.h" | 24 #include "platform/loader/fetch/MemoryCache.h" |
25 #include "testing/gmock/include/gmock/gmock.h" | 25 #include "testing/gmock/include/gmock/gmock.h" |
26 #include "testing/gtest/include/gtest/gtest.h" | 26 #include "testing/gtest/include/gtest/gtest.h" |
| 27 #include "third_party/skia/include/core/SkSurface.h" |
27 | 28 |
28 using ::testing::Mock; | 29 using ::testing::Mock; |
29 | 30 |
30 namespace blink { | 31 namespace blink { |
31 namespace UsageTrackingTests { | 32 namespace UsageTrackingTests { |
32 | 33 |
33 enum BitmapOpacity { OpaqueBitmap, TransparentBitmap }; | 34 enum BitmapOpacity { OpaqueBitmap, TransparentBitmap }; |
34 | 35 |
35 class FakeImageSource : public CanvasImageSource { | 36 class FakeImageSource : public CanvasImageSource { |
36 public: | 37 public: |
(...skipping 633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
670 for (int i = 0; i < numReps; i++) { | 671 for (int i = 0; i < numReps; i++) { |
671 context2d()->fillRect(10, 10, 100, 100); | 672 context2d()->fillRect(10, 10, 100, 100); |
672 } | 673 } |
673 EXPECT_EQ( | 674 EXPECT_EQ( |
674 numReps, | 675 numReps, |
675 context2d()->getUsage().numDrawCalls[BaseRenderingContext2D::FillRect]); | 676 context2d()->getUsage().numDrawCalls[BaseRenderingContext2D::FillRect]); |
676 } | 677 } |
677 | 678 |
678 } // namespace UsageTrackingTests | 679 } // namespace UsageTrackingTests |
679 } // namespace blink | 680 } // namespace blink |
OLD | NEW |