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 "platform/graphics/paint/PaintController.h" | 5 #include "platform/graphics/paint/PaintController.h" |
6 | 6 |
7 #include "platform/RuntimeEnabledFeatures.h" | 7 #include "platform/RuntimeEnabledFeatures.h" |
8 #include "platform/graphics/GraphicsContext.h" | 8 #include "platform/graphics/GraphicsContext.h" |
9 #include "platform/graphics/paint/ClipPathDisplayItem.h" | 9 #include "platform/graphics/paint/ClipPathDisplayItem.h" |
10 #include "platform/graphics/paint/ClipPathRecorder.h" | 10 #include "platform/graphics/paint/ClipPathRecorder.h" |
11 #include "platform/graphics/paint/ClipRecorder.h" | 11 #include "platform/graphics/paint/ClipRecorder.h" |
12 #include "platform/graphics/paint/DrawingDisplayItem.h" | 12 #include "platform/graphics/paint/DrawingDisplayItem.h" |
13 #include "platform/graphics/paint/DrawingRecorder.h" | 13 #include "platform/graphics/paint/DrawingRecorder.h" |
14 #include "platform/graphics/paint/SubsequenceRecorder.h" | 14 #include "platform/graphics/paint/SubsequenceRecorder.h" |
15 #include "platform/testing/FakeDisplayItemClient.h" | 15 #include "platform/testing/FakeDisplayItemClient.h" |
16 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
17 #include <memory> | 17 #include <memory> |
18 | 18 |
19 namespace blink { | 19 namespace blink { |
20 | 20 |
21 class PaintControllerTest : public ::testing::Test { | 21 class PaintControllerTest : public ::testing::Test { |
22 public: | 22 public: |
23 PaintControllerTest() | 23 PaintControllerTest() |
24 : m_paintController(PaintController::create()) | 24 : m_paintController(PaintController::create()) |
25 , m_originalSlimmingPaintV2Enabled(RuntimeEnabledFeatures::slimmingPaint
V2Enabled()) { } | 25 , m_originalSlimmingPaintV2Enabled(RuntimeEnabledFeatures::slimmingPaint
V2Enabled()) { } |
26 | 26 |
27 IntRect visualRect(const PaintArtifact& paintArtifact, unsigned index) | 27 IntRect visualRect(const PaintArtifact& paintArtifact, size_t index) |
28 { | 28 { |
29 return paintArtifact.getDisplayItemList().visualRect(index); | 29 return paintArtifact.getDisplayItemList().visualRect(index); |
30 } | 30 } |
31 | 31 |
32 protected: | 32 protected: |
33 PaintController& getPaintController() { return *m_paintController; } | 33 PaintController& getPaintController() { return *m_paintController; } |
34 | 34 |
35 int numCachedNewItems() const { return m_paintController->m_numCachedNewItem
s; } | 35 int numCachedNewItems() const { return m_paintController->m_numCachedNewItem
s; } |
36 | 36 |
37 #if DCHECK_IS_ON() | 37 #if DCHECK_IS_ON() |
(...skipping 1013 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1051 getPaintController().createAndAppend<BeginClipPathDisplayItem>(clien
t, path); | 1051 getPaintController().createAndAppend<BeginClipPathDisplayItem>(clien
t, path); |
1052 drawRect(context, client, backgroundDrawingType, FloatRect(0, 0, 100, 10
0)); | 1052 drawRect(context, client, backgroundDrawingType, FloatRect(0, 0, 100, 10
0)); |
1053 for (int j = 0; j < 50; ++j) | 1053 for (int j = 0; j < 50; ++j) |
1054 getPaintController().createAndAppend<EndClipPathDisplayItem>(client)
; | 1054 getPaintController().createAndAppend<EndClipPathDisplayItem>(client)
; |
1055 getPaintController().commitNewDisplayItems(LayoutSize()); | 1055 getPaintController().commitNewDisplayItems(LayoutSize()); |
1056 EXPECT_FALSE(getPaintController().paintArtifact().isSuitableForGpuRaster
ization()); | 1056 EXPECT_FALSE(getPaintController().paintArtifact().isSuitableForGpuRaster
ization()); |
1057 } | 1057 } |
1058 } | 1058 } |
1059 | 1059 |
1060 } // namespace blink | 1060 } // namespace blink |
OLD | NEW |