Chromium Code Reviews| Index: cc/resources/picture_pile.cc |
| diff --git a/cc/resources/picture_pile.cc b/cc/resources/picture_pile.cc |
| index 43b13c577941531cebac25736e7ba2003c5b1e93..4cb346ccee8d80e4162645f8695d4b7a362f37cf 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()) { |
| @@ -206,8 +208,6 @@ bool PicturePile::Update( |
| ClusterTiles(invalid_tiles, &record_rects); |
| if (record_rects.empty()) { |
| - if (invalidated) |
| - UpdateRecordedRegion(); |
| return invalidated; |
| } |
|
vmpstr
2014/03/12 23:57:35
nit: remove the braces as well, please
enne (OOO)
2014/03/13 01:35:43
Done, but make sure you imagine me grumbling as I
|
| @@ -245,6 +245,7 @@ bool PicturePile::Update( |
| stats_instrumentation->AddRecord(best_duration, recorded_pixel_count); |
| } |
| + bool found_tile_for_recorded_picture = false; |
| for (TilingData::Iterator it(&tiling_, record_rect); |
| it; ++it) { |
| const PictureMapKey& key = it.index(); |
| @@ -252,11 +253,13 @@ 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; |
| return true; |
| } |