Index: Source/core/paint/ViewDisplayListTest.cpp |
diff --git a/Source/core/paint/ViewDisplayListTest.cpp b/Source/core/paint/ViewDisplayListTest.cpp |
index 280b7effe1ae1e5f6710adaeab949b93c24cce0a..ddbfdfa848ad77c5f0a0e1c63f8127d88d9c60ff 100644 |
--- a/Source/core/paint/ViewDisplayListTest.cpp |
+++ b/Source/core/paint/ViewDisplayListTest.cpp |
@@ -3,6 +3,7 @@ |
// found in the LICENSE file. |
#include "config.h" |
+#include "core/paint/ViewDisplayList.h" |
#include "core/paint/ClipRecorder.h" |
#include "core/paint/DrawingRecorder.h" |
@@ -10,8 +11,6 @@ |
#include "core/rendering/RenderingTestHelper.h" |
#include "core/rendering/compositing/RenderLayerCompositor.h" |
#include "platform/graphics/GraphicsContext.h" |
-#include "platform/graphics/GraphicsLayer.h" |
-#include "platform/graphics/paint/DisplayItemList.h" |
#include <gtest/gtest.h> |
namespace blink { |
@@ -23,7 +22,6 @@ public: |
protected: |
RenderView* renderView() { return m_renderView; } |
- DisplayItemList& rootDisplayItemList() { return renderView()->layer()->graphicsLayerBacking()->displayItemList(); } |
private: |
virtual void SetUp() override |
@@ -31,7 +29,6 @@ private: |
RuntimeEnabledFeatures::setSlimmingPaintEnabled(true); |
RenderingTest::SetUp(); |
- enableCompositing(); |
m_renderView = document().view()->renderView(); |
ASSERT_TRUE(m_renderView); |
@@ -61,7 +58,7 @@ TEST_F(ViewDisplayListTest, ViewDisplayListTest_NestedRecorders) |
FloatRect bound = renderView()->viewRect(); |
drawClippedRect(context, renderView(), PaintPhaseForeground, bound); |
- EXPECT_EQ((size_t)3, rootDisplayItemList().paintList().size()); |
+ EXPECT_EQ((size_t)3, renderView()->viewDisplayList().paintList().size()); |
// TODO(schenney): Check that the IDs are what we expect. |
} |
@@ -77,12 +74,12 @@ TEST_F(ViewDisplayListTest, ViewDisplayListTest_UpdateBasic) |
drawRect(context, second, PaintPhaseChildBlockBackground, FloatRect(100, 100, 200, 200)); |
drawRect(context, first, PaintPhaseOutline, FloatRect(100, 100, 300, 300)); |
- EXPECT_EQ((size_t)3, rootDisplayItemList().paintList().size()); |
+ EXPECT_EQ((size_t)3, renderView()->viewDisplayList().paintList().size()); |
- rootDisplayItemList().invalidate(second); |
+ renderView()->viewDisplayList().invalidate(second); |
drawRect(context, first, PaintPhaseBlockBackground, FloatRect(100, 100, 300, 300)); |
drawRect(context, first, PaintPhaseOutline, FloatRect(100, 100, 300, 300)); |
- EXPECT_EQ((size_t)2, rootDisplayItemList().paintList().size()); |
+ EXPECT_EQ((size_t)2, renderView()->viewDisplayList().paintList().size()); |
} |
TEST_F(ViewDisplayListTest, ViewDisplayListTest_UpdateSwapOrder) |
@@ -97,21 +94,21 @@ TEST_F(ViewDisplayListTest, ViewDisplayListTest_UpdateSwapOrder) |
drawRect(context, second, PaintPhaseBlockBackground, FloatRect(100, 100, 50, 200)); |
drawRect(context, unaffected, PaintPhaseBlockBackground, FloatRect(300, 300, 10, 10)); |
- const PaintList& firstList = rootDisplayItemList().paintList(); |
+ const PaintList& firstList = renderView()->viewDisplayList().paintList(); |
EXPECT_EQ((size_t)3, firstList.size()); |
- EXPECT_EQ(first, firstList[0]->client()); |
- EXPECT_EQ(second, firstList[1]->client()); |
- EXPECT_EQ(unaffected, firstList[2]->client()); |
+ EXPECT_EQ(first, firstList[0]->renderer()); |
+ EXPECT_EQ(second, firstList[1]->renderer()); |
+ EXPECT_EQ(unaffected, firstList[2]->renderer()); |
- rootDisplayItemList().invalidate(second); |
+ renderView()->viewDisplayList().invalidate(second); |
drawRect(context, second, PaintPhaseBlockBackground, FloatRect(100, 100, 50, 200)); |
drawRect(context, first, PaintPhaseBlockBackground, FloatRect(100, 100, 100, 100)); |
- const PaintList& secondList = rootDisplayItemList().paintList(); |
+ const PaintList& secondList = renderView()->viewDisplayList().paintList(); |
EXPECT_EQ((size_t)3, secondList.size()); |
- EXPECT_EQ(second, secondList[0]->client()); |
- EXPECT_EQ(first, secondList[1]->client()); |
- EXPECT_EQ(unaffected, secondList[2]->client()); |
+ EXPECT_EQ(second, secondList[0]->renderer()); |
+ EXPECT_EQ(first, secondList[1]->renderer()); |
+ EXPECT_EQ(unaffected, secondList[2]->renderer()); |
} |
TEST_F(ViewDisplayListTest, ViewDisplayListTest_UpdateNewItemInMiddle) |
@@ -125,21 +122,21 @@ TEST_F(ViewDisplayListTest, ViewDisplayListTest_UpdateNewItemInMiddle) |
drawRect(context, first, PaintPhaseBlockBackground, FloatRect(100, 100, 100, 100)); |
drawRect(context, second, PaintPhaseBlockBackground, FloatRect(100, 100, 50, 200)); |
- const PaintList& firstList = rootDisplayItemList().paintList(); |
+ const PaintList& firstList = renderView()->viewDisplayList().paintList(); |
EXPECT_EQ((size_t)2, firstList.size()); |
- EXPECT_EQ(first, firstList[0]->client()); |
- EXPECT_EQ(second, firstList[1]->client()); |
+ EXPECT_EQ(first, firstList[0]->renderer()); |
+ EXPECT_EQ(second, firstList[1]->renderer()); |
- rootDisplayItemList().invalidate(third); |
+ renderView()->viewDisplayList().invalidate(third); |
drawRect(context, first, PaintPhaseBlockBackground, FloatRect(100, 100, 100, 100)); |
drawRect(context, third, PaintPhaseBlockBackground, FloatRect(125, 100, 200, 50)); |
drawRect(context, second, PaintPhaseBlockBackground, FloatRect(100, 100, 50, 200)); |
- const PaintList& secondList = rootDisplayItemList().paintList(); |
+ const PaintList& secondList = renderView()->viewDisplayList().paintList(); |
EXPECT_EQ((size_t)3, secondList.size()); |
- EXPECT_EQ(first, secondList[0]->client()); |
- EXPECT_EQ(third, secondList[1]->client()); |
- EXPECT_EQ(second, secondList[2]->client()); |
+ EXPECT_EQ(first, secondList[0]->renderer()); |
+ EXPECT_EQ(third, secondList[1]->renderer()); |
+ EXPECT_EQ(second, secondList[2]->renderer()); |
} |
TEST_F(ViewDisplayListTest, ViewDisplayListTest_UpdateInvalidationWithPhases) |
@@ -160,15 +157,15 @@ TEST_F(ViewDisplayListTest, ViewDisplayListTest_UpdateInvalidationWithPhases) |
drawRect(context, second, PaintPhaseOutline, FloatRect(100, 100, 50, 200)); |
drawRect(context, third, PaintPhaseOutline, FloatRect(300, 100, 50, 50)); |
- const PaintList& firstList = rootDisplayItemList().paintList(); |
+ const PaintList& firstList = renderView()->viewDisplayList().paintList(); |
EXPECT_EQ((size_t)9, firstList.size()); |
for (int item = 0; item < 9; item += 3) { |
- EXPECT_EQ(first, firstList[item % 3 + 0]->client()); |
- EXPECT_EQ(second, firstList[item % 3 + 1]->client()); |
- EXPECT_EQ(third, firstList[item % 3 + 2]->client()); |
+ EXPECT_EQ(first, firstList[item % 3 + 0]->renderer()); |
+ EXPECT_EQ(second, firstList[item % 3 + 1]->renderer()); |
+ EXPECT_EQ(third, firstList[item % 3 + 2]->renderer()); |
} |
- rootDisplayItemList().invalidate(second); |
+ renderView()->viewDisplayList().invalidate(second); |
drawRect(context, first, PaintPhaseBlockBackground, FloatRect(100, 100, 100, 100)); |
drawRect(context, second, PaintPhaseBlockBackground, FloatRect(100, 100, 50, 200)); |
drawRect(context, first, PaintPhaseForeground, FloatRect(100, 100, 100, 100)); |
@@ -176,20 +173,20 @@ TEST_F(ViewDisplayListTest, ViewDisplayListTest_UpdateInvalidationWithPhases) |
drawRect(context, first, PaintPhaseOutline, FloatRect(100, 100, 100, 100)); |
drawRect(context, second, PaintPhaseOutline, FloatRect(100, 100, 50, 200)); |
- const PaintList& secondList = rootDisplayItemList().paintList(); |
+ const PaintList& secondList = renderView()->viewDisplayList().paintList(); |
EXPECT_EQ((size_t)9, secondList.size()); |
for (int item = 0; item < 9; item += 3) { |
- EXPECT_EQ(first, secondList[item % 3 + 0]->client()); |
- EXPECT_EQ(second, secondList[item % 3 + 1]->client()); |
- EXPECT_EQ(third, secondList[item % 3 + 2]->client()); |
+ EXPECT_EQ(first, secondList[item % 3 + 0]->renderer()); |
+ EXPECT_EQ(second, secondList[item % 3 + 1]->renderer()); |
+ EXPECT_EQ(third, secondList[item % 3 + 2]->renderer()); |
} |
- rootDisplayItemList().invalidate(second); |
- const PaintList& thirdList = rootDisplayItemList().paintList(); |
+ renderView()->viewDisplayList().invalidate(second); |
+ const PaintList& thirdList = renderView()->viewDisplayList().paintList(); |
EXPECT_EQ((size_t)6, thirdList.size()); |
for (int item = 0; item < 6; item += 2) { |
- EXPECT_EQ(first, thirdList[item % 2 + 0]->client()); |
- EXPECT_EQ(third, thirdList[item % 2 + 1]->client()); |
+ EXPECT_EQ(first, thirdList[item % 2 + 0]->renderer()); |
+ EXPECT_EQ(third, thirdList[item % 2 + 1]->renderer()); |
} |
} |
@@ -203,27 +200,27 @@ TEST_F(ViewDisplayListTest, ViewDisplayListTest_UpdateAddFirstNoOverlap) |
drawRect(context, second, PaintPhaseBlockBackground, FloatRect(200, 200, 50, 50)); |
drawRect(context, second, PaintPhaseOutline, FloatRect(200, 200, 50, 50)); |
- const PaintList& firstList = rootDisplayItemList().paintList(); |
+ const PaintList& firstList = renderView()->viewDisplayList().paintList(); |
EXPECT_EQ((size_t)2, firstList.size()); |
- EXPECT_EQ(second, firstList[0]->client()); |
- EXPECT_EQ(second, firstList[1]->client()); |
+ EXPECT_EQ(second, firstList[0]->renderer()); |
+ EXPECT_EQ(second, firstList[1]->renderer()); |
- rootDisplayItemList().invalidate(first); |
+ renderView()->viewDisplayList().invalidate(first); |
drawRect(context, first, PaintPhaseBlockBackground, FloatRect(100, 100, 50, 50)); |
drawRect(context, first, PaintPhaseOutline, FloatRect(100, 100, 50, 50)); |
- const PaintList& secondList = rootDisplayItemList().paintList(); |
+ const PaintList& secondList = renderView()->viewDisplayList().paintList(); |
EXPECT_EQ((size_t)4, secondList.size()); |
- EXPECT_EQ(first, secondList[0]->client()); |
- EXPECT_EQ(first, secondList[1]->client()); |
- EXPECT_EQ(second, secondList[2]->client()); |
- EXPECT_EQ(second, secondList[3]->client()); |
+ EXPECT_EQ(first, secondList[0]->renderer()); |
+ EXPECT_EQ(first, secondList[1]->renderer()); |
+ EXPECT_EQ(second, secondList[2]->renderer()); |
+ EXPECT_EQ(second, secondList[3]->renderer()); |
- rootDisplayItemList().invalidate(first); |
- const PaintList& thirdList = rootDisplayItemList().paintList(); |
+ renderView()->viewDisplayList().invalidate(first); |
+ const PaintList& thirdList = renderView()->viewDisplayList().paintList(); |
EXPECT_EQ((size_t)2, thirdList.size()); |
- EXPECT_EQ(second, thirdList[0]->client()); |
- EXPECT_EQ(second, thirdList[1]->client()); |
+ EXPECT_EQ(second, thirdList[0]->renderer()); |
+ EXPECT_EQ(second, thirdList[1]->renderer()); |
} |
TEST_F(ViewDisplayListTest, ViewDisplayListTest_UpdateAddFirstOverlap) |
@@ -236,33 +233,33 @@ TEST_F(ViewDisplayListTest, ViewDisplayListTest_UpdateAddFirstOverlap) |
drawRect(context, second, PaintPhaseBlockBackground, FloatRect(200, 200, 50, 50)); |
drawRect(context, second, PaintPhaseOutline, FloatRect(200, 200, 50, 50)); |
- const PaintList& firstList = rootDisplayItemList().paintList(); |
+ const PaintList& firstList = renderView()->viewDisplayList().paintList(); |
EXPECT_EQ((size_t)2, firstList.size()); |
- EXPECT_EQ(second, firstList[0]->client()); |
- EXPECT_EQ(second, firstList[1]->client()); |
+ EXPECT_EQ(second, firstList[0]->renderer()); |
+ EXPECT_EQ(second, firstList[1]->renderer()); |
- rootDisplayItemList().invalidate(first); |
- rootDisplayItemList().invalidate(second); |
+ renderView()->viewDisplayList().invalidate(first); |
+ renderView()->viewDisplayList().invalidate(second); |
drawRect(context, first, PaintPhaseBlockBackground, FloatRect(100, 100, 150, 150)); |
drawRect(context, first, PaintPhaseOutline, FloatRect(100, 100, 150, 150)); |
drawRect(context, second, PaintPhaseBlockBackground, FloatRect(200, 200, 50, 50)); |
drawRect(context, second, PaintPhaseOutline, FloatRect(200, 200, 50, 50)); |
- const PaintList& secondList = rootDisplayItemList().paintList(); |
+ const PaintList& secondList = renderView()->viewDisplayList().paintList(); |
EXPECT_EQ((size_t)4, secondList.size()); |
- EXPECT_EQ(first, secondList[0]->client()); |
- EXPECT_EQ(first, secondList[1]->client()); |
- EXPECT_EQ(second, secondList[2]->client()); |
- EXPECT_EQ(second, secondList[3]->client()); |
+ EXPECT_EQ(first, secondList[0]->renderer()); |
+ EXPECT_EQ(first, secondList[1]->renderer()); |
+ EXPECT_EQ(second, secondList[2]->renderer()); |
+ EXPECT_EQ(second, secondList[3]->renderer()); |
- rootDisplayItemList().invalidate(first); |
+ renderView()->viewDisplayList().invalidate(first); |
drawRect(context, second, PaintPhaseBlockBackground, FloatRect(200, 200, 50, 50)); |
drawRect(context, second, PaintPhaseOutline, FloatRect(200, 200, 50, 50)); |
- const PaintList& thirdList = rootDisplayItemList().paintList(); |
+ const PaintList& thirdList = renderView()->viewDisplayList().paintList(); |
EXPECT_EQ((size_t)2, thirdList.size()); |
- EXPECT_EQ(second, thirdList[0]->client()); |
- EXPECT_EQ(second, thirdList[1]->client()); |
+ EXPECT_EQ(second, thirdList[0]->renderer()); |
+ EXPECT_EQ(second, thirdList[1]->renderer()); |
} |
TEST_F(ViewDisplayListTest, ViewDisplayListTest_UpdateAddLastNoOverlap) |
@@ -275,27 +272,27 @@ TEST_F(ViewDisplayListTest, ViewDisplayListTest_UpdateAddLastNoOverlap) |
drawRect(context, first, PaintPhaseBlockBackground, FloatRect(100, 100, 50, 50)); |
drawRect(context, first, PaintPhaseOutline, FloatRect(100, 100, 50, 50)); |
- const PaintList& firstList = rootDisplayItemList().paintList(); |
+ const PaintList& firstList = renderView()->viewDisplayList().paintList(); |
EXPECT_EQ((size_t)2, firstList.size()); |
- EXPECT_EQ(first, firstList[0]->client()); |
- EXPECT_EQ(first, firstList[1]->client()); |
+ EXPECT_EQ(first, firstList[0]->renderer()); |
+ EXPECT_EQ(first, firstList[1]->renderer()); |
- rootDisplayItemList().invalidate(second); |
+ renderView()->viewDisplayList().invalidate(second); |
drawRect(context, second, PaintPhaseBlockBackground, FloatRect(200, 200, 50, 50)); |
drawRect(context, second, PaintPhaseOutline, FloatRect(200, 200, 50, 50)); |
- const PaintList& secondList = rootDisplayItemList().paintList(); |
+ const PaintList& secondList = renderView()->viewDisplayList().paintList(); |
EXPECT_EQ((size_t)4, secondList.size()); |
- EXPECT_EQ(second, secondList[0]->client()); |
- EXPECT_EQ(second, secondList[1]->client()); |
- EXPECT_EQ(first, secondList[2]->client()); |
- EXPECT_EQ(first, secondList[3]->client()); |
+ EXPECT_EQ(second, secondList[0]->renderer()); |
+ EXPECT_EQ(second, secondList[1]->renderer()); |
+ EXPECT_EQ(first, secondList[2]->renderer()); |
+ EXPECT_EQ(first, secondList[3]->renderer()); |
- rootDisplayItemList().invalidate(second); |
- const PaintList& thirdList = rootDisplayItemList().paintList(); |
+ renderView()->viewDisplayList().invalidate(second); |
+ const PaintList& thirdList = renderView()->viewDisplayList().paintList(); |
EXPECT_EQ((size_t)2, thirdList.size()); |
- EXPECT_EQ(first, thirdList[0]->client()); |
- EXPECT_EQ(first, thirdList[1]->client()); |
+ EXPECT_EQ(first, thirdList[0]->renderer()); |
+ EXPECT_EQ(first, thirdList[1]->renderer()); |
} |
TEST_F(ViewDisplayListTest, ViewDisplayListTest_UpdateAddLastOverlap) |
@@ -308,34 +305,34 @@ TEST_F(ViewDisplayListTest, ViewDisplayListTest_UpdateAddLastOverlap) |
drawRect(context, first, PaintPhaseBlockBackground, FloatRect(100, 100, 150, 150)); |
drawRect(context, first, PaintPhaseOutline, FloatRect(100, 100, 150, 150)); |
- const PaintList& firstList = rootDisplayItemList().paintList(); |
+ const PaintList& firstList = renderView()->viewDisplayList().paintList(); |
EXPECT_EQ((size_t)2, firstList.size()); |
- EXPECT_EQ(first, firstList[0]->client()); |
- EXPECT_EQ(first, firstList[1]->client()); |
+ EXPECT_EQ(first, firstList[0]->renderer()); |
+ EXPECT_EQ(first, firstList[1]->renderer()); |
- rootDisplayItemList().invalidate(first); |
- rootDisplayItemList().invalidate(second); |
+ renderView()->viewDisplayList().invalidate(first); |
+ renderView()->viewDisplayList().invalidate(second); |
drawRect(context, first, PaintPhaseBlockBackground, FloatRect(100, 100, 150, 150)); |
drawRect(context, first, PaintPhaseOutline, FloatRect(100, 100, 150, 150)); |
drawRect(context, second, PaintPhaseBlockBackground, FloatRect(200, 200, 50, 50)); |
drawRect(context, second, PaintPhaseOutline, FloatRect(200, 200, 50, 50)); |
- const PaintList& secondList = rootDisplayItemList().paintList(); |
+ const PaintList& secondList = renderView()->viewDisplayList().paintList(); |
EXPECT_EQ((size_t)4, secondList.size()); |
- EXPECT_EQ(first, secondList[0]->client()); |
- EXPECT_EQ(first, secondList[1]->client()); |
- EXPECT_EQ(second, secondList[2]->client()); |
- EXPECT_EQ(second, secondList[3]->client()); |
+ EXPECT_EQ(first, secondList[0]->renderer()); |
+ EXPECT_EQ(first, secondList[1]->renderer()); |
+ EXPECT_EQ(second, secondList[2]->renderer()); |
+ EXPECT_EQ(second, secondList[3]->renderer()); |
- rootDisplayItemList().invalidate(first); |
- rootDisplayItemList().invalidate(second); |
+ renderView()->viewDisplayList().invalidate(first); |
+ renderView()->viewDisplayList().invalidate(second); |
drawRect(context, first, PaintPhaseBlockBackground, FloatRect(100, 100, 150, 150)); |
drawRect(context, first, PaintPhaseOutline, FloatRect(100, 100, 150, 150)); |
- const PaintList& thirdList = rootDisplayItemList().paintList(); |
+ const PaintList& thirdList = renderView()->viewDisplayList().paintList(); |
EXPECT_EQ((size_t)2, thirdList.size()); |
- EXPECT_EQ(first, thirdList[0]->client()); |
- EXPECT_EQ(first, thirdList[1]->client()); |
+ EXPECT_EQ(first, thirdList[0]->renderer()); |
+ EXPECT_EQ(first, thirdList[1]->renderer()); |
} |
} |