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

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
« no previous file with comments | « cc/resources/picture_pile.h ('k') | cc/resources/picture_pile_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/picture_pile.cc
diff --git a/cc/resources/picture_pile.cc b/cc/resources/picture_pile.cc
index 8f8bada1ebaeb9536a19c1bc9f7a211759f186cd..9fe76dbd259be925f1b1cb0415657d4cc878e042 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);
+ }
}
}
« no previous file with comments | « cc/resources/picture_pile.h ('k') | cc/resources/picture_pile_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698