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

Unified Diff: third_party/WebKit/Source/core/paint/PaintControllerPaintTest.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
Index: third_party/WebKit/Source/core/paint/PaintControllerPaintTest.cpp
diff --git a/third_party/WebKit/Source/core/paint/PaintControllerPaintTest.cpp b/third_party/WebKit/Source/core/paint/PaintControllerPaintTest.cpp
index 018acd1953f2bd04365bda3a9bc14e14918f4fe2..7f1813a79f01171485112ce714329664827187a1 100644
--- a/third_party/WebKit/Source/core/paint/PaintControllerPaintTest.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintControllerPaintTest.cpp
@@ -36,26 +36,12 @@ TEST_P(PaintControllerPaintTestForSlimmingPaintV1AndV2,
*toLayoutText(div.firstChild()->layoutObject())->firstTextBox();
if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
- if (RuntimeEnabledFeatures::rootLayerScrollingEnabled()) {
- EXPECT_DISPLAY_LIST(
- rootPaintController().getDisplayItemList(), 4,
- TestDisplayItem(*layoutView().layer(), DisplayItem::kSubsequence),
- TestDisplayItem(layoutView(), documentBackgroundType),
- TestDisplayItem(textInlineBox, foregroundType),
- TestDisplayItem(*layoutView().layer(), DisplayItem::kEndSubsequence));
- } else {
- EXPECT_DISPLAY_LIST(
- rootPaintController().getDisplayItemList(), 6,
- TestDisplayItem(layoutView(),
- DisplayItem::kClipFrameToVisibleContentRect),
- TestDisplayItem(*layoutView().layer(), DisplayItem::kSubsequence),
- TestDisplayItem(layoutView(), documentBackgroundType),
- TestDisplayItem(textInlineBox, foregroundType),
- TestDisplayItem(*layoutView().layer(), DisplayItem::kEndSubsequence),
- TestDisplayItem(layoutView(),
- DisplayItem::clipTypeToEndClipType(
- DisplayItem::kClipFrameToVisibleContentRect)));
- }
+ EXPECT_DISPLAY_LIST(
+ rootPaintController().getDisplayItemList(), 4,
+ TestDisplayItem(*layoutView().layer(), DisplayItem::kSubsequence),
+ TestDisplayItem(layoutView(), documentBackgroundType),
+ TestDisplayItem(textInlineBox, foregroundType),
+ TestDisplayItem(*layoutView().layer(), DisplayItem::kEndSubsequence));
} else {
EXPECT_DISPLAY_LIST(rootPaintController().getDisplayItemList(), 2,
TestDisplayItem(layoutView(), documentBackgroundType),
@@ -66,36 +52,15 @@ TEST_P(PaintControllerPaintTestForSlimmingPaintV1AndV2,
document().view()->updateAllLifecyclePhases();
if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
- if (RuntimeEnabledFeatures::rootLayerScrollingEnabled()) {
- EXPECT_DISPLAY_LIST(
- rootPaintController().getDisplayItemList(), 5,
- TestDisplayItem(*layoutView().layer(), DisplayItem::kSubsequence),
- TestDisplayItem(layoutView(), documentBackgroundType),
- TestDisplayItem(textInlineBox, foregroundType),
- TestDisplayItem(document()
- .frame()
- ->selection()
- .caretDisplayItemClientForTesting(),
- DisplayItem::kCaret), // New!
- TestDisplayItem(*layoutView().layer(), DisplayItem::kEndSubsequence));
- } else {
- EXPECT_DISPLAY_LIST(
- rootPaintController().getDisplayItemList(), 7,
- TestDisplayItem(layoutView(),
- DisplayItem::kClipFrameToVisibleContentRect),
- TestDisplayItem(*layoutView().layer(), DisplayItem::kSubsequence),
- TestDisplayItem(layoutView(), documentBackgroundType),
- TestDisplayItem(textInlineBox, foregroundType),
- TestDisplayItem(document()
- .frame()
- ->selection()
- .caretDisplayItemClientForTesting(),
- DisplayItem::kCaret), // New!
- TestDisplayItem(*layoutView().layer(), DisplayItem::kEndSubsequence),
- TestDisplayItem(layoutView(),
- DisplayItem::clipTypeToEndClipType(
- DisplayItem::kClipFrameToVisibleContentRect)));
- }
+ EXPECT_DISPLAY_LIST(
+ rootPaintController().getDisplayItemList(), 5,
+ TestDisplayItem(*layoutView().layer(), DisplayItem::kSubsequence),
+ TestDisplayItem(layoutView(), documentBackgroundType),
+ TestDisplayItem(textInlineBox, foregroundType),
+ TestDisplayItem(
+ document().frame()->selection().caretDisplayItemClientForTesting(),
+ DisplayItem::kCaret), // New!
+ TestDisplayItem(*layoutView().layer(), DisplayItem::kEndSubsequence));
} else {
EXPECT_DISPLAY_LIST(
rootPaintController().getDisplayItemList(), 3,
@@ -118,26 +83,12 @@ TEST_P(PaintControllerPaintTestForSlimmingPaintV1AndV2, InlineRelayout) {
InlineTextBox& firstTextBox = *text.firstTextBox();
if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
- if (RuntimeEnabledFeatures::rootLayerScrollingEnabled()) {
- EXPECT_DISPLAY_LIST(
- rootPaintController().getDisplayItemList(), 4,
- TestDisplayItem(*layoutView().layer(), DisplayItem::kSubsequence),
- TestDisplayItem(layoutView(), documentBackgroundType),
- TestDisplayItem(firstTextBox, foregroundType),
- TestDisplayItem(*layoutView().layer(), DisplayItem::kEndSubsequence));
- } else {
- EXPECT_DISPLAY_LIST(
- rootPaintController().getDisplayItemList(), 6,
- TestDisplayItem(layoutView(),
- DisplayItem::kClipFrameToVisibleContentRect),
- TestDisplayItem(*layoutView().layer(), DisplayItem::kSubsequence),
- TestDisplayItem(layoutView(), documentBackgroundType),
- TestDisplayItem(firstTextBox, foregroundType),
- TestDisplayItem(*layoutView().layer(), DisplayItem::kEndSubsequence),
- TestDisplayItem(layoutView(),
- DisplayItem::clipTypeToEndClipType(
- DisplayItem::kClipFrameToVisibleContentRect)));
- }
+ EXPECT_DISPLAY_LIST(
+ rootPaintController().getDisplayItemList(), 4,
+ TestDisplayItem(*layoutView().layer(), DisplayItem::kSubsequence),
+ TestDisplayItem(layoutView(), documentBackgroundType),
+ TestDisplayItem(firstTextBox, foregroundType),
+ TestDisplayItem(*layoutView().layer(), DisplayItem::kEndSubsequence));
} else {
EXPECT_DISPLAY_LIST(rootPaintController().getDisplayItemList(), 2,
TestDisplayItem(layoutView(), documentBackgroundType),
@@ -152,28 +103,13 @@ TEST_P(PaintControllerPaintTestForSlimmingPaintV1AndV2, InlineRelayout) {
InlineTextBox& secondTextBox = *newText.firstTextBox()->nextTextBox();
if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
- if (RuntimeEnabledFeatures::rootLayerScrollingEnabled()) {
- EXPECT_DISPLAY_LIST(
- rootPaintController().getDisplayItemList(), 5,
- TestDisplayItem(*layoutView().layer(), DisplayItem::kSubsequence),
- TestDisplayItem(layoutView(), documentBackgroundType),
- TestDisplayItem(newFirstTextBox, foregroundType),
- TestDisplayItem(secondTextBox, foregroundType),
- TestDisplayItem(*layoutView().layer(), DisplayItem::kEndSubsequence));
- } else {
- EXPECT_DISPLAY_LIST(
- rootPaintController().getDisplayItemList(), 7,
- TestDisplayItem(layoutView(),
- DisplayItem::kClipFrameToVisibleContentRect),
- TestDisplayItem(*layoutView().layer(), DisplayItem::kSubsequence),
- TestDisplayItem(layoutView(), documentBackgroundType),
- TestDisplayItem(newFirstTextBox, foregroundType),
- TestDisplayItem(secondTextBox, foregroundType),
- TestDisplayItem(*layoutView().layer(), DisplayItem::kEndSubsequence),
- TestDisplayItem(layoutView(),
- DisplayItem::clipTypeToEndClipType(
- DisplayItem::kClipFrameToVisibleContentRect)));
- }
+ EXPECT_DISPLAY_LIST(
+ rootPaintController().getDisplayItemList(), 5,
+ TestDisplayItem(*layoutView().layer(), DisplayItem::kSubsequence),
+ TestDisplayItem(layoutView(), documentBackgroundType),
+ TestDisplayItem(newFirstTextBox, foregroundType),
+ TestDisplayItem(secondTextBox, foregroundType),
+ TestDisplayItem(*layoutView().layer(), DisplayItem::kEndSubsequence));
} else {
EXPECT_DISPLAY_LIST(rootPaintController().getDisplayItemList(), 3,
TestDisplayItem(layoutView(), documentBackgroundType),
@@ -196,36 +132,15 @@ TEST_P(PaintControllerPaintTestForSlimmingPaintV2, ChunkIdClientCacheFlag) {
LayoutBlock& div = *toLayoutBlock(getLayoutObjectByElementId("div"));
LayoutObject& subDiv = *div.firstChild();
LayoutObject& subDiv2 = *subDiv.nextSibling();
- if (RuntimeEnabledFeatures::rootLayerScrollingEnabled()) {
- EXPECT_DISPLAY_LIST(
- rootPaintController().getDisplayItemList(), 9,
- TestDisplayItem(*layoutView().layer(), DisplayItem::kSubsequence),
- TestDisplayItem(layoutView(), documentBackgroundType),
- TestDisplayItem(htmlLayer, DisplayItem::kSubsequence),
- TestDisplayItem(div, DisplayItem::kBeginCompositing),
- TestDisplayItem(subDiv, backgroundType),
- TestDisplayItem(subDiv2, backgroundType),
- TestDisplayItem(div, DisplayItem::kEndCompositing),
- TestDisplayItem(htmlLayer, DisplayItem::kEndSubsequence),
- TestDisplayItem(*layoutView().layer(), DisplayItem::kEndSubsequence));
- } else {
- EXPECT_DISPLAY_LIST(
- rootPaintController().getDisplayItemList(), 11,
- TestDisplayItem(layoutView(),
- DisplayItem::kClipFrameToVisibleContentRect),
- TestDisplayItem(*layoutView().layer(), DisplayItem::kSubsequence),
- TestDisplayItem(layoutView(), documentBackgroundType),
- TestDisplayItem(htmlLayer, DisplayItem::kSubsequence),
- TestDisplayItem(div, DisplayItem::kBeginCompositing),
- TestDisplayItem(subDiv, backgroundType),
- TestDisplayItem(subDiv2, backgroundType),
- TestDisplayItem(div, DisplayItem::kEndCompositing),
- TestDisplayItem(htmlLayer, DisplayItem::kEndSubsequence),
- TestDisplayItem(*layoutView().layer(), DisplayItem::kEndSubsequence),
- TestDisplayItem(layoutView(),
- DisplayItem::clipTypeToEndClipType(
- DisplayItem::kClipFrameToVisibleContentRect)));
- }
+ EXPECT_DISPLAY_LIST(
+ rootPaintController().getDisplayItemList(), 7,
+ TestDisplayItem(*layoutView().layer(), DisplayItem::kSubsequence),
+ TestDisplayItem(layoutView(), documentBackgroundType),
+ TestDisplayItem(htmlLayer, DisplayItem::kSubsequence),
+ TestDisplayItem(subDiv, backgroundType),
+ TestDisplayItem(subDiv2, backgroundType),
+ TestDisplayItem(htmlLayer, DisplayItem::kEndSubsequence),
+ TestDisplayItem(*layoutView().layer(), DisplayItem::kEndSubsequence));
// Verify that the background does not scroll.
const PaintChunk& backgroundChunk = rootPaintController().paintChunks()[0];
@@ -235,11 +150,7 @@ TEST_P(PaintControllerPaintTestForSlimmingPaintV2, ChunkIdClientCacheFlag) {
const EffectPaintPropertyNode* effectNode = div.paintProperties()->effect();
EXPECT_EQ(0.5f, effectNode->opacity());
- // When RLS is enabled, an additional paint chunk will be created for the
- // LayoutView's layer.
- unsigned divChunkIndex =
- RuntimeEnabledFeatures::rootLayerScrollingEnabled() ? 2 : 1;
- const PaintChunk& chunk = rootPaintController().paintChunks()[divChunkIndex];
+ const PaintChunk& chunk = rootPaintController().paintChunks()[1];
EXPECT_EQ(*div.layer(), chunk.id->client);
EXPECT_EQ(effectNode, chunk.properties.propertyTreeState.effect());
@@ -263,34 +174,14 @@ TEST_P(PaintControllerPaintTestForSlimmingPaintV2, CompositingNoFold) {
LayoutBlock& div = *toLayoutBlock(getLayoutObjectByElementId("div"));
LayoutObject& subDiv = *div.firstChild();
- if (RuntimeEnabledFeatures::rootLayerScrollingEnabled()) {
- EXPECT_DISPLAY_LIST(
- rootPaintController().getDisplayItemList(), 8,
- TestDisplayItem(*layoutView().layer(), DisplayItem::kSubsequence),
- TestDisplayItem(layoutView(), documentBackgroundType),
- TestDisplayItem(htmlLayer, DisplayItem::kSubsequence),
- TestDisplayItem(div, DisplayItem::kBeginCompositing),
- TestDisplayItem(subDiv, backgroundType),
- TestDisplayItem(div, DisplayItem::kEndCompositing),
- TestDisplayItem(htmlLayer, DisplayItem::kEndSubsequence),
- TestDisplayItem(*layoutView().layer(), DisplayItem::kEndSubsequence));
- } else {
- EXPECT_DISPLAY_LIST(
- rootPaintController().getDisplayItemList(), 10,
- TestDisplayItem(layoutView(),
- DisplayItem::kClipFrameToVisibleContentRect),
- TestDisplayItem(*layoutView().layer(), DisplayItem::kSubsequence),
- TestDisplayItem(layoutView(), documentBackgroundType),
- TestDisplayItem(htmlLayer, DisplayItem::kSubsequence),
- TestDisplayItem(div, DisplayItem::kBeginCompositing),
- TestDisplayItem(subDiv, backgroundType),
- TestDisplayItem(div, DisplayItem::kEndCompositing),
- TestDisplayItem(htmlLayer, DisplayItem::kEndSubsequence),
- TestDisplayItem(*layoutView().layer(), DisplayItem::kEndSubsequence),
- TestDisplayItem(layoutView(),
- DisplayItem::clipTypeToEndClipType(
- DisplayItem::kClipFrameToVisibleContentRect)));
- }
+ EXPECT_DISPLAY_LIST(
+ rootPaintController().getDisplayItemList(), 6,
+ TestDisplayItem(*layoutView().layer(), DisplayItem::kSubsequence),
+ TestDisplayItem(layoutView(), documentBackgroundType),
+ TestDisplayItem(htmlLayer, DisplayItem::kSubsequence),
+ TestDisplayItem(subDiv, backgroundType),
+ TestDisplayItem(htmlLayer, DisplayItem::kEndSubsequence),
+ TestDisplayItem(*layoutView().layer(), DisplayItem::kEndSubsequence));
}
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698