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..41c1ad20f856dded4912a3466da9b272aa73b4ac 100644 |
--- a/third_party/WebKit/Source/platform/graphics/paint/PaintChunker.cpp |
+++ b/third_party/WebKit/Source/platform/graphics/paint/PaintChunker.cpp |
@@ -18,7 +18,7 @@ PaintChunker::~PaintChunker() |
void PaintChunker::updateCurrentPaintChunkProperties(const PaintChunk::Id* chunkId, const PaintChunkProperties& properties) |
{ |
- ASSERT(RuntimeEnabledFeatures::slimmingPaintV2Enabled()); |
+ DCHECK(RuntimeEnabledFeatures::slimmingPaintV2Enabled()); |
m_currentChunkId = WTF::nullopt; |
if (chunkId) |
@@ -26,9 +26,9 @@ void PaintChunker::updateCurrentPaintChunkProperties(const PaintChunk::Id* chunk |
m_currentProperties = properties; |
} |
-void PaintChunker::incrementDisplayItemIndex(const DisplayItem& item) |
+bool PaintChunker::incrementDisplayItemIndex(const DisplayItem& item) |
{ |
- ASSERT(RuntimeEnabledFeatures::slimmingPaintV2Enabled()); |
+ DCHECK(RuntimeEnabledFeatures::slimmingPaintV2Enabled()); |
ItemBehavior behavior; |
Optional<PaintChunk::Id> newChunkId; |
@@ -53,7 +53,7 @@ void PaintChunker::incrementDisplayItemIndex(const DisplayItem& item) |
PaintChunk newChunk(0, 1, newChunkId ? &*newChunkId : nullptr, m_currentProperties); |
m_chunks.append(newChunk); |
m_chunkBehavior.append(behavior); |
- return; |
+ return true; |
} |
auto& lastChunk = m_chunks.last(); |
@@ -62,26 +62,29 @@ void PaintChunker::incrementDisplayItemIndex(const DisplayItem& item) |
&& m_chunkBehavior.last() != RequiresSeparateChunk; |
if (canContinueChunk) { |
lastChunk.endIndex++; |
- return; |
+ return false; |
} |
PaintChunk newChunk(lastChunk.endIndex, lastChunk.endIndex + 1, newChunkId ? &*newChunkId : nullptr, m_currentProperties); |
m_chunks.append(newChunk); |
m_chunkBehavior.append(behavior); |
+ return true; |
} |
-void PaintChunker::decrementDisplayItemIndex() |
+bool PaintChunker::decrementDisplayItemIndex() |
{ |
- ASSERT(RuntimeEnabledFeatures::slimmingPaintV2Enabled()); |
- ASSERT(!m_chunks.isEmpty()); |
+ DCHECK(RuntimeEnabledFeatures::slimmingPaintV2Enabled()); |
+ DCHECK(!m_chunks.isEmpty()); |
auto& lastChunk = m_chunks.last(); |
if ((lastChunk.endIndex - lastChunk.beginIndex) > 1) { |
lastChunk.endIndex--; |
- } else { |
- m_chunks.removeLast(); |
- m_chunkBehavior.removeLast(); |
+ return false; |
} |
+ |
+ m_chunks.removeLast(); |
+ m_chunkBehavior.removeLast(); |
+ return true; |
} |
void PaintChunker::clear() |