Index: Source/platform/graphics/paint/DisplayItemListTest.cpp |
diff --git a/Source/platform/graphics/paint/DisplayItemListTest.cpp b/Source/platform/graphics/paint/DisplayItemListTest.cpp |
index 59e7642e15a0df630c18a0e3f31dec68c67c752b..f7078500ea3beb13f779406f3d4cc04040f506ae 100644 |
--- a/Source/platform/graphics/paint/DisplayItemListTest.cpp |
+++ b/Source/platform/graphics/paint/DisplayItemListTest.cpp |
@@ -463,25 +463,21 @@ TEST_F(DisplayItemListTest, CachedSubtreeSwapOrder) |
{ |
SubtreeRecorder r(context, container1, backgroundPaintPhase); |
- EXPECT_FALSE(r.canUseCache()); |
drawRect(context, container1, backgroundDrawingType, FloatRect(100, 100, 100, 100)); |
drawRect(context, content1, backgroundDrawingType, FloatRect(100, 100, 50, 200)); |
} |
{ |
SubtreeRecorder r(context, container1, foregroundPaintPhase); |
- EXPECT_FALSE(r.canUseCache()); |
drawRect(context, content1, foregroundDrawingType, FloatRect(100, 100, 50, 200)); |
drawRect(context, container1, foregroundDrawingType, FloatRect(100, 100, 100, 100)); |
} |
{ |
SubtreeRecorder r(context, container2, backgroundPaintPhase); |
- EXPECT_FALSE(r.canUseCache()); |
drawRect(context, container2, backgroundDrawingType, FloatRect(100, 200, 100, 100)); |
drawRect(context, content2, backgroundDrawingType, FloatRect(100, 200, 50, 200)); |
} |
{ |
SubtreeRecorder r(context, container2, foregroundPaintPhase); |
- EXPECT_FALSE(r.canUseCache()); |
drawRect(context, content2, foregroundDrawingType, FloatRect(100, 200, 50, 200)); |
drawRect(context, container2, foregroundDrawingType, FloatRect(100, 200, 100, 100)); |
} |
@@ -509,17 +505,17 @@ TEST_F(DisplayItemListTest, CachedSubtreeSwapOrder) |
TestDisplayItem(container2, DisplayItem::paintPhaseToEndSubtreeType(foregroundPaintPhase))); |
// Simulate the situation when container1 e.g. gets a z-index that is now greater than container2. |
- displayItemList().createAndAppend<CachedDisplayItem>(container2, DisplayItem::paintPhaseToCachedSubtreeType(backgroundPaintPhase)); |
+ EXPECT_TRUE(SubtreeRecorder::useCachedSubtreeIfPossible(context, container2, backgroundPaintPhase)); |
EXPECT_EQ((size_t)1, newPaintListBeforeUpdate().size()); |
EXPECT_TRUE(newPaintListBeforeUpdate().last().isCachedSubtree()); |
- displayItemList().createAndAppend<CachedDisplayItem>(container2, DisplayItem::paintPhaseToCachedSubtreeType(foregroundPaintPhase)); |
+ EXPECT_TRUE(SubtreeRecorder::useCachedSubtreeIfPossible(context, container2, foregroundPaintPhase)); |
EXPECT_EQ((size_t)2, newPaintListBeforeUpdate().size()); |
EXPECT_TRUE(newPaintListBeforeUpdate().last().isCachedSubtree()); |
- displayItemList().createAndAppend<CachedDisplayItem>(container1, DisplayItem::paintPhaseToCachedSubtreeType(backgroundPaintPhase)); |
+ EXPECT_TRUE(SubtreeRecorder::useCachedSubtreeIfPossible(context, container1, backgroundPaintPhase)); |
EXPECT_EQ((size_t)3, newPaintListBeforeUpdate().size()); |
EXPECT_TRUE(newPaintListBeforeUpdate().last().isCachedSubtree()); |
- displayItemList().createAndAppend<CachedDisplayItem>(container1, DisplayItem::paintPhaseToCachedSubtreeType(foregroundPaintPhase)); |
+ EXPECT_TRUE(SubtreeRecorder::useCachedSubtreeIfPossible(context, container1, foregroundPaintPhase)); |
EXPECT_EQ((size_t)4, newPaintListBeforeUpdate().size()); |
EXPECT_TRUE(newPaintListBeforeUpdate().last().isCachedSubtree()); |
displayItemList().commitNewDisplayItems(); |