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

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

Issue 2161253003: Revert of PaintChunk::id (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@CommitOnTheWay
Patch Set: 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/PaintChunker.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/paint/PaintChunker.cpp b/third_party/WebKit/Source/platform/graphics/paint/PaintChunker.cpp
index fab3f180315d1a7073f82d8ea35758eaa63f4f4f..485ec009c0a5657995fb08d4ac3ed465a753e754 100644
--- a/third_party/WebKit/Source/platform/graphics/paint/PaintChunker.cpp
+++ b/third_party/WebKit/Source/platform/graphics/paint/PaintChunker.cpp
@@ -16,41 +16,19 @@
{
}
-void PaintChunker::updateCurrentPaintChunkProperties(const PaintChunk::Id* chunkId, const PaintChunkProperties& properties)
+void PaintChunker::updateCurrentPaintChunkProperties(const PaintChunkProperties& properties)
{
ASSERT(RuntimeEnabledFeatures::slimmingPaintV2Enabled());
- m_currentChunkId = WTF::nullopt;
- if (chunkId)
- m_currentChunkId.emplace(*chunkId);
m_currentProperties = properties;
}
-void PaintChunker::incrementDisplayItemIndex(const DisplayItem& item)
+void PaintChunker::incrementDisplayItemIndex(ItemBehavior behavior)
{
ASSERT(RuntimeEnabledFeatures::slimmingPaintV2Enabled());
- ItemBehavior behavior;
- Optional<PaintChunk::Id> newChunkId;
- if (DisplayItem::isForeignLayerType(item.getType())) {
- behavior = RequiresSeparateChunk;
- // Use null chunkId if we are skipping cache, so that the chunk will not
- // match any old chunk and will be treated as brand new.
- if (!item.skippedCache())
- newChunkId.emplace(item.getId());
-
- // Clear m_currentChunkId so that any display items after the foreign layer
- // without a new chunk id will be treated as having no id to avoid the chunk
- // from using the same id as the chunk before the foreign layer chunk.
- m_currentChunkId = WTF::nullopt;
- } else {
- behavior = DefaultBehavior;
- if (!item.skippedCache() && m_currentChunkId)
- newChunkId.emplace(*m_currentChunkId);
- }
-
if (m_chunks.isEmpty()) {
- PaintChunk newChunk(0, 1, newChunkId ? &*newChunkId : nullptr, m_currentProperties);
+ PaintChunk newChunk(0, 1, m_currentProperties);
m_chunks.append(newChunk);
m_chunkBehavior.append(behavior);
return;
@@ -65,7 +43,7 @@
return;
}
- PaintChunk newChunk(lastChunk.endIndex, lastChunk.endIndex + 1, newChunkId ? &*newChunkId : nullptr, m_currentProperties);
+ PaintChunk newChunk(lastChunk.endIndex, lastChunk.endIndex + 1, m_currentProperties);
m_chunks.append(newChunk);
m_chunkBehavior.append(behavior);
}
@@ -88,7 +66,6 @@
{
m_chunks.clear();
m_chunkBehavior.clear();
- m_currentChunkId = WTF::nullopt;
m_currentProperties = PaintChunkProperties();
}
@@ -97,7 +74,6 @@
Vector<PaintChunk> chunks;
chunks.swap(m_chunks);
m_chunkBehavior.clear();
- m_currentChunkId = WTF::nullopt;
m_currentProperties = PaintChunkProperties();
return chunks;
}

Powered by Google App Engine
This is Rietveld 408576698