Chromium Code Reviews| 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 528f31b886948436f746505e57ddf1a07b3a61bc..90bc1957900a56aa56f83b903ed3aa5583d77c07 100644 |
| --- a/third_party/WebKit/Source/platform/graphics/paint/PaintArtifact.cpp |
| +++ b/third_party/WebKit/Source/platform/graphics/paint/PaintArtifact.cpp |
| @@ -19,20 +19,18 @@ void computeChunkBoundsAndOpaqueness(const DisplayItemList& displayItems, Vector |
| { |
| for (PaintChunk& chunk : paintChunks) { |
| FloatRect bounds; |
| - SkRegion knownToBeOpaqueRegion; |
| + FloatRect knownToBeOpaqueRegion; |
| for (const DisplayItem& item : displayItems.itemsInPaintChunk(chunk)) { |
| + FloatRect visualRect(item.client().visualRect()); |
| + |
| + bounds.unite(visualRect); |
| if (!item.isDrawing()) |
| continue; |
| const auto& drawing = static_cast<const DrawingDisplayItem&>(item); |
| if (const SkPicture* picture = drawing.picture()) { |
| - const SkRect& pictureRect = picture->cullRect(); |
| - bounds.unite(pictureRect); |
| if (drawing.knownToBeOpaque()) { |
|
Xianzhu
2016/09/20 23:13:41
There seems a problem: the picture may be smaller
chrishtr
2016/09/20 23:43:59
Good point. Reverted this part.
|
| - // TODO(pdr): This may be too conservative and fail due to |
| - // floating point precision issues. |
| - SkIRect conservativelyRoundedPictureRect; |
| - pictureRect.roundIn(&conservativelyRoundedPictureRect); |
| - knownToBeOpaqueRegion.op(conservativelyRoundedPictureRect, SkRegion::kUnion_Op); |
| + // TODO(pdr): It may be too conservative to round in to the enclosedIntRect. |
| + knownToBeOpaqueRegion.unite(enclosedIntRect(visualRect)); |
| } |
| } |
| } |