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

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

Issue 1330453002: Cleanup DisplayItemList::processNewItem to take a reference (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 3 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/platform/graphics/paint/DisplayItemList.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/graphics/paint/DisplayItemList.cpp
diff --git a/Source/platform/graphics/paint/DisplayItemList.cpp b/Source/platform/graphics/paint/DisplayItemList.cpp
index 47a2a271142de908223e1bb30dfdf75fb96cc7c6..1f39b0bd777cd7819f1fbd9ad0a91e08b63a6027 100644
--- a/Source/platform/graphics/paint/DisplayItemList.cpp
+++ b/Source/platform/graphics/paint/DisplayItemList.cpp
@@ -59,43 +59,43 @@ void DisplayItemList::removeLastDisplayItem()
m_newDisplayItems.removeLast();
}
-void DisplayItemList::processNewItem(DisplayItem* displayItem)
+void DisplayItemList::processNewItem(DisplayItem& displayItem)
{
ASSERT(RuntimeEnabledFeatures::slimmingPaintEnabled());
ASSERT(!m_constructionDisabled);
- ASSERT(!skippingCache() || !displayItem->isCached());
+ ASSERT(!skippingCache() || !displayItem.isCached());
- if (displayItem->isCached())
+ if (displayItem.isCached())
++m_numCachedItems;
#if ENABLE(ASSERT)
// Verify noop begin/end pairs have been removed.
- if (m_newDisplayItems.size() >= 2 && displayItem->isEnd()) {
+ if (m_newDisplayItems.size() >= 2 && displayItem.isEnd()) {
const auto& beginDisplayItem = m_newDisplayItems[m_newDisplayItems.size() - 2];
if (beginDisplayItem.isBegin() && beginDisplayItem.type() != DisplayItem::BeginSubsequence && !beginDisplayItem.drawsContent())
- ASSERT(!displayItem->isEndAndPairedWith(beginDisplayItem.type()));
+ ASSERT(!displayItem.isEndAndPairedWith(beginDisplayItem.type()));
}
#endif
if (!m_scopeStack.isEmpty())
- displayItem->setScope(m_scopeStack.last());
+ displayItem.setScope(m_scopeStack.last());
#if ENABLE(ASSERT)
- size_t index = findMatchingItemFromIndex(displayItem->nonCachedId(), m_newDisplayItemIndicesByClient, m_newDisplayItems);
+ size_t index = findMatchingItemFromIndex(displayItem.nonCachedId(), 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();
}
- addItemToIndexIfNeeded(*displayItem, m_newDisplayItems.size() - 1, m_newDisplayItemIndicesByClient);
+ addItemToIndexIfNeeded(displayItem, m_newDisplayItems.size() - 1, 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();
}
void DisplayItemList::beginScope()
« no previous file with comments | « Source/platform/graphics/paint/DisplayItemList.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698