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

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..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));
}
}
}

Powered by Google App Engine
This is Rietveld 408576698