Chromium Code Reviews| 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 833198a060895d633a0b580c5e0ebc1385c18d77..4e276bd9c36640ba5bab3dad48a609457a8a2594 100644 |
| --- a/third_party/WebKit/Source/platform/graphics/paint/PaintController.cpp |
| +++ b/third_party/WebKit/Source/platform/graphics/paint/PaintController.cpp |
| @@ -539,7 +539,9 @@ void PaintController::generateChunkRasterInvalidationRects(PaintChunk& newChunk) |
| return; |
| if (!newChunk.id) { |
| - newChunk.rasterInvalidationRects.append(FloatRect(LayoutRect::infiniteIntRect())); |
| + PaintInvalidationInfo info; |
| + info.rect = LayoutRect::infiniteIntRect(); |
| + newChunk.rasterInvalidationRects.append(info); |
| return; |
| } |
| @@ -575,7 +577,9 @@ void PaintController::generateChunkRasterInvalidationRects(PaintChunk& newChunk) |
| } |
| // We reach here because the chunk is new. |
| - newChunk.rasterInvalidationRects.append(FloatRect(LayoutRect::infiniteIntRect())); |
| + PaintInvalidationInfo info; |
| + info.rect = LayoutRect::infiniteIntRect(); |
| + newChunk.rasterInvalidationRects.append(info); |
| } |
| void PaintController::generateChunkRasterInvalidationRectsComparingOldChunk(PaintChunk& newChunk, const PaintChunk& oldChunk) |
| @@ -598,7 +602,15 @@ void PaintController::generateChunkRasterInvalidationRectsComparingOldChunk(Pain |
| clientToInvalidate = &m_newDisplayItemList[movedToIndex].client(); |
| // And invalidate in the new chunk into which the item was moved. |
| PaintChunk& movedToChunk = m_newPaintChunks.findChunkByDisplayItemIndex(movedToIndex); |
| - movedToChunk.rasterInvalidationRects.append(clientToInvalidate->visualRect()); |
| + |
| + PaintInvalidationInfo info; |
| + info.rect = enclosingIntRect(clientToInvalidate->visualRect()); |
| + if (m_isTrackingPaintInvalidations) { |
| + info.client = clientToInvalidate; |
| + info.clientDebugName = clientToInvalidate->debugName(); |
| + info.reason = PaintInvalidationFull; |
| + } |
|
Xianzhu
2016/09/30 00:47:01
Can you extract this as a function?
We can get th
chrishtr
2016/09/30 18:19:10
Done.
|
| + movedToChunk.rasterInvalidationRects.append(info); |
| } else if (movedToIndex < highestMovedToIndex) { |
| // The item has been moved behind other cached items, so need to invalidate the area |
| // that is probably exposed by the item moved earlier. |
| @@ -611,15 +623,30 @@ void PaintController::generateChunkRasterInvalidationRectsComparingOldChunk(Pain |
| clientToInvalidate = &oldItem.client(); |
| } |
| if (clientToInvalidate && invalidatedClientsInOldChunk.add(clientToInvalidate).isNewEntry) { |
| - newChunk.rasterInvalidationRects.append(m_currentPaintArtifact.getDisplayItemList().visualRect(oldIndex)); |
| + PaintInvalidationInfo info; |
| + info.rect = enclosingIntRect(m_currentPaintArtifact.getDisplayItemList().visualRect(oldIndex)); |
| + if (m_isTrackingPaintInvalidations) { |
| + info.client = clientToInvalidate; |
| + info.clientDebugName = clientToInvalidate->debugName(); |
| + info.reason = PaintInvalidationFull; |
| + } |
| + newChunk.rasterInvalidationRects.append(info); |
| } |
| } |
| HashSet<const DisplayItemClient*> invalidatedClientsInNewChunk; |
| for (size_t newIndex = newChunk.beginIndex; newIndex < newChunk.endIndex; ++newIndex) { |
| const DisplayItem& newItem = m_newDisplayItemList[newIndex]; |
| - if (newItem.drawsContent() && !clientCacheIsValid(newItem.client()) && invalidatedClientsInNewChunk.add(&newItem.client()).isNewEntry) |
| - newChunk.rasterInvalidationRects.append(newItem.client().visualRect()); |
| + if (newItem.drawsContent() && !clientCacheIsValid(newItem.client()) && invalidatedClientsInNewChunk.add(&newItem.client()).isNewEntry) { |
| + PaintInvalidationInfo info; |
| + info.rect = enclosingIntRect(newItem.client().visualRect()); |
| + if (m_isTrackingPaintInvalidations) { |
| + info.client = &newItem.client(); |
| + info.clientDebugName = newItem.client().debugName(); |
| + info.reason = PaintInvalidationFull; |
| + } |
| + newChunk.rasterInvalidationRects.append(info); |
| + } |
| } |
| } |