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

Unified Diff: Source/core/paint/ViewDisplayListTest.cpp

Issue 847783003: New display item caching (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Working patch Created 5 years, 11 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: Source/core/paint/ViewDisplayListTest.cpp
diff --git a/Source/core/paint/ViewDisplayListTest.cpp b/Source/core/paint/ViewDisplayListTest.cpp
index b095b4e06cbc4f6d77b82ebb3e5b2cab37aa7682..8e2429c6caa48d6555657c914cdc90552178b4e2 100644
--- a/Source/core/paint/ViewDisplayListTest.cpp
+++ b/Source/core/paint/ViewDisplayListTest.cpp
@@ -519,5 +519,57 @@ TEST_F(ViewDisplayListTest, FullDocumentPaintingWithCaret)
TestDisplayItem(divRenderer, DisplayItem::DrawingPaintPhaseCaret));
}
+TEST_F(ViewDisplayListTest, ComplexUpdateSwapOrder)
+{
+ setBodyInnerHTML("<div id='container1'><div id='content1'></div></div>"
+ "<div id='container2'><div id='content2'></div></div>");
+ RenderObject* container1 = document().body()->firstChild()->renderer();
+ RenderObject* content1 = document().body()->firstChild()->firstChild()->renderer();
+ RenderObject* container2 = document().body()->firstChild()->nextSibling()->renderer();
+ RenderObject* content2 = document().body()->firstChild()->nextSibling()->firstChild()->renderer();
+ GraphicsContext context(nullptr, &rootDisplayItemList());
+
+ drawRect(&context, container1, PaintPhaseBlockBackground, FloatRect(100, 100, 100, 100));
+ drawRect(&context, content1, PaintPhaseBlockBackground, FloatRect(100, 100, 50, 200));
+ drawRect(&context, content1, PaintPhaseForeground, FloatRect(100, 100, 50, 200));
+ drawRect(&context, container1, PaintPhaseForeground, FloatRect(100, 100, 100, 100));
+ drawRect(&context, container2, PaintPhaseBlockBackground, FloatRect(100, 200, 100, 100));
+ drawRect(&context, content2, PaintPhaseBlockBackground, FloatRect(100, 200, 50, 200));
+ drawRect(&context, content2, PaintPhaseForeground, FloatRect(100, 200, 50, 200));
+ drawRect(&context, container2, PaintPhaseForeground, FloatRect(100, 200, 100, 100));
+ rootDisplayItemList().endNewPaints();
+
+ EXPECT_DISPLAY_LIST(rootDisplayItemList().paintList(), 8,
+ TestDisplayItem(container1, DisplayItem::DrawingPaintPhaseBlockBackground),
+ TestDisplayItem(content1, DisplayItem::DrawingPaintPhaseBlockBackground),
+ TestDisplayItem(content1, DisplayItem::DrawingPaintPhaseForeground),
+ TestDisplayItem(container1, DisplayItem::DrawingPaintPhaseForeground),
+ TestDisplayItem(container2, DisplayItem::DrawingPaintPhaseBlockBackground),
+ TestDisplayItem(content2, DisplayItem::DrawingPaintPhaseBlockBackground),
+ TestDisplayItem(content2, DisplayItem::DrawingPaintPhaseForeground),
+ TestDisplayItem(container2, DisplayItem::DrawingPaintPhaseForeground));
+
+ rootDisplayItemList().invalidate(container1->displayItemClient());
+ drawRect(&context, container2, PaintPhaseBlockBackground, FloatRect(100, 200, 100, 100));
+ drawRect(&context, content2, PaintPhaseBlockBackground, FloatRect(100, 200, 50, 200));
+ drawRect(&context, content2, PaintPhaseForeground, FloatRect(100, 200, 50, 200));
+ drawRect(&context, container2, PaintPhaseForeground, FloatRect(100, 200, 100, 100));
+ drawRect(&context, container1, PaintPhaseBlockBackground, FloatRect(100, 100, 100, 100));
+ drawRect(&context, content1, PaintPhaseBlockBackground, FloatRect(100, 100, 50, 200));
+ drawRect(&context, content1, PaintPhaseForeground, FloatRect(100, 100, 50, 200));
+ drawRect(&context, container1, PaintPhaseForeground, FloatRect(100, 100, 100, 100));
+ rootDisplayItemList().endNewPaints();
+
+ EXPECT_DISPLAY_LIST(rootDisplayItemList().paintList(), 8,
+ TestDisplayItem(container2, DisplayItem::DrawingPaintPhaseBlockBackground),
+ TestDisplayItem(content2, DisplayItem::DrawingPaintPhaseBlockBackground),
+ TestDisplayItem(content2, DisplayItem::DrawingPaintPhaseForeground),
+ TestDisplayItem(container2, DisplayItem::DrawingPaintPhaseForeground),
+ TestDisplayItem(container1, DisplayItem::DrawingPaintPhaseBlockBackground),
+ TestDisplayItem(content1, DisplayItem::DrawingPaintPhaseBlockBackground),
+ TestDisplayItem(content1, DisplayItem::DrawingPaintPhaseForeground),
+ TestDisplayItem(container1, DisplayItem::DrawingPaintPhaseForeground));
+}
+
} // anonymous namespace
} // namespace blink
« no previous file with comments | « no previous file | Source/platform/RuntimeEnabledFeatures.in » ('j') | Source/platform/graphics/paint/DisplayItemList.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698