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/LayoutObjectDrawingRecorder.h" | 6 #include "core/paint/LayoutObjectDrawingRecorder.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/paint/DeprecatedPaintLayer.h" | 10 #include "core/paint/DeprecatedPaintLayer.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 LayoutObjectDrawingRecorderTest() | 21 LayoutObjectDrawingRecorderTest() |
22 : m_layoutView(nullptr) | 22 : m_layoutView(nullptr) |
23 , m_originalSlimmingPaintEnabled(RuntimeEnabledFeatures::slimmingPaintEn
abled()) { } | 23 , m_originalSlimmingPaintEnabled(RuntimeEnabledFeatures::slimmingPaintEn
abled()) { } |
24 | 24 |
25 protected: | 25 protected: |
26 LayoutView& layoutView() { return *m_layoutView; } | 26 LayoutView& layoutView() { return *m_layoutView; } |
27 DisplayItemList& rootDisplayItemList() { return *layoutView().layer()->graph
icsLayerBacking()->displayItemList(); } | 27 DisplayItemList& rootDisplayItemList() { return *layoutView().layer()->graph
icsLayerBacking()->displayItemList(); } |
28 const DisplayItems& newDisplayItemsBeforeUpdate() { return rootDisplayItemLi
st().m_newDisplayItems; } | 28 const DisplayItems& newDisplayItemsBeforeUpdate() { return rootDisplayItemLi
st().m_newDisplayItems; } |
29 | 29 |
30 private: | 30 private: |
31 virtual void SetUp() override | 31 void SetUp() override |
32 { | 32 { |
33 RuntimeEnabledFeatures::setSlimmingPaintEnabled(true); | 33 RuntimeEnabledFeatures::setSlimmingPaintEnabled(true); |
34 | 34 |
35 RenderingTest::SetUp(); | 35 RenderingTest::SetUp(); |
36 enableCompositing(); | 36 enableCompositing(); |
37 | 37 |
38 m_layoutView = document().view()->layoutView(); | 38 m_layoutView = document().view()->layoutView(); |
39 ASSERT_TRUE(m_layoutView); | 39 ASSERT_TRUE(m_layoutView); |
40 } | 40 } |
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 namespace { | 51 namespace { |
52 | 52 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 EXPECT_TRUE(isCached(*newDisplayItemsBeforeUpdate().elementAt(0))); | 118 EXPECT_TRUE(isCached(*newDisplayItemsBeforeUpdate().elementAt(0))); |
119 EXPECT_TRUE(isCached(*newDisplayItemsBeforeUpdate().elementAt(1))); | 119 EXPECT_TRUE(isCached(*newDisplayItemsBeforeUpdate().elementAt(1))); |
120 rootDisplayItemList().commitNewDisplayItems(); | 120 rootDisplayItemList().commitNewDisplayItems(); |
121 EXPECT_EQ((size_t)2, rootDisplayItemList().displayItems().size()); | 121 EXPECT_EQ((size_t)2, rootDisplayItemList().displayItems().size()); |
122 EXPECT_TRUE(isDrawing(*rootDisplayItemList().displayItems().elementAt(0))); | 122 EXPECT_TRUE(isDrawing(*rootDisplayItemList().displayItems().elementAt(0))); |
123 EXPECT_TRUE(isDrawing(*rootDisplayItemList().displayItems().elementAt(1))); | 123 EXPECT_TRUE(isDrawing(*rootDisplayItemList().displayItems().elementAt(1))); |
124 } | 124 } |
125 | 125 |
126 } // namespace | 126 } // namespace |
127 } // namespace blink | 127 } // namespace blink |
OLD | NEW |