| 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 "platform/graphics/paint/DisplayItemList.h" | 6 #include "platform/graphics/paint/DisplayItemList.h" |
| 7 | 7 |
| 8 #include "platform/RuntimeEnabledFeatures.h" | 8 #include "platform/RuntimeEnabledFeatures.h" |
| 9 #include "platform/graphics/GraphicsContext.h" | 9 #include "platform/graphics/GraphicsContext.h" |
| 10 #include "platform/graphics/paint/ClipRecorder.h" | 10 #include "platform/graphics/paint/ClipRecorder.h" |
| 11 #include "platform/graphics/paint/DrawingDisplayItem.h" | 11 #include "platform/graphics/paint/DrawingDisplayItem.h" |
| 12 #include "platform/graphics/paint/DrawingRecorder.h" | 12 #include "platform/graphics/paint/DrawingRecorder.h" |
| 13 #include <gtest/gtest.h> | 13 #include <gtest/gtest.h> |
| 14 | 14 |
| 15 namespace blink { | 15 namespace blink { |
| 16 | 16 |
| 17 class DisplayItemListTest : public ::testing::Test { | 17 class DisplayItemListTest : public ::testing::Test { |
| 18 protected: | 18 protected: |
| 19 DisplayItemList& displayItemList() { return m_displayItemList; } | 19 DisplayItemList& displayItemList() { return m_displayItemList; } |
| 20 const DisplayItems& newPaintListBeforeUpdate() { return displayItemList().m_
newDisplayItems; } | 20 const DisplayItems& newPaintListBeforeUpdate() { return displayItemList().m_
newDisplayItems; } |
| 21 | 21 |
| 22 private: | 22 private: |
| 23 virtual void SetUp() override | 23 virtual void SetUp() override |
| 24 { | 24 { |
| 25 RuntimeEnabledFeatures::setSlimmingPaintEnabled(true); | 25 RuntimeEnabledFeatures::setSlimmingPaintEnabled(true); |
| 26 } | 26 } |
| 27 virtual void TearDown() override | 27 virtual void TearDown() override |
| 28 { | 28 { |
| 29 RuntimeEnabledFeatures::setSlimmingPaintEnabled(false); | 29 // RuntimeEnabledFeatures::setSlimmingPaintEnabled(false); |
| 30 } | 30 } |
| 31 | 31 |
| 32 DisplayItemList m_displayItemList; | 32 DisplayItemList m_displayItemList; |
| 33 }; | 33 }; |
| 34 | 34 |
| 35 const DisplayItem::Type foregroundDrawingType = static_cast<DisplayItem::Type>(D
isplayItem::DrawingPaintPhaseFirst + 4); | 35 const DisplayItem::Type foregroundDrawingType = static_cast<DisplayItem::Type>(D
isplayItem::DrawingPaintPhaseFirst + 4); |
| 36 const DisplayItem::Type backgroundDrawingType = DisplayItem::BoxDecorationBackgr
ound; | 36 const DisplayItem::Type backgroundDrawingType = DisplayItem::BoxDecorationBackgr
ound; |
| 37 const DisplayItem::Type clipType = DisplayItem::ClipFirst; | 37 const DisplayItem::Type clipType = DisplayItem::ClipFirst; |
| 38 | 38 |
| 39 class TestDisplayItemClient { | 39 class TestDisplayItemClient { |
| (...skipping 595 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 635 EXPECT_DISPLAY_LIST(displayItemList().displayItems(), 4, | 635 EXPECT_DISPLAY_LIST(displayItemList().displayItems(), 4, |
| 636 TestDisplayItem(multicol, backgroundDrawingType), | 636 TestDisplayItem(multicol, backgroundDrawingType), |
| 637 TestDisplayItem(content, foregroundDrawingType), | 637 TestDisplayItem(content, foregroundDrawingType), |
| 638 TestDisplayItem(content, foregroundDrawingType), | 638 TestDisplayItem(content, foregroundDrawingType), |
| 639 TestDisplayItem(content, foregroundDrawingType)); | 639 TestDisplayItem(content, foregroundDrawingType)); |
| 640 EXPECT_NE(picture1, displayItemList().displayItems()[1].picture()); | 640 EXPECT_NE(picture1, displayItemList().displayItems()[1].picture()); |
| 641 EXPECT_NE(picture2, displayItemList().displayItems()[2].picture()); | 641 EXPECT_NE(picture2, displayItemList().displayItems()[2].picture()); |
| 642 } | 642 } |
| 643 | 643 |
| 644 } // namespace blink | 644 } // namespace blink |
| OLD | NEW |