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) |