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

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

Issue 1363613002: Save previous paint offset in LayoutObject (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: No union (many compilers don't allow constructors); Fix a typo perhaps caused by switching to combiā€¦ 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
Index: third_party/WebKit/Source/platform/graphics/paint/DisplayItemList.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/paint/DisplayItemList.cpp b/third_party/WebKit/Source/platform/graphics/paint/DisplayItemList.cpp
index 8620e3349a5ff40258858dea1fb812dfa32a10b1..7b329e4b43742f9a9cdd8e57da2989a2e2763a5b 100644
--- a/third_party/WebKit/Source/platform/graphics/paint/DisplayItemList.cpp
+++ b/third_party/WebKit/Source/platform/graphics/paint/DisplayItemList.cpp
@@ -163,41 +163,6 @@ bool DisplayItemList::paintOffsetWasInvalidated(DisplayItemClient client) const
}
#endif
-void DisplayItemList::recordPaintOffset(DisplayItemClient client, const LayoutPoint& paintOffset)
-{
- ASSERT(RuntimeEnabledFeatures::slimmingPaintOffsetCachingEnabled());
- m_previousPaintOffsets.set(client, paintOffset);
-}
-
-bool DisplayItemList::paintOffsetIsUnchanged(DisplayItemClient client, const LayoutPoint& paintOffset) const
-{
- ASSERT(RuntimeEnabledFeatures::slimmingPaintOffsetCachingEnabled());
- PreviousPaintOffsets::const_iterator it = m_previousPaintOffsets.find(client);
- if (it == m_previousPaintOffsets.end())
- return false;
- return paintOffset == it->value;
-}
-
-void DisplayItemList::removeUnneededPaintOffsetEntries()
-{
- ASSERT(RuntimeEnabledFeatures::slimmingPaintOffsetCachingEnabled());
-
- // This function is only needed temporarily while paint offsets are stored
- // in a map on the list itself. Because we don't always get notified when
- // a display item client is removed, we need to infer it to prevent the
- // paint offset map from growing indefinitely. This is achieved by just
- // removing any paint offset clients that are no longer in the full list.
-
- HashSet<DisplayItemClient> paintOffsetClientsToRemove;
- for (auto& client : m_previousPaintOffsets.keys())
- paintOffsetClientsToRemove.add(client);
- for (auto& item : m_currentDisplayItems)
- paintOffsetClientsToRemove.remove(item.client());
-
- for (auto& client : paintOffsetClientsToRemove)
- m_previousPaintOffsets.remove(client);
-}
-
size_t DisplayItemList::findMatchingItemFromIndex(const DisplayItem::Id& id, const DisplayItemIndicesByClientMap& displayItemIndicesByClient, const DisplayItems& list)
{
DisplayItemIndicesByClientMap::const_iterator it = displayItemIndicesByClient.find(id.client);
@@ -309,8 +274,6 @@ void DisplayItemList::commitNewDisplayItems(DisplayListDiff*)
m_currentDisplayItems.swap(m_newDisplayItems);
m_validlyCachedClientsDirty = true;
m_numCachedItems = 0;
- if (RuntimeEnabledFeatures::slimmingPaintOffsetCachingEnabled())
- removeUnneededPaintOffsetEntries();
return;
}
@@ -392,9 +355,6 @@ void DisplayItemList::commitNewDisplayItems(DisplayListDiff*)
m_currentDisplayItems.swap(updatedList);
m_numCachedItems = 0;
- if (RuntimeEnabledFeatures::slimmingPaintOffsetCachingEnabled())
- removeUnneededPaintOffsetEntries();
-
#if ENABLE(ASSERT)
m_clientsWithPaintOffsetInvalidations.clear();
#endif

Powered by Google App Engine
This is Rietveld 408576698