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

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

Issue 847783003: New display item caching (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Update comments 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..f62c85ad7ec6d25c9953a924884b7d731e2a0849 100644
--- a/Source/core/paint/ViewDisplayListTest.cpp
+++ b/Source/core/paint/ViewDisplayListTest.cpp
@@ -41,7 +41,6 @@ private:
virtual void TearDown() override
{
RuntimeEnabledFeatures::setSlimmingPaintEnabled(false);
- RuntimeEnabledFeatures::setSlimmingPaintDisplayItemCacheEnabled(false);
}
RenderView* m_renderView;
@@ -446,8 +445,6 @@ TEST_F(ViewDisplayListTest, ViewDisplayListTest_UpdateClip)
TEST_F(ViewDisplayListTest, CachedDisplayItems)
{
- RuntimeEnabledFeatures::setSlimmingPaintDisplayItemCacheEnabled(true);
-
setBodyInnerHTML("<div id='first'><div id='second'></div></div>");
RenderLayerModelObject* firstRenderer = toRenderLayerModelObject(document().body()->firstChild()->renderer());
RenderLayerModelObject* secondRenderer = toRenderLayerModelObject(document().body()->firstChild()->firstChild()->renderer());
@@ -519,5 +516,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());
chrishtr 2015/01/22 22:17:21 Add a comment that this is simulating the situatio
Xianzhu 2015/01/22 23:50:59 Done.
+ 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.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698