OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef DisplayItemListPaintTest_h | 5 #ifndef DisplayItemListPaintTest_h |
6 #define DisplayItemListPaintTest_h | 6 #define DisplayItemListPaintTest_h |
7 | 7 |
8 #include "core/frame/FrameView.h" | 8 #include "core/frame/FrameView.h" |
9 #include "core/layout/LayoutTestHelper.h" | 9 #include "core/layout/LayoutTestHelper.h" |
10 #include "core/layout/LayoutView.h" | 10 #include "core/layout/LayoutView.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 class DisplayItemListPaintTestForSlimmingPaintV2 : public RenderingTest { | 45 class DisplayItemListPaintTestForSlimmingPaintV2 : public RenderingTest { |
46 public: | 46 public: |
47 DisplayItemListPaintTestForSlimmingPaintV2() | 47 DisplayItemListPaintTestForSlimmingPaintV2() |
48 : m_originalSlimmingPaintV2Enabled(RuntimeEnabledFeatures::slimmingPaint
V2Enabled()) { } | 48 : m_originalSlimmingPaintV2Enabled(RuntimeEnabledFeatures::slimmingPaint
V2Enabled()) { } |
49 | 49 |
50 protected: | 50 protected: |
51 LayoutView& layoutView() { return *document().layoutView(); } | 51 LayoutView& layoutView() { return *document().layoutView(); } |
52 DisplayItemList& rootDisplayItemList() { return *layoutView().layer()->graph
icsLayerBacking()->displayItemList(); } | 52 DisplayItemList& rootDisplayItemList() { return *layoutView().layer()->graph
icsLayerBacking()->displayItemList(); } |
53 | 53 |
54 // Expose some document lifecycle steps for checking new display items befor
e commiting. | 54 // Expose some document lifecycle steps for checking new display items befor
e commiting. |
55 void updateLifecyclePhasesToPaintForSlimmingPaintV2Clean() | 55 void updateLifecyclePhasesToPaintForSlimmingPaintV2Clean(const LayoutRect& i
nterestRect = LayoutRect::infiniteRect()) |
56 { | 56 { |
57 document().view()->updateLifecyclePhasesInternal(FrameView::OnlyUpToComp
ositingCleanPlusScrolling); | 57 document().view()->updateLifecyclePhasesInternal(FrameView::OnlyUpToComp
ositingCleanPlusScrolling); |
58 document().view()->invalidateTreeIfNeededRecursive(); | 58 document().view()->invalidateTreeIfNeededRecursive(); |
59 document().view()->paintForSlimmingPaintV2(); | 59 document().view()->paintForSlimmingPaintV2(interestRect); |
60 } | 60 } |
61 void compositeForSlimmingPaintV2() { document().view()->compositeForSlimming
PaintV2(); } | 61 void compositeForSlimmingPaintV2() { document().view()->compositeForSlimming
PaintV2(); } |
62 | 62 |
63 private: | 63 private: |
64 void SetUp() override | 64 void SetUp() override |
65 { | 65 { |
66 ASSERT_TRUE(RuntimeEnabledFeatures::slimmingPaintEnabled()); | 66 ASSERT_TRUE(RuntimeEnabledFeatures::slimmingPaintEnabled()); |
67 RuntimeEnabledFeatures::setSlimmingPaintV2Enabled(true); | 67 RuntimeEnabledFeatures::setSlimmingPaintV2Enabled(true); |
68 | 68 |
69 RenderingTest::SetUp(); | 69 RenderingTest::SetUp(); |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 TestDisplayItem(*layoutView().layer()->graphicsLayerBacking(), DisplayIt
em::drawingTypeToCachedDrawingType(DisplayItem::DebugRedFill)), \ | 119 TestDisplayItem(*layoutView().layer()->graphicsLayerBacking(), DisplayIt
em::drawingTypeToCachedDrawingType(DisplayItem::DebugRedFill)), \ |
120 __VA_ARGS__) | 120 __VA_ARGS__) |
121 #else | 121 #else |
122 #define EXPECT_DISPLAY_LIST_WITH_RED_FILL_IN_DEBUG EXPECT_DISPLAY_LIST_BASE | 122 #define EXPECT_DISPLAY_LIST_WITH_RED_FILL_IN_DEBUG EXPECT_DISPLAY_LIST_BASE |
123 #define EXPECT_DISPLAY_LIST_WITH_CACHED_RED_FILL_IN_DEBUG EXPECT_DISPLAY_LIST_BA
SE | 123 #define EXPECT_DISPLAY_LIST_WITH_CACHED_RED_FILL_IN_DEBUG EXPECT_DISPLAY_LIST_BA
SE |
124 #endif | 124 #endif |
125 | 125 |
126 } // namespace blink | 126 } // namespace blink |
127 | 127 |
128 #endif // DisplayItemListPaintTest_h | 128 #endif // DisplayItemListPaintTest_h |
OLD | NEW |