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

Unified Diff: cc/resources/picture_pile.cc

Issue 14874004: cc: Inflate invalidation in each picture list (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 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: cc/resources/picture_pile.cc
diff --git a/cc/resources/picture_pile.cc b/cc/resources/picture_pile.cc
index a45dd9e71b1fb1f5ff323805b3f0d094fe6e3f1c..8cdb6df00c59031fafb8baefcc3a43b7a757d698 100644
--- a/cc/resources/picture_pile.cc
+++ b/cc/resources/picture_pile.cc
@@ -46,18 +46,10 @@ void PicturePile::Update(
-kPixelDistanceToRecord,
-kPixelDistanceToRecord);
for (Region::Iterator i(invalidation); i.has_rect(); i.next()) {
- // Inflate all recordings from invalidations with a margin so that when
- // scaled down to at least min_contents_scale, any final pixel touched by an
- // invalidation can be fully rasterized by this picture.
- gfx::Rect inflated_invalidation = i.rect();
- inflated_invalidation.Inset(
- -buffer_pixels(),
- -buffer_pixels(),
- -buffer_pixels(),
- -buffer_pixels());
+ gfx::Rect invalidation = i.rect();
// Split this inflated invalidation across tile boundaries and apply it
// to all tiles that it touches.
- for (TilingData::Iterator iter(&tiling_, inflated_invalidation);
+ for (TilingData::Iterator iter(&tiling_, invalidation);
iter; ++iter) {
gfx::Rect tile =
tiling_.TileBoundsWithBorder(iter.index_x(), iter.index_y());
@@ -68,8 +60,7 @@ void PicturePile::Update(
continue;
}
- gfx::Rect tile_invalidation =
- gfx::IntersectRects(inflated_invalidation, tile);
+ gfx::Rect tile_invalidation = gfx::IntersectRects(invalidation, tile);
if (tile_invalidation.IsEmpty())
continue;
PictureListMap::iterator find = picture_list_map_.find(iter.index());
@@ -77,8 +68,17 @@ void PicturePile::Update(
continue;
PictureList& pic_list = find->second;
// Leave empty pic_lists empty in case there are multiple invalidations.
- if (!pic_list.empty())
+ if (!pic_list.empty()) {
+ // Inflate all recordings from invalidations with a margin so that when
+ // scaled down to at least min_contents_scale, any final pixel touched
+ // by an invalidation can be fully rasterized by this picture.
+ tile_invalidation.Inset(-buffer_pixels(), -buffer_pixels());
+
+ DCHECK_GE(tile_invalidation.width(), buffer_pixels() * 2 + 1);
+ DCHECK_GE(tile_invalidation.height(), buffer_pixels() * 2 + 1);
+
InvalidateRect(pic_list, tile_invalidation);
+ }
}
}

Powered by Google App Engine
This is Rietveld 408576698