| Index: third_party/WebKit/Source/core/paint/PaintLayerPainterTest.cpp
|
| diff --git a/third_party/WebKit/Source/core/paint/PaintLayerPainterTest.cpp b/third_party/WebKit/Source/core/paint/PaintLayerPainterTest.cpp
|
| index 65b2c8d87739776adc43a5a3650f8ddba9e76dd8..b4ba282dd2e767e1fc4cc217cda5e31670281460 100644
|
| --- a/third_party/WebKit/Source/core/paint/PaintLayerPainterTest.cpp
|
| +++ b/third_party/WebKit/Source/core/paint/PaintLayerPainterTest.cpp
|
| @@ -44,35 +44,39 @@ TEST_P(PaintLayerPainterTest, CachedSubsequence)
|
| LayoutObject& container2 = *document().getElementById("container2")->layoutObject();
|
| PaintLayer& container2Layer = *toLayoutBoxModelObject(container2).layer();
|
| LayoutObject& content2 = *document().getElementById("content2")->layoutObject();
|
| + DisplayItemClientWrapper rootLayerClient(rootLayer.displayItemClientForNormalAndPositiveZOrderChildren());
|
| + DisplayItemClientWrapper htmlLayerClient(htmlLayer.displayItemClientForNormalAndPositiveZOrderChildren());
|
| + DisplayItemClientWrapper container1LayerClient(container1Layer.displayItemClientForNormalAndPositiveZOrderChildren());
|
| + DisplayItemClientWrapper container2LayerClient(container2Layer.displayItemClientForNormalAndPositiveZOrderChildren());
|
|
|
| if (rootLayerScrolls) {
|
| EXPECT_DISPLAY_LIST(rootPaintController().displayItemList(), 11,
|
| TestDisplayItem(layoutView(), backgroundType),
|
| - TestDisplayItem(rootLayer, subsequenceType),
|
| + TestDisplayItem(rootLayerClient, DisplayItem::Subsequence),
|
| TestDisplayItem(container1, backgroundType),
|
| - TestDisplayItem(container1Layer, subsequenceType),
|
| + TestDisplayItem(container1LayerClient, DisplayItem::Subsequence),
|
| TestDisplayItem(content1, backgroundType),
|
| - TestDisplayItem(container1Layer, endSubsequenceType),
|
| + TestDisplayItem(container1LayerClient, DisplayItem::EndSubsequence),
|
| TestDisplayItem(container2, backgroundType),
|
| - TestDisplayItem(container2Layer, subsequenceType),
|
| + TestDisplayItem(container2LayerClient, DisplayItem::Subsequence),
|
| TestDisplayItem(content2, backgroundType),
|
| - TestDisplayItem(container2Layer, endSubsequenceType),
|
| - TestDisplayItem(rootLayer, endSubsequenceType));
|
| + TestDisplayItem(container2LayerClient, DisplayItem::EndSubsequence),
|
| + TestDisplayItem(rootLayerClient, DisplayItem::EndSubsequence));
|
| } else {
|
| EXPECT_DISPLAY_LIST(rootPaintController().displayItemList(), 13,
|
| TestDisplayItem(layoutView(), backgroundType),
|
| - TestDisplayItem(rootLayer, subsequenceType),
|
| - TestDisplayItem(htmlLayer, subsequenceType),
|
| + TestDisplayItem(rootLayerClient, DisplayItem::Subsequence),
|
| + TestDisplayItem(htmlLayerClient, DisplayItem::Subsequence),
|
| TestDisplayItem(container1, backgroundType),
|
| - TestDisplayItem(container1Layer, subsequenceType),
|
| + TestDisplayItem(container1LayerClient, DisplayItem::Subsequence),
|
| TestDisplayItem(content1, backgroundType),
|
| - TestDisplayItem(container1Layer, endSubsequenceType),
|
| + TestDisplayItem(container1LayerClient, DisplayItem::EndSubsequence),
|
| TestDisplayItem(container2, backgroundType),
|
| - TestDisplayItem(container2Layer, subsequenceType),
|
| + TestDisplayItem(container2LayerClient, DisplayItem::Subsequence),
|
| TestDisplayItem(content2, backgroundType),
|
| - TestDisplayItem(container2Layer, endSubsequenceType),
|
| - TestDisplayItem(htmlLayer, endSubsequenceType),
|
| - TestDisplayItem(rootLayer, endSubsequenceType));
|
| + TestDisplayItem(container2LayerClient, DisplayItem::EndSubsequence),
|
| + TestDisplayItem(htmlLayerClient, DisplayItem::EndSubsequence),
|
| + TestDisplayItem(rootLayerClient, DisplayItem::EndSubsequence));
|
| }
|
|
|
| toHTMLElement(content1.node())->setAttribute(HTMLNames::styleAttr, "position: absolute; width: 100px; height: 100px; background-color: green");
|
| @@ -82,27 +86,27 @@ TEST_P(PaintLayerPainterTest, CachedSubsequence)
|
| if (rootLayerScrolls) {
|
| EXPECT_DISPLAY_LIST(rootPaintController().newDisplayItemList(), 9,
|
| TestDisplayItem(layoutView(), cachedBackgroundType),
|
| - TestDisplayItem(rootLayer, subsequenceType),
|
| + TestDisplayItem(rootLayerClient, DisplayItem::Subsequence),
|
| TestDisplayItem(container1, cachedBackgroundType),
|
| - TestDisplayItem(container1Layer, subsequenceType),
|
| + TestDisplayItem(container1LayerClient, DisplayItem::Subsequence),
|
| TestDisplayItem(content1, backgroundType),
|
| - TestDisplayItem(container1Layer, endSubsequenceType),
|
| + TestDisplayItem(container1LayerClient, DisplayItem::EndSubsequence),
|
| TestDisplayItem(container2, cachedBackgroundType),
|
| - TestDisplayItem(container2Layer, cachedSubsequenceType),
|
| - TestDisplayItem(rootLayer, endSubsequenceType));
|
| + TestDisplayItem(container2LayerClient, DisplayItem::CachedSubsequence),
|
| + TestDisplayItem(rootLayerClient, DisplayItem::EndSubsequence));
|
| } else {
|
| EXPECT_DISPLAY_LIST(rootPaintController().newDisplayItemList(), 11,
|
| TestDisplayItem(layoutView(), cachedBackgroundType),
|
| - TestDisplayItem(rootLayer, subsequenceType),
|
| - TestDisplayItem(htmlLayer, subsequenceType),
|
| + TestDisplayItem(rootLayerClient, DisplayItem::Subsequence),
|
| + TestDisplayItem(htmlLayerClient, DisplayItem::Subsequence),
|
| TestDisplayItem(container1, cachedBackgroundType),
|
| - TestDisplayItem(container1Layer, subsequenceType),
|
| + TestDisplayItem(container1LayerClient, DisplayItem::Subsequence),
|
| TestDisplayItem(content1, backgroundType),
|
| - TestDisplayItem(container1Layer, endSubsequenceType),
|
| + TestDisplayItem(container1LayerClient, DisplayItem::EndSubsequence),
|
| TestDisplayItem(container2, cachedBackgroundType),
|
| - TestDisplayItem(container2Layer, cachedSubsequenceType),
|
| - TestDisplayItem(htmlLayer, endSubsequenceType),
|
| - TestDisplayItem(rootLayer, endSubsequenceType));
|
| + TestDisplayItem(container2LayerClient, DisplayItem::CachedSubsequence),
|
| + TestDisplayItem(htmlLayerClient, DisplayItem::EndSubsequence),
|
| + TestDisplayItem(rootLayerClient, DisplayItem::EndSubsequence));
|
| }
|
|
|
| commit();
|
| @@ -110,31 +114,31 @@ TEST_P(PaintLayerPainterTest, CachedSubsequence)
|
| if (rootLayerScrolls) {
|
| EXPECT_DISPLAY_LIST(rootPaintController().displayItemList(), 11,
|
| TestDisplayItem(layoutView(), backgroundType),
|
| - TestDisplayItem(rootLayer, subsequenceType),
|
| + TestDisplayItem(rootLayerClient, DisplayItem::Subsequence),
|
| TestDisplayItem(container1, backgroundType),
|
| - TestDisplayItem(container1Layer, subsequenceType),
|
| + TestDisplayItem(container1LayerClient, DisplayItem::Subsequence),
|
| TestDisplayItem(content1, backgroundType),
|
| - TestDisplayItem(container1Layer, endSubsequenceType),
|
| + TestDisplayItem(container1LayerClient, DisplayItem::EndSubsequence),
|
| TestDisplayItem(container2, backgroundType),
|
| - TestDisplayItem(container2Layer, subsequenceType),
|
| + TestDisplayItem(container2LayerClient, DisplayItem::Subsequence),
|
| TestDisplayItem(content2, backgroundType),
|
| - TestDisplayItem(container2Layer, endSubsequenceType),
|
| - TestDisplayItem(rootLayer, endSubsequenceType));
|
| + TestDisplayItem(container2LayerClient, DisplayItem::EndSubsequence),
|
| + TestDisplayItem(rootLayerClient, DisplayItem::EndSubsequence));
|
| } else {
|
| EXPECT_DISPLAY_LIST(rootPaintController().displayItemList(), 13,
|
| TestDisplayItem(layoutView(), backgroundType),
|
| - TestDisplayItem(rootLayer, subsequenceType),
|
| - TestDisplayItem(htmlLayer, subsequenceType),
|
| + TestDisplayItem(rootLayerClient, DisplayItem::Subsequence),
|
| + TestDisplayItem(htmlLayerClient, DisplayItem::Subsequence),
|
| TestDisplayItem(container1, backgroundType),
|
| - TestDisplayItem(container1Layer, subsequenceType),
|
| + TestDisplayItem(container1LayerClient, DisplayItem::Subsequence),
|
| TestDisplayItem(content1, backgroundType),
|
| - TestDisplayItem(container1Layer, endSubsequenceType),
|
| + TestDisplayItem(container1LayerClient, DisplayItem::EndSubsequence),
|
| TestDisplayItem(container2, backgroundType),
|
| - TestDisplayItem(container2Layer, subsequenceType),
|
| + TestDisplayItem(container2LayerClient, DisplayItem::Subsequence),
|
| TestDisplayItem(content2, backgroundType),
|
| - TestDisplayItem(container2Layer, endSubsequenceType),
|
| - TestDisplayItem(htmlLayer, endSubsequenceType),
|
| - TestDisplayItem(rootLayer, endSubsequenceType));
|
| + TestDisplayItem(container2LayerClient, DisplayItem::EndSubsequence),
|
| + TestDisplayItem(htmlLayerClient, DisplayItem::EndSubsequence),
|
| + TestDisplayItem(rootLayerClient, DisplayItem::EndSubsequence));
|
| }
|
| }
|
|
|
| @@ -168,6 +172,11 @@ TEST_P(PaintLayerPainterTest, CachedSubsequenceOnInterestRectChange)
|
| LayoutObject& container3 = *document().getElementById("container3")->layoutObject();
|
| PaintLayer& container3Layer = *toLayoutBoxModelObject(container3).layer();
|
| LayoutObject& content3 = *document().getElementById("content3")->layoutObject();
|
| + DisplayItemClientWrapper rootLayerClient(rootLayer.displayItemClientForNormalAndPositiveZOrderChildren());
|
| + DisplayItemClientWrapper htmlLayerClient(htmlLayer.displayItemClientForNormalAndPositiveZOrderChildren());
|
| + DisplayItemClientWrapper container1LayerClient(container1Layer.displayItemClientForNormalAndPositiveZOrderChildren());
|
| + DisplayItemClientWrapper container2LayerClient(container2Layer.displayItemClientForNormalAndPositiveZOrderChildren());
|
| + DisplayItemClientWrapper container3LayerClient(container3Layer.displayItemClientForNormalAndPositiveZOrderChildren());
|
|
|
| updateLifecyclePhasesBeforePaint();
|
| IntRect interestRect(0, 0, 400, 300);
|
| @@ -181,39 +190,39 @@ TEST_P(PaintLayerPainterTest, CachedSubsequenceOnInterestRectChange)
|
| if (rootLayerScrolls) {
|
| EXPECT_DISPLAY_LIST(rootPaintController().displayItemList(), 15,
|
| TestDisplayItem(layoutView(), backgroundType),
|
| - TestDisplayItem(rootLayer, subsequenceType),
|
| + TestDisplayItem(rootLayerClient, DisplayItem::Subsequence),
|
| TestDisplayItem(container1, backgroundType),
|
| - TestDisplayItem(container1Layer, subsequenceType),
|
| + TestDisplayItem(container1LayerClient, DisplayItem::Subsequence),
|
| TestDisplayItem(content1, backgroundType),
|
| - TestDisplayItem(container1Layer, endSubsequenceType),
|
| + TestDisplayItem(container1LayerClient, DisplayItem::EndSubsequence),
|
| TestDisplayItem(container2, backgroundType),
|
| - TestDisplayItem(container2Layer, subsequenceType),
|
| + TestDisplayItem(container2LayerClient, DisplayItem::Subsequence),
|
| TestDisplayItem(content2a, backgroundType),
|
| - TestDisplayItem(container2Layer, endSubsequenceType),
|
| + TestDisplayItem(container2LayerClient, DisplayItem::EndSubsequence),
|
| TestDisplayItem(container3, backgroundType),
|
| - TestDisplayItem(container3Layer, subsequenceType),
|
| + TestDisplayItem(container3LayerClient, DisplayItem::Subsequence),
|
| TestDisplayItem(content3, backgroundType),
|
| - TestDisplayItem(container3Layer, endSubsequenceType),
|
| - TestDisplayItem(rootLayer, endSubsequenceType));
|
| + TestDisplayItem(container3LayerClient, DisplayItem::EndSubsequence),
|
| + TestDisplayItem(rootLayerClient, DisplayItem::EndSubsequence));
|
| } else {
|
| EXPECT_DISPLAY_LIST(rootPaintController().displayItemList(), 17,
|
| TestDisplayItem(layoutView(), backgroundType),
|
| - TestDisplayItem(rootLayer, subsequenceType),
|
| - TestDisplayItem(htmlLayer, subsequenceType),
|
| + TestDisplayItem(rootLayerClient, DisplayItem::Subsequence),
|
| + TestDisplayItem(htmlLayerClient, DisplayItem::Subsequence),
|
| TestDisplayItem(container1, backgroundType),
|
| - TestDisplayItem(container1Layer, subsequenceType),
|
| + TestDisplayItem(container1LayerClient, DisplayItem::Subsequence),
|
| TestDisplayItem(content1, backgroundType),
|
| - TestDisplayItem(container1Layer, endSubsequenceType),
|
| + TestDisplayItem(container1LayerClient, DisplayItem::EndSubsequence),
|
| TestDisplayItem(container2, backgroundType),
|
| - TestDisplayItem(container2Layer, subsequenceType),
|
| + TestDisplayItem(container2LayerClient, DisplayItem::Subsequence),
|
| TestDisplayItem(content2a, backgroundType),
|
| - TestDisplayItem(container2Layer, endSubsequenceType),
|
| + TestDisplayItem(container2LayerClient, DisplayItem::EndSubsequence),
|
| TestDisplayItem(container3, backgroundType),
|
| - TestDisplayItem(container3Layer, subsequenceType),
|
| + TestDisplayItem(container3LayerClient, DisplayItem::Subsequence),
|
| TestDisplayItem(content3, backgroundType),
|
| - TestDisplayItem(container3Layer, endSubsequenceType),
|
| - TestDisplayItem(htmlLayer, endSubsequenceType),
|
| - TestDisplayItem(rootLayer, endSubsequenceType));
|
| + TestDisplayItem(container3LayerClient, DisplayItem::EndSubsequence),
|
| + TestDisplayItem(htmlLayerClient, DisplayItem::EndSubsequence),
|
| + TestDisplayItem(rootLayerClient, DisplayItem::EndSubsequence));
|
| }
|
|
|
| updateLifecyclePhasesBeforePaint();
|
| @@ -229,29 +238,29 @@ TEST_P(PaintLayerPainterTest, CachedSubsequenceOnInterestRectChange)
|
| if (rootLayerScrolls) {
|
| EXPECT_DISPLAY_LIST(rootPaintController().newDisplayItemList(), 10,
|
| TestDisplayItem(layoutView(), cachedBackgroundType),
|
| - TestDisplayItem(rootLayer, subsequenceType),
|
| + TestDisplayItem(rootLayerClient, DisplayItem::Subsequence),
|
| TestDisplayItem(container1, cachedBackgroundType),
|
| - TestDisplayItem(container1Layer, cachedSubsequenceType),
|
| + TestDisplayItem(container1LayerClient, DisplayItem::CachedSubsequence),
|
| TestDisplayItem(container2, cachedBackgroundType),
|
| - TestDisplayItem(container2Layer, subsequenceType),
|
| + TestDisplayItem(container2LayerClient, DisplayItem::Subsequence),
|
| TestDisplayItem(content2a, cachedBackgroundType),
|
| TestDisplayItem(content2b, backgroundType),
|
| - TestDisplayItem(container2Layer, endSubsequenceType),
|
| - TestDisplayItem(rootLayer, endSubsequenceType));
|
| + TestDisplayItem(container2LayerClient, DisplayItem::EndSubsequence),
|
| + TestDisplayItem(rootLayerClient, DisplayItem::EndSubsequence));
|
| } else {
|
| EXPECT_DISPLAY_LIST(rootPaintController().newDisplayItemList(), 12,
|
| TestDisplayItem(layoutView(), cachedBackgroundType),
|
| - TestDisplayItem(rootLayer, subsequenceType),
|
| - TestDisplayItem(htmlLayer, subsequenceType),
|
| + TestDisplayItem(rootLayerClient, DisplayItem::Subsequence),
|
| + TestDisplayItem(htmlLayerClient, DisplayItem::Subsequence),
|
| TestDisplayItem(container1, cachedBackgroundType),
|
| - TestDisplayItem(container1Layer, cachedSubsequenceType),
|
| + TestDisplayItem(container1LayerClient, DisplayItem::CachedSubsequence),
|
| TestDisplayItem(container2, cachedBackgroundType),
|
| - TestDisplayItem(container2Layer, subsequenceType),
|
| + TestDisplayItem(container2LayerClient, DisplayItem::Subsequence),
|
| TestDisplayItem(content2a, cachedBackgroundType),
|
| TestDisplayItem(content2b, backgroundType),
|
| - TestDisplayItem(container2Layer, endSubsequenceType),
|
| - TestDisplayItem(htmlLayer, endSubsequenceType),
|
| - TestDisplayItem(rootLayer, endSubsequenceType));
|
| + TestDisplayItem(container2LayerClient, DisplayItem::EndSubsequence),
|
| + TestDisplayItem(htmlLayerClient, DisplayItem::EndSubsequence),
|
| + TestDisplayItem(rootLayerClient, DisplayItem::EndSubsequence));
|
| }
|
|
|
| commit();
|
| @@ -259,33 +268,33 @@ TEST_P(PaintLayerPainterTest, CachedSubsequenceOnInterestRectChange)
|
| if (rootLayerScrolls) {
|
| EXPECT_DISPLAY_LIST(rootPaintController().displayItemList(), 12,
|
| TestDisplayItem(layoutView(), backgroundType),
|
| - TestDisplayItem(rootLayer, subsequenceType),
|
| + TestDisplayItem(rootLayerClient, DisplayItem::Subsequence),
|
| TestDisplayItem(container1, backgroundType),
|
| - TestDisplayItem(container1Layer, subsequenceType),
|
| + TestDisplayItem(container1LayerClient, DisplayItem::Subsequence),
|
| TestDisplayItem(content1, backgroundType),
|
| - TestDisplayItem(container1Layer, endSubsequenceType),
|
| + TestDisplayItem(container1LayerClient, DisplayItem::EndSubsequence),
|
| TestDisplayItem(container2, backgroundType),
|
| - TestDisplayItem(container2Layer, subsequenceType),
|
| + TestDisplayItem(container2LayerClient, DisplayItem::Subsequence),
|
| TestDisplayItem(content2a, backgroundType),
|
| TestDisplayItem(content2b, backgroundType),
|
| - TestDisplayItem(container2Layer, endSubsequenceType),
|
| - TestDisplayItem(rootLayer, endSubsequenceType));
|
| + TestDisplayItem(container2LayerClient, DisplayItem::EndSubsequence),
|
| + TestDisplayItem(rootLayerClient, DisplayItem::EndSubsequence));
|
| } else {
|
| EXPECT_DISPLAY_LIST(rootPaintController().displayItemList(), 14,
|
| TestDisplayItem(layoutView(), backgroundType),
|
| - TestDisplayItem(rootLayer, subsequenceType),
|
| - TestDisplayItem(htmlLayer, subsequenceType),
|
| + TestDisplayItem(rootLayerClient, DisplayItem::Subsequence),
|
| + TestDisplayItem(htmlLayerClient, DisplayItem::Subsequence),
|
| TestDisplayItem(container1, backgroundType),
|
| - TestDisplayItem(container1Layer, subsequenceType),
|
| + TestDisplayItem(container1LayerClient, DisplayItem::Subsequence),
|
| TestDisplayItem(content1, backgroundType),
|
| - TestDisplayItem(container1Layer, endSubsequenceType),
|
| + TestDisplayItem(container1LayerClient, DisplayItem::EndSubsequence),
|
| TestDisplayItem(container2, backgroundType),
|
| - TestDisplayItem(container2Layer, subsequenceType),
|
| + TestDisplayItem(container2LayerClient, DisplayItem::Subsequence),
|
| TestDisplayItem(content2a, backgroundType),
|
| TestDisplayItem(content2b, backgroundType),
|
| - TestDisplayItem(container2Layer, endSubsequenceType),
|
| - TestDisplayItem(htmlLayer, endSubsequenceType),
|
| - TestDisplayItem(rootLayer, endSubsequenceType));
|
| + TestDisplayItem(container2LayerClient, DisplayItem::EndSubsequence),
|
| + TestDisplayItem(htmlLayerClient, DisplayItem::EndSubsequence),
|
| + TestDisplayItem(rootLayerClient, DisplayItem::EndSubsequence));
|
| }
|
| }
|
|
|
|
|