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 "config.h" | 5 #include "config.h" |
6 #include "core/paint/LayerClipRecorder.h" | 6 #include "core/paint/LayerClipRecorder.h" |
7 | 7 |
8 #include "core/layout/LayoutTestHelper.h" | 8 #include "core/layout/LayoutTestHelper.h" |
9 #include "core/layout/LayoutView.h" | 9 #include "core/layout/LayoutView.h" |
10 #include "core/layout/compositing/DeprecatedPaintLayerCompositor.h" | 10 #include "core/layout/compositing/DeprecatedPaintLayerCompositor.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 public: | 22 public: |
23 LayerClipRecorderTest() | 23 LayerClipRecorderTest() |
24 : m_layoutView(nullptr) | 24 : m_layoutView(nullptr) |
25 , m_originalSlimmingPaintEnabled(RuntimeEnabledFeatures::slimmingPaintEn
abled()) { } | 25 , m_originalSlimmingPaintEnabled(RuntimeEnabledFeatures::slimmingPaintEn
abled()) { } |
26 | 26 |
27 protected: | 27 protected: |
28 LayoutView& layoutView() { return *m_layoutView; } | 28 LayoutView& layoutView() { return *m_layoutView; } |
29 DisplayItemList& rootDisplayItemList() { return *layoutView().layer()->graph
icsLayerBacking()->displayItemList(); } | 29 DisplayItemList& rootDisplayItemList() { return *layoutView().layer()->graph
icsLayerBacking()->displayItemList(); } |
30 | 30 |
31 private: | 31 private: |
32 virtual void SetUp() override | 32 void SetUp() override |
33 { | 33 { |
34 RuntimeEnabledFeatures::setSlimmingPaintEnabled(true); | 34 RuntimeEnabledFeatures::setSlimmingPaintEnabled(true); |
35 | 35 |
36 RenderingTest::SetUp(); | 36 RenderingTest::SetUp(); |
37 enableCompositing(); | 37 enableCompositing(); |
38 | 38 |
39 m_layoutView = document().view()->layoutView(); | 39 m_layoutView = document().view()->layoutView(); |
40 ASSERT_TRUE(m_layoutView); | 40 ASSERT_TRUE(m_layoutView); |
41 } | 41 } |
42 virtual void TearDown() override | 42 void TearDown() override |
43 { | 43 { |
44 RuntimeEnabledFeatures::setSlimmingPaintEnabled(m_originalSlimmingPaintE
nabled); | 44 RuntimeEnabledFeatures::setSlimmingPaintEnabled(m_originalSlimmingPaintE
nabled); |
45 } | 45 } |
46 | 46 |
47 LayoutView* m_layoutView; | 47 LayoutView* m_layoutView; |
48 bool m_originalSlimmingPaintEnabled; | 48 bool m_originalSlimmingPaintEnabled; |
49 }; | 49 }; |
50 | 50 |
51 void drawEmptyClip(GraphicsContext& context, LayoutView& layoutView, PaintPhase
phase, const FloatRect& bound) | 51 void drawEmptyClip(GraphicsContext& context, LayoutView& layoutView, PaintPhase
phase, const FloatRect& bound) |
52 { | 52 { |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 FloatRect bound = layoutView().viewRect(); | 86 FloatRect bound = layoutView().viewRect(); |
87 EXPECT_EQ((size_t)0, rootDisplayItemList().displayItems().size()); | 87 EXPECT_EQ((size_t)0, rootDisplayItemList().displayItems().size()); |
88 | 88 |
89 drawEmptyClip(context, layoutView(), PaintPhaseForeground, bound); | 89 drawEmptyClip(context, layoutView(), PaintPhaseForeground, bound); |
90 rootDisplayItemList().commitNewDisplayItems(); | 90 rootDisplayItemList().commitNewDisplayItems(); |
91 EXPECT_EQ((size_t)0, rootDisplayItemList().displayItems().size()); | 91 EXPECT_EQ((size_t)0, rootDisplayItemList().displayItems().size()); |
92 } | 92 } |
93 | 93 |
94 } | 94 } |
95 } | 95 } |
OLD | NEW |