Index: third_party/WebKit/Source/platform/graphics/paint/PaintArtifact.cpp |
diff --git a/third_party/WebKit/Source/platform/graphics/paint/PaintArtifact.cpp b/third_party/WebKit/Source/platform/graphics/paint/PaintArtifact.cpp |
index c61fd4d4840e1eb20215fe848aed6dd1eea044b4..21c722b1686e91869991884448a6bf00d7d03d2d 100644 |
--- a/third_party/WebKit/Source/platform/graphics/paint/PaintArtifact.cpp |
+++ b/third_party/WebKit/Source/platform/graphics/paint/PaintArtifact.cpp |
@@ -77,6 +77,20 @@ PaintArtifact& PaintArtifact::operator=(PaintArtifact&& source) |
return *this; |
} |
+static bool compareChunkAndIndex(const PaintChunk& chunk, size_t index) |
+{ |
+ return chunk.endIndex <= index; |
+} |
+ |
+Vector<PaintChunk>::const_iterator PaintArtifact::findChunkByDisplayItemIndex(size_t index) const |
+{ |
+ auto chunkIt = std::lower_bound(m_paintChunks.begin(), m_paintChunks.end(), index, compareChunkAndIndex); |
+ DCHECK(chunkIt != m_paintChunks.end()); |
+ DCHECK(index >= chunkIt->beginIndex); |
+ DCHECK(index < chunkIt->endIndex); |
+ return chunkIt; |
+} |
+ |
void PaintArtifact::reset() |
{ |
m_displayItemList.clear(); |
@@ -99,7 +113,7 @@ void PaintArtifact::replay(GraphicsContext& graphicsContext) const |
void PaintArtifact::appendToWebDisplayItemList(WebDisplayItemList* list) const |
{ |
TRACE_EVENT0("blink,benchmark", "PaintArtifact::appendToWebDisplayItemList"); |
- unsigned visualRectIndex = 0; |
+ size_t visualRectIndex = 0; |
for (const DisplayItem& displayItem : m_displayItemList) { |
displayItem.appendToWebDisplayItemList(m_displayItemList.visualRect(visualRectIndex), list); |
visualRectIndex++; |