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" | |
28 | 27 |
29 using ::testing::Mock; | 28 using ::testing::Mock; |
30 | 29 |
31 namespace blink { | 30 namespace blink { |
32 namespace UsageTrackingTests { | 31 namespace UsageTrackingTests { |
33 | 32 |
34 enum BitmapOpacity { OpaqueBitmap, TransparentBitmap }; | 33 enum BitmapOpacity { OpaqueBitmap, TransparentBitmap }; |
35 | 34 |
36 class FakeImageSource : public CanvasImageSource { | 35 class FakeImageSource : public CanvasImageSource { |
37 public: | 36 public: |
(...skipping 633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
671 for (int i = 0; i < numReps; i++) { | 670 for (int i = 0; i < numReps; i++) { |
672 context2d()->fillRect(10, 10, 100, 100); | 671 context2d()->fillRect(10, 10, 100, 100); |
673 } | 672 } |
674 EXPECT_EQ( | 673 EXPECT_EQ( |
675 numReps, | 674 numReps, |
676 context2d()->getUsage().numDrawCalls[BaseRenderingContext2D::FillRect]); | 675 context2d()->getUsage().numDrawCalls[BaseRenderingContext2D::FillRect]); |
677 } | 676 } |
678 | 677 |
679 } // namespace UsageTrackingTests | 678 } // namespace UsageTrackingTests |
680 } // namespace blink | 679 } // namespace blink |
OLD | NEW |