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

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

Issue 2789533003: [SPv2] Stop recording paired display items (except for subsequence markers) (Closed)
Patch Set: none Created 3 years, 9 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
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/paint/CompositingRecorder.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/graphics/paint/PaintControllerTest.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/paint/PaintControllerTest.cpp b/third_party/WebKit/Source/platform/graphics/paint/PaintControllerTest.cpp
index 1aabcd3938a378d7296febe1fd4f15b12668028a..869bd75896d1d502b0f059904c10e71540cc1fc8 100644
--- a/third_party/WebKit/Source/platform/graphics/paint/PaintControllerTest.cpp
+++ b/third_party/WebKit/Source/platform/graphics/paint/PaintControllerTest.cpp
@@ -158,16 +158,19 @@ TEST_P(PaintControllerTest, NestedRecorders) {
FloatRect(100, 100, 200, 200));
getPaintController().commitNewDisplayItems();
- EXPECT_DISPLAY_LIST(
- getPaintController().getDisplayItemList(), 3,
- TestDisplayItem(client, clipType),
- TestDisplayItem(client, backgroundDrawingType),
- TestDisplayItem(client, DisplayItem::clipTypeToEndClipType(clipType)));
-
if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
+ EXPECT_DISPLAY_LIST(getPaintController().getDisplayItemList(), 1,
+ TestDisplayItem(client, backgroundDrawingType));
+
EXPECT_EQ(1u, getPaintController().paintChunks().size());
EXPECT_THAT(getPaintController().paintChunks()[0].rasterInvalidationRects,
UnorderedElementsAre(FloatRect(LayoutRect::infiniteIntRect())));
+ } else {
+ EXPECT_DISPLAY_LIST(
+ getPaintController().getDisplayItemList(), 3,
+ TestDisplayItem(client, clipType),
+ TestDisplayItem(client, backgroundDrawingType),
+ TestDisplayItem(client, DisplayItem::clipTypeToEndClipType(clipType)));
}
}
@@ -697,16 +700,20 @@ TEST_P(PaintControllerTest, UpdateClip) {
}
getPaintController().commitNewDisplayItems();
- EXPECT_DISPLAY_LIST(
- getPaintController().getDisplayItemList(), 4,
- TestDisplayItem(first, clipType),
- TestDisplayItem(first, backgroundDrawingType),
- TestDisplayItem(second, backgroundDrawingType),
- TestDisplayItem(first, DisplayItem::clipTypeToEndClipType(clipType)));
-
if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
+ EXPECT_DISPLAY_LIST(getPaintController().getDisplayItemList(), 2,
+ TestDisplayItem(first, backgroundDrawingType),
+ TestDisplayItem(second, backgroundDrawingType));
+
getPaintController().updateCurrentPaintChunkProperties(
&m_rootPaintChunkId, defaultPaintChunkProperties());
+ } else {
+ EXPECT_DISPLAY_LIST(
+ getPaintController().getDisplayItemList(), 4,
+ TestDisplayItem(first, clipType),
+ TestDisplayItem(first, backgroundDrawingType),
+ TestDisplayItem(second, backgroundDrawingType),
+ TestDisplayItem(first, DisplayItem::clipTypeToEndClipType(clipType)));
}
first.setDisplayItemsUncached();
@@ -759,14 +766,11 @@ TEST_P(PaintControllerTest, UpdateClip) {
}
getPaintController().commitNewDisplayItems();
- EXPECT_DISPLAY_LIST(
- getPaintController().getDisplayItemList(), 4,
- TestDisplayItem(first, backgroundDrawingType),
- TestDisplayItem(second, clipType),
- TestDisplayItem(second, backgroundDrawingType),
- TestDisplayItem(second, DisplayItem::clipTypeToEndClipType(clipType)));
-
if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
+ EXPECT_DISPLAY_LIST(getPaintController().getDisplayItemList(), 2,
+ TestDisplayItem(first, backgroundDrawingType),
+ TestDisplayItem(second, backgroundDrawingType));
+
EXPECT_EQ(2u, getPaintController().paintChunks().size());
EXPECT_THAT(getPaintController().paintChunks()[0].rasterInvalidationRects,
UnorderedElementsAre(FloatRect(
@@ -775,6 +779,13 @@ TEST_P(PaintControllerTest, UpdateClip) {
EXPECT_THAT(getPaintController().paintChunks()[1].rasterInvalidationRects,
UnorderedElementsAre(FloatRect(
LayoutRect::infiniteIntRect()))); // This is a new chunk.
+ } else {
+ EXPECT_DISPLAY_LIST(
+ getPaintController().getDisplayItemList(), 4,
+ TestDisplayItem(first, backgroundDrawingType),
+ TestDisplayItem(second, clipType),
+ TestDisplayItem(second, backgroundDrawingType),
+ TestDisplayItem(second, DisplayItem::clipTypeToEndClipType(clipType)));
}
}
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/paint/CompositingRecorder.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698