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

Unified Diff: Source/platform/graphics/paint/DisplayItemList.cpp

Issue 1203343002: WIP for display item list backed by ListContainer Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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
Index: Source/platform/graphics/paint/DisplayItemList.cpp
diff --git a/Source/platform/graphics/paint/DisplayItemList.cpp b/Source/platform/graphics/paint/DisplayItemList.cpp
index d4762fa9b765cad05b8f4b92f192bd44d2caf3e9..a51c90a07369bf0cfa689f34c85e8a03d1c8f7e1 100644
--- a/Source/platform/graphics/paint/DisplayItemList.cpp
+++ b/Source/platform/graphics/paint/DisplayItemList.cpp
@@ -60,7 +60,7 @@ void DisplayItemList::removeLastDisplayItem()
m_newDisplayItems.removeLast();
}
-void DisplayItemList::add(WTF::PassOwnPtr<DisplayItem> displayItem)
+void DisplayItemList::processNewItem(DisplayItem* displayItem)
{
ASSERT(RuntimeEnabledFeatures::slimmingPaintEnabled());
ASSERT(!m_constructionDisabled);
@@ -70,9 +70,10 @@ void DisplayItemList::add(WTF::PassOwnPtr<DisplayItem> displayItem)
++m_numCachedItems;
#if ENABLE(ASSERT)
- // Verify noop begin/end pairs have been removed.
- if (!m_newDisplayItems.isEmpty() && m_newDisplayItems.last().isBegin() && !m_newDisplayItems.last().drawsContent())
- ASSERT(!displayItem->isEndAndPairedWith(m_newDisplayItems.last().type()));
+// TODO(pdr): Reenable this assert. Note that the item has already been appended.
+// // Verify noop begin/end pairs have been removed.
+// if (!m_newDisplayItems.isEmpty() && m_newDisplayItems.last().isBegin() && !m_newDisplayItems.last().drawsContent())
+// ASSERT(!displayItem->isEndAndPairedWith(m_newDisplayItems.last().type()));
#endif
if (!m_scopeStack.isEmpty())
@@ -88,14 +89,12 @@ void DisplayItemList::add(WTF::PassOwnPtr<DisplayItem> displayItem)
#endif
ASSERT_NOT_REACHED();
}
- addItemToIndex(displayItem->client(), displayItem->type(), m_newDisplayItems.size(), m_newDisplayItemIndicesByClient);
+ addItemToIndex(displayItem->client(), displayItem->type(), m_newDisplayItems.size() - 1, m_newDisplayItemIndicesByClient);
#endif // ENABLE(ASSERT)
ASSERT(!displayItem->skippedCache()); // Only DisplayItemList can set the flag.
if (skippingCache())
displayItem->setSkippedCache();
-
- m_newDisplayItems.append(displayItem);
}
void DisplayItemList::beginScope(DisplayItemClient client)
@@ -263,7 +262,8 @@ void DisplayItemList::commitNewDisplayItems()
}
#endif // ENABLE(ASSERT)
- DisplayItems updatedList;
+ // TODO(pdr): Use some smarts to set this initial capacity.
+ DisplayItems updatedList(kInitialDisplayItemsCapacity);
DisplayItems::Iterator currentIt = m_currentDisplayItems.begin();
DisplayItems::Iterator currentEnd = m_currentDisplayItems.end();
for (DisplayItems::Iterator newIt = m_newDisplayItems.begin(); newIt != m_newDisplayItems.end(); ++newIt) {
« no previous file with comments | « Source/platform/graphics/paint/DisplayItemList.h ('k') | Source/platform/graphics/paint/DisplayItemListTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698