Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(161)

Unified Diff: third_party/WebKit/Source/platform/graphics/paint/DisplayItemListTest.cpp

Issue 1379883003: Create PaintChunk and begin writing code to build paint chunks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: enable RuntimeEnabledFeature for PaintChunkerTest Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/graphics/paint/DisplayItemListTest.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/paint/DisplayItemListTest.cpp b/third_party/WebKit/Source/platform/graphics/paint/DisplayItemListTest.cpp
index 7da8aff442f1b69c911b847ee35af16444e712c5..a5fb85c63a9b32d89be6a4dcab650f92d688676c 100644
--- a/third_party/WebKit/Source/platform/graphics/paint/DisplayItemListTest.cpp
+++ b/third_party/WebKit/Source/platform/graphics/paint/DisplayItemListTest.cpp
@@ -21,7 +21,8 @@ class DisplayItemListTest : public ::testing::Test {
public:
DisplayItemListTest()
: m_displayItemList(DisplayItemList::create())
- , m_originalSlimmingPaintSubsequenceCachingEnabled(RuntimeEnabledFeatures::slimmingPaintSubsequenceCachingEnabled()) { }
+ , m_originalSlimmingPaintSubsequenceCachingEnabled(RuntimeEnabledFeatures::slimmingPaintSubsequenceCachingEnabled())
+ , m_originalSlimmingPaintV2Enabled(RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { }
protected:
DisplayItemList& displayItemList() { return *m_displayItemList; }
@@ -30,10 +31,12 @@ private:
void TearDown() override
{
RuntimeEnabledFeatures::setSlimmingPaintSubsequenceCachingEnabled(m_originalSlimmingPaintSubsequenceCachingEnabled);
+ RuntimeEnabledFeatures::setSlimmingPaintV2Enabled(m_originalSlimmingPaintV2Enabled);
}
OwnPtr<DisplayItemList> m_displayItemList;
bool m_originalSlimmingPaintSubsequenceCachingEnabled;
+ bool m_originalSlimmingPaintV2Enabled;
};
const DisplayItem::Type foregroundDrawingType = static_cast<DisplayItem::Type>(DisplayItem::DrawingPaintPhaseFirst + 4);
@@ -772,4 +775,19 @@ TEST_F(DisplayItemListTest, OptimizeNoopPairs)
TestDisplayItem(third, backgroundDrawingType));
}
+TEST_F(DisplayItemListTest, SmallDisplayItemListHasOnePaintChunk)
+{
+ RuntimeEnabledFeatures::setSlimmingPaintV2Enabled(true);
+ TestDisplayItemClient client("test client");
+
+ GraphicsContext context(&displayItemList());
+ drawRect(context, client, backgroundDrawingType, FloatRect(0, 0, 100, 100));
+
+ displayItemList().commitNewDisplayItems();
+ const auto& paintChunks = displayItemList().paintChunks();
+ ASSERT_EQ(1u, paintChunks.size());
+ EXPECT_EQ(0u, paintChunks[0].beginIndex);
+ EXPECT_EQ(1u, paintChunks[0].endIndex);
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698