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

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

Issue 2345233004: Reuse cc::PictureLayers when possible for SPv2. (Closed)
Patch Set: none Created 4 years, 3 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/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..f4d169178cace4f93cd969b0ece46d0f2719889d 100644
--- a/third_party/WebKit/Source/platform/graphics/paint/PaintArtifact.cpp
+++ b/third_party/WebKit/Source/platform/graphics/paint/PaintArtifact.cpp
@@ -21,16 +21,15 @@ void computeChunkBoundsAndOpaqueness(const DisplayItemList& displayItems, Vector
FloatRect bounds;
SkRegion knownToBeOpaqueRegion;
for (const DisplayItem& item : displayItems.itemsInPaintChunk(chunk)) {
+ bounds.unite(FloatRect(item.client().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()) {
- // TODO(pdr): This may be too conservative and fail due to
- // floating point precision issues.
+ // TODO(pdr): It may be too conservative to round in to the enclosedIntRect.
SkIRect conservativelyRoundedPictureRect;
+ const SkRect& pictureRect = picture->cullRect();
pictureRect.roundIn(&conservativelyRoundedPictureRect);
knownToBeOpaqueRegion.op(conservativelyRoundedPictureRect, SkRegion::kUnion_Op);
}

Powered by Google App Engine
This is Rietveld 408576698