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

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

Issue 2185933003: Fix issues of display item client cache flags (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Tests Created 4 years, 5 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/PaintController.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/paint/PaintController.cpp b/third_party/WebKit/Source/platform/graphics/paint/PaintController.cpp
index 4d6ff099955ce56629757fd880d621ecfc70d63c..f91a64b7198679dcefe1a5c9a6a4ee6c98c41379 100644
--- a/third_party/WebKit/Source/platform/graphics/paint/PaintController.cpp
+++ b/third_party/WebKit/Source/platform/graphics/paint/PaintController.cpp
@@ -420,6 +420,7 @@ void PaintController::commitNewDisplayItems(const LayoutSize& offsetFromLayoutOb
SkPictureGpuAnalyzer gpuAnalyzer;
m_currentCacheGeneration = DisplayItemClient::CacheGenerationOrInvalidationReason::next();
+ Vector<const DisplayItemClient*> skippedCacheClients;
for (const auto& item : m_newDisplayItemList) {
// No reason to continue the analysis once we have a veto.
if (gpuAnalyzer.suitableForGpuRasterization())
@@ -427,19 +428,30 @@ void PaintController::commitNewDisplayItems(const LayoutSize& offsetFromLayoutOb
m_newDisplayItemList.appendVisualRect(visualRectForDisplayItem(item, offsetFromLayoutObject));
- if (item.isCacheable())
+ if (item.isCacheable()) {
item.client().setDisplayItemsCached(m_currentCacheGeneration);
+ } else {
+ if (item.client().isJustCreated())
+ item.client().clearIsJustCreated();
+ if (item.skippedCache())
+ skippedCacheClients.append(&item.client());
+ }
}
+ for (auto* client : skippedCacheClients)
+ client->setDisplayItemsUncached();
+
// The new list will not be appended to again so we can release unused memory.
m_newDisplayItemList.shrinkToFit();
m_currentPaintArtifact = PaintArtifact(std::move(m_newDisplayItemList), m_newPaintChunks.releasePaintChunks(), gpuAnalyzer.suitableForGpuRasterization());
resetCurrentListIndices();
m_outOfOrderItemIndices.clear();
- for (const auto& chunk : m_currentPaintArtifact.paintChunks()) {
- if (chunk.id)
- chunk.id->client.setDisplayItemsCached(m_currentCacheGeneration);
+ if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
+ for (const auto& chunk : m_currentPaintArtifact.paintChunks()) {
+ if (chunk.id && chunk.id->client.isJustCreated())
+ chunk.id->client.clearIsJustCreated();
+ }
}
// We'll allocate the initial buffer when we start the next paint.

Powered by Google App Engine
This is Rietveld 408576698