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 344b432b8d7af4a80e6814f91b038fdbaf6ba41f..fed334ba212f630ba5d2be44e3c256ea7281da78 100644 |
--- a/third_party/WebKit/Source/platform/graphics/paint/DisplayItemList.cpp |
+++ b/third_party/WebKit/Source/platform/graphics/paint/DisplayItemList.cpp |
@@ -23,6 +23,12 @@ const DisplayItems& DisplayItemList::displayItems() const |
return m_currentDisplayItems; |
} |
+const Vector<PaintChunk>& DisplayItemList::paintChunks() const |
+{ |
+ ASSERT(m_newPaintChunks.isInInitialState()); |
+ return m_currentPaintChunks; |
+} |
+ |
bool DisplayItemList::lastDisplayItemIsNoopBegin() const |
{ |
if (m_newDisplayItems.isEmpty()) |
@@ -47,6 +53,9 @@ void DisplayItemList::removeLastDisplayItem() |
} |
#endif |
m_newDisplayItems.removeLast(); |
+ |
+ if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) |
+ m_newPaintChunks.decrementDisplayItemIndex(); |
} |
void DisplayItemList::processNewItem(DisplayItem& displayItem) |
@@ -84,6 +93,14 @@ void DisplayItemList::processNewItem(DisplayItem& displayItem) |
if (skippingCache()) |
displayItem.setSkippedCache(); |
+ |
+ if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) |
+ m_newPaintChunks.incrementDisplayItemIndex(); |
+} |
+ |
+void DisplayItemList::updateCurrentPaintProperties(const PaintProperties& newPaintProperties) |
+{ |
+ m_newPaintChunks.updateCurrentPaintProperties(newPaintProperties); |
} |
void DisplayItemList::beginScope() |
@@ -272,6 +289,7 @@ void DisplayItemList::commitNewDisplayItems(DisplayListDiff*) |
ASSERT(!item.isCached()); |
#endif |
m_currentDisplayItems.swap(m_newDisplayItems); |
+ m_currentPaintChunks = m_newPaintChunks.releasePaintChunks(); |
m_validlyCachedClientsDirty = true; |
m_numCachedItems = 0; |
return; |
@@ -288,6 +306,7 @@ void DisplayItemList::commitNewDisplayItems(DisplayListDiff*) |
// TODO(jbroman): Consider revisiting this heuristic. |
DisplayItems updatedList(std::max(m_currentDisplayItems.usedCapacityInBytes(), m_newDisplayItems.usedCapacityInBytes())); |
+ Vector<PaintChunk> updatedPaintChunks; |
DisplayItems::iterator currentIt = m_currentDisplayItems.begin(); |
DisplayItems::iterator currentEnd = m_currentDisplayItems.end(); |
for (DisplayItems::iterator newIt = m_newDisplayItems.begin(); newIt != m_newDisplayItems.end(); ++newIt) { |
@@ -350,6 +369,10 @@ void DisplayItemList::commitNewDisplayItems(DisplayListDiff*) |
checkNoRemainingCachedDisplayItems(); |
#endif // ENABLE(ASSERT) |
+ // TODO(jbroman): When subsequence caching applies to SPv2, we'll need to |
+ // merge the paint chunks as well. |
+ m_currentPaintChunks = m_newPaintChunks.releasePaintChunks(); |
+ |
m_newDisplayItems.clear(); |
m_validlyCachedClientsDirty = true; |
m_currentDisplayItems.swap(updatedList); |