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

Unified Diff: Source/core/paint/LayoutObjectDrawingRecorderTest.cpp

Issue 1193433004: Blink-side contiguous allocation of display items. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add ListContainer::AllocateAndConstructWithArguments and a TODO in DisplayItemList::findMatchingIte… Created 5 years, 6 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 | « Source/core/paint/LayerFixedPositionRecorder.cpp ('k') | Source/core/paint/RoundedInnerRectClipper.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/paint/LayoutObjectDrawingRecorderTest.cpp
diff --git a/Source/core/paint/LayoutObjectDrawingRecorderTest.cpp b/Source/core/paint/LayoutObjectDrawingRecorderTest.cpp
index 104f075d45d39c4af10c38451fcb240d08608eb6..9e86707434e257940d82b03f430f1e0ba620ac41 100644
--- a/Source/core/paint/LayoutObjectDrawingRecorderTest.cpp
+++ b/Source/core/paint/LayoutObjectDrawingRecorderTest.cpp
@@ -68,12 +68,12 @@ void drawRect(GraphicsContext& context, LayoutView& layoutView, PaintPhase phase
context.drawRect(rect);
}
-bool isDrawing(const DisplayItems::ItemHandle& item)
+bool isDrawing(const DisplayItem& item)
{
return DisplayItem::isDrawingType(item.type());
}
-bool isCached(const DisplayItems::ItemHandle& item)
+bool isCached(const DisplayItem& item)
{
return DisplayItem::isCachedType(item.type());
}
@@ -87,9 +87,9 @@ TEST_F(LayoutObjectDrawingRecorderTest, Nothing)
drawNothing(context, layoutView(), PaintPhaseForeground, bound);
rootDisplayItemList().commitNewDisplayItems();
EXPECT_EQ((size_t)1, rootDisplayItemList().displayItems().size());
- const auto& item = rootDisplayItemList().displayItems()[0];
+ const auto& item = *rootDisplayItemList().displayItems().elementAt(0);
ASSERT_TRUE(isDrawing(item));
- EXPECT_FALSE(item.picture());
+ EXPECT_FALSE(static_cast<const DrawingDisplayItem&>(item).picture());
}
TEST_F(LayoutObjectDrawingRecorderTest, Rect)
@@ -99,7 +99,7 @@ TEST_F(LayoutObjectDrawingRecorderTest, Rect)
drawRect(context, layoutView(), PaintPhaseForeground, bound);
rootDisplayItemList().commitNewDisplayItems();
EXPECT_EQ((size_t)1, rootDisplayItemList().displayItems().size());
- EXPECT_TRUE(isDrawing(rootDisplayItemList().displayItems()[0]));
+ EXPECT_TRUE(isDrawing(*rootDisplayItemList().displayItems().elementAt(0)));
}
TEST_F(LayoutObjectDrawingRecorderTest, Cached)
@@ -110,18 +110,18 @@ TEST_F(LayoutObjectDrawingRecorderTest, Cached)
drawRect(context, layoutView(), PaintPhaseForeground, bound);
rootDisplayItemList().commitNewDisplayItems();
EXPECT_EQ((size_t)2, rootDisplayItemList().displayItems().size());
- EXPECT_TRUE(isDrawing(rootDisplayItemList().displayItems()[0]));
- EXPECT_TRUE(isDrawing(rootDisplayItemList().displayItems()[1]));
+ EXPECT_TRUE(isDrawing(*rootDisplayItemList().displayItems().elementAt(0)));
+ EXPECT_TRUE(isDrawing(*rootDisplayItemList().displayItems().elementAt(1)));
drawNothing(context, layoutView(), PaintPhaseBlockBackground, bound);
drawRect(context, layoutView(), PaintPhaseForeground, bound);
EXPECT_EQ((size_t)2, newDisplayItemsBeforeUpdate().size());
- EXPECT_TRUE(isCached(newDisplayItemsBeforeUpdate()[0]));
- EXPECT_TRUE(isCached(newDisplayItemsBeforeUpdate()[1]));
+ EXPECT_TRUE(isCached(*newDisplayItemsBeforeUpdate().elementAt(0)));
+ EXPECT_TRUE(isCached(*newDisplayItemsBeforeUpdate().elementAt(1)));
rootDisplayItemList().commitNewDisplayItems();
EXPECT_EQ((size_t)2, rootDisplayItemList().displayItems().size());
- EXPECT_TRUE(isDrawing(rootDisplayItemList().displayItems()[0]));
- EXPECT_TRUE(isDrawing(rootDisplayItemList().displayItems()[1]));
+ EXPECT_TRUE(isDrawing(*rootDisplayItemList().displayItems().elementAt(0)));
+ EXPECT_TRUE(isDrawing(*rootDisplayItemList().displayItems().elementAt(1)));
}
} // namespace
« no previous file with comments | « Source/core/paint/LayerFixedPositionRecorder.cpp ('k') | Source/core/paint/RoundedInnerRectClipper.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698