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

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

Issue 1192443003: [Slimming Paint] Blink-side contiguous allocation of display items. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: need a constructor with WTF_MAKE_NONCOPYABLE 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 ecff614061bf8af43a29f071b3b0343024db4298..236cbecca2c646ede78ad97478732fcfd1db4bc6 100644
--- a/Source/platform/graphics/paint/DisplayItemList.cpp
+++ b/Source/platform/graphics/paint/DisplayItemList.cpp
@@ -32,21 +32,21 @@ const DisplayItems& DisplayItemList::displayItems() const
return m_currentDisplayItems;
}
-void DisplayItemList::add(WTF::PassOwnPtr<DisplayItem> displayItem)
+void DisplayItemList::add(DisplayItem& displayItem)
{
ASSERT(RuntimeEnabledFeatures::slimmingPaintEnabled());
ASSERT(!m_constructionDisabled);
- ASSERT(!skippingCache() || !displayItem->isCached());
+ ASSERT(!skippingCache() || !displayItem.isCached());
- if (displayItem->isEnd()) {
+ if (displayItem.isEnd()) {
ASSERT(!m_newDisplayItems.isEmpty());
if (m_newDisplayItems.last().isBegin() && !m_newDisplayItems.last().drawsContent()) {
- ASSERT(displayItem->isEndAndPairedWith(m_newDisplayItems.last().type()));
+ ASSERT(displayItem.isEndAndPairedWith(m_newDisplayItems.last().type()));
// Remove the beginning display item of this empty pair.
m_newDisplayItems.removeLast();
#if ENABLE(ASSERT)
// Also remove the index pointing to the removed display item.
- DisplayItemIndicesByClientMap::iterator it = m_newDisplayItemIndicesByClient.find(displayItem->client());
+ DisplayItemIndicesByClientMap::iterator it = m_newDisplayItemIndicesByClient.find(displayItem.client());
if (it != m_newDisplayItemIndicesByClient.end()) {
Vector<size_t>& indices = it->value;
if (!indices.isEmpty() && indices.last() == m_newDisplayItems.size())
@@ -58,26 +58,26 @@ void DisplayItemList::add(WTF::PassOwnPtr<DisplayItem> displayItem)
}
if (!m_scopeStack.isEmpty())
- displayItem->setScope(m_scopeStack.last().id, m_scopeStack.last().client);
+ displayItem.setScope(m_scopeStack.last().id, m_scopeStack.last().client);
#if ENABLE(ASSERT)
- size_t index = findMatchingItemFromIndex(displayItem->id(), displayItem->type(), m_newDisplayItemIndicesByClient, m_newDisplayItems);
+ size_t index = findMatchingItemFromIndex(displayItem.id(), displayItem.type(), m_newDisplayItemIndicesByClient, m_newDisplayItems);
if (index != kNotFound) {
#ifndef NDEBUG
showDebugData();
WTFLogAlways("DisplayItem %s has duplicated id with previous %s (index=%d)\n",
- displayItem->asDebugString().utf8().data(), m_newDisplayItems[index].asDebugString().utf8().data(), static_cast<int>(index));
+ displayItem.asDebugString().utf8().data(), m_newDisplayItems[index].asDebugString().utf8().data(), static_cast<int>(index));
#endif
ASSERT_NOT_REACHED();
}
- addItemToIndex(displayItem->client(), displayItem->type(), m_newDisplayItems.size(), m_newDisplayItemIndicesByClient);
+ addItemToIndex(displayItem.client(), displayItem.type(), m_newDisplayItems.size(), m_newDisplayItemIndicesByClient);
#endif // ENABLE(ASSERT)
- ASSERT(!displayItem->skippedCache()); // Only DisplayItemList can set the flag.
+ ASSERT(!displayItem.skippedCache()); // Only DisplayItemList can set the flag.
if (skippingCache())
- displayItem->setSkippedCache();
+ displayItem.setSkippedCache();
- m_newDisplayItems.append(displayItem);
+ displayItem.appendByMoving(m_newDisplayItems);
}
void DisplayItemList::beginScope(DisplayItemClient client)
« 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