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