| Index: Source/platform/graphics/paint/DisplayItemList.cpp
|
| diff --git a/Source/platform/graphics/paint/DisplayItemList.cpp b/Source/platform/graphics/paint/DisplayItemList.cpp
|
| index f4723e3b27c2f291c80104e8df8da8ae8adc2f5c..c2b800adb3cf2a7c2a151624e4769053f4c8d3ff 100644
|
| --- a/Source/platform/graphics/paint/DisplayItemList.cpp
|
| +++ b/Source/platform/graphics/paint/DisplayItemList.cpp
|
| @@ -18,8 +18,7 @@ namespace blink {
|
| const PaintList& DisplayItemList::paintList()
|
| {
|
| ASSERT(RuntimeEnabledFeatures::slimmingPaintEnabled());
|
| -
|
| - updatePaintList();
|
| + ASSERT(m_newPaints.isEmpty());
|
| return m_paintList;
|
| }
|
|
|
| @@ -44,6 +43,11 @@ void DisplayItemList::invalidateAll()
|
| m_cachedClients.clear();
|
| }
|
|
|
| +bool DisplayItemList::clientCacheIsValid(DisplayItemClient client) const
|
| +{
|
| + return RuntimeEnabledFeatures::slimmingPaintDisplayItemCacheEnabled() && m_cachedClients.contains(client);
|
| +}
|
| +
|
| PaintList::iterator DisplayItemList::findNextMatchingCachedItem(PaintList::iterator begin, const DisplayItem& displayItem)
|
| {
|
| PaintList::iterator end = m_paintList.end();
|
| @@ -74,6 +78,13 @@ static void appendDisplayItem(PaintList& list, HashSet<DisplayItemClient>& clien
|
| // the ordering implied by the existing paint list, extra treewalks are avoided.
|
| void DisplayItemList::updatePaintList()
|
| {
|
| + if (!RuntimeEnabledFeatures::slimmingPaintDisplayItemCacheEnabled()) {
|
| + m_paintList.clear();
|
| + m_paintList.swap(m_newPaints);
|
| + m_cachedClients.clear();
|
| + return;
|
| + }
|
| +
|
| PaintList updatedList;
|
| HashSet<DisplayItemClient> newCachedClients;
|
|
|
|
|