| Index: Source/platform/graphics/paint/DisplayItemList.cpp
|
| diff --git a/Source/platform/graphics/paint/DisplayItemList.cpp b/Source/platform/graphics/paint/DisplayItemList.cpp
|
| index 9c8fad763e60b0b3cbb4dbcea05602878a2bd54c..e01253ee38b06f984dfc4c8e16ee9a1f0d72ed4f 100644
|
| --- a/Source/platform/graphics/paint/DisplayItemList.cpp
|
| +++ b/Source/platform/graphics/paint/DisplayItemList.cpp
|
| @@ -139,6 +139,30 @@ bool DisplayItemList::clientCacheIsValid(DisplayItemClient client) const
|
| return m_validlyCachedClients.contains(client);
|
| }
|
|
|
| +void DisplayItemList::invalidatePaintOffset(DisplayItemClient client)
|
| +{
|
| + ASSERT(RuntimeEnabledFeatures::slimmingPaintV2Enabled());
|
| +
|
| + m_validlyCachedClients.remove(client);
|
| +
|
| +#if ENABLE(ASSERT)
|
| + m_clientsWithPaintOffsetInvalidations.add(client);
|
| +
|
| + // Ensure no phases slipped in using the old paint offset which would indicate
|
| + // different phases used different paint offsets, which should not happen.
|
| + for (const auto& item : m_newDisplayItems)
|
| + ASSERT(!item.isCached() || item.client() != client);
|
| +#endif
|
| +}
|
| +
|
| +#if ENABLE(ASSERT)
|
| +bool DisplayItemList::paintOffsetWasInvalidated(DisplayItemClient client) const
|
| +{
|
| + ASSERT(RuntimeEnabledFeatures::slimmingPaintV2Enabled());
|
| + return m_clientsWithPaintOffsetInvalidations.contains(client);
|
| +}
|
| +#endif
|
| +
|
| size_t DisplayItemList::findMatchingItemFromIndex(const DisplayItem::Id& id, const DisplayItemIndicesByClientMap& displayItemIndicesByClient, const DisplayItems& list)
|
| {
|
| DisplayItemIndicesByClientMap::const_iterator it = displayItemIndicesByClient.find(id.client);
|
| @@ -294,6 +318,7 @@ void DisplayItemList::commitNewDisplayItems(DisplayListDiff*)
|
| ASSERT(!RuntimeEnabledFeatures::slimmingPaintUnderInvalidationCheckingEnabled());
|
| ASSERT(newDisplayItem.isCached());
|
| ASSERT(clientCacheIsValid(newDisplayItem.client()));
|
| + ASSERT(!RuntimeEnabledFeatures::slimmingPaintV2Enabled() || !paintOffsetWasInvalidated(newDisplayItem.client()));
|
| if (!isSynchronized) {
|
| DisplayItems::iterator foundIt = findOutOfOrderCachedItem(currentIt, newDisplayItemId, outOfOrderIndexContext);
|
|
|
| @@ -324,11 +349,15 @@ void DisplayItemList::commitNewDisplayItems(DisplayListDiff*)
|
| }
|
| } else {
|
| #if ENABLE(ASSERT)
|
| - if (RuntimeEnabledFeatures::slimmingPaintUnderInvalidationCheckingEnabled())
|
| + if (RuntimeEnabledFeatures::slimmingPaintUnderInvalidationCheckingEnabled()) {
|
| checkCachedDisplayItemIsUnchanged(newDisplayItem, outOfOrderIndexContext.displayItemIndicesByClient);
|
| - else
|
| - ASSERT(!newDisplayItem.isDrawing() || newDisplayItem.skippedCache() || !clientCacheIsValid(newDisplayItem.client()));
|
| -#endif // ENABLE(ASSERT)
|
| + } else {
|
| + ASSERT(!newDisplayItem.isDrawing()
|
| + || newDisplayItem.skippedCache()
|
| + || !clientCacheIsValid(newDisplayItem.client())
|
| + || (RuntimeEnabledFeatures::slimmingPaintV2Enabled() && paintOffsetWasInvalidated(newDisplayItem.client())));
|
| + }
|
| +#endif
|
| updatedList.appendByMoving(*newIt, newIt->derivedSize());
|
|
|
| if (isSynchronized)
|
| @@ -345,6 +374,10 @@ void DisplayItemList::commitNewDisplayItems(DisplayListDiff*)
|
| m_validlyCachedClientsDirty = true;
|
| m_currentDisplayItems.swap(updatedList);
|
| m_numCachedItems = 0;
|
| +
|
| +#if ENABLE(ASSERT)
|
| + m_clientsWithPaintOffsetInvalidations.clear();
|
| +#endif
|
| }
|
|
|
| size_t DisplayItemList::approximateUnsharedMemoryUsage() const
|
|
|