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

Unified Diff: cc/resources/picture_pile.cc

Issue 196343005: cc: Replace recorded region with direct map lookup (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Partial invalidation test case Created 6 years, 9 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/layers/picture_layer_unittest.cc ('k') | cc/resources/picture_pile_base.h » ('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 35d026f225ddb6a3a245048da2ee9657bc504092..e82a23e0fe4303bf1fe08ed1a0b2d5a2e3c8e855 100644
--- a/cc/resources/picture_pile.cc
+++ b/cc/resources/picture_pile.cc
@@ -164,6 +164,8 @@ bool PicturePile::Update(
-kPixelDistanceToRecord,
-kPixelDistanceToRecord,
-kPixelDistanceToRecord);
+ recorded_viewport_ = interest_rect;
+ recorded_viewport_.Intersect(gfx::Rect(size()));
bool invalidated = false;
for (Region::Iterator i(invalidation); i.has_rect(); i.next()) {
@@ -201,17 +203,20 @@ bool PicturePile::Update(
if (info.NeedsRecording(frame_number, distance_to_visible)) {
gfx::Rect tile = tiling_.TileBounds(key.first, key.second);
invalid_tiles.push_back(tile);
+ } else if (!info.GetPicture() && recorded_viewport_.Intersects(rect)) {
+ // Recorded viewport is just an optimization for a fully recorded
+ // interest rect. In this case, a tile in that rect has declined
+ // to be recorded (probably due to frequent invalidations).
+ // TODO(enne): Shrink the recorded_viewport_ rather than clearing.
+ recorded_viewport_ = gfx::Rect();
}
}
std::vector<gfx::Rect> record_rects;
ClusterTiles(invalid_tiles, &record_rects);
- if (record_rects.empty()) {
- if (invalidated)
- UpdateRecordedRegion();
+ if (record_rects.empty())
return invalidated;
- }
for (std::vector<gfx::Rect>::iterator it = record_rects.begin();
it != record_rects.end();
@@ -247,6 +252,8 @@ bool PicturePile::Update(
stats_instrumentation->AddRecord(best_duration, recorded_pixel_count);
}
+ bool found_tile_for_recorded_picture = false;
+
bool include_borders = true;
for (TilingData::Iterator it(&tiling_, record_rect, include_borders); it;
++it) {
@@ -255,11 +262,14 @@ bool PicturePile::Update(
if (record_rect.Contains(tile)) {
PictureInfo& info = picture_map_[key];
info.SetPicture(picture);
+ found_tile_for_recorded_picture = true;
}
}
+ DCHECK(found_tile_for_recorded_picture);
}
- UpdateRecordedRegion();
+ has_any_recordings_ = true;
+ DCHECK(CanRasterSlowTileCheck(recorded_viewport_));
return true;
}
« no previous file with comments | « cc/layers/picture_layer_unittest.cc ('k') | cc/resources/picture_pile_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698