Chromium Code Reviews| Index: cc/resources/picture_pile.cc |
| diff --git a/cc/resources/picture_pile.cc b/cc/resources/picture_pile.cc |
| index 2ce3e500f2ea86458054ed71b8854a096fff5328..16167f4cf50861523632688cb975d5e26ade0aa0 100644 |
| --- a/cc/resources/picture_pile.cc |
| +++ b/cc/resources/picture_pile.cc |
| @@ -8,6 +8,7 @@ |
| #include <limits> |
| #include <vector> |
| +#include "cc/base/histograms.h" |
| #include "cc/base/region.h" |
| #include "cc/resources/picture_pile_impl.h" |
| #include "skia/ext/analysis_canvas.h" |
| @@ -149,6 +150,11 @@ const bool kDefaultClearCanvasSetting = false; |
| const bool kDefaultClearCanvasSetting = true; |
| #endif |
| +DEFINE_SCOPED_UMA_HISTOGRAM_AREA_TIMER( |
| + ScopedPicturePileUpdateTimer, |
| + "Renderer4.PicturePileRecordUs", |
| + "Renderer4.PicturePileRecordedAreaPerMs"); |
| + |
| } // namespace |
| namespace cc { |
| @@ -181,6 +187,8 @@ bool PicturePile::UpdateAndExpandInvalidation( |
| const gfx::Rect& visible_layer_rect, |
| int frame_number, |
| RecordingSource::RecordingMode recording_mode) { |
| + ScopedPicturePileUpdateTimer timer; |
| + |
| gfx::Rect interest_rect = visible_layer_rect; |
| interest_rect.Inset(-pixel_record_distance_, -pixel_record_distance_); |
| recorded_viewport_ = interest_rect; |
| @@ -188,6 +196,11 @@ bool PicturePile::UpdateAndExpandInvalidation( |
| bool updated = ApplyInvalidationAndResize(interest_rect, invalidation, |
| layer_size, frame_number); |
| + |
| + // Count the area that is being invalidated. |
| + for (Region::Iterator it(*invalidation); it.has_rect(); it.next()) |
|
enne (OOO)
2015/04/13 21:52:27
You need to intersect these invalidations with the
jbroman
2015/04/14 16:02:17
Which rect is the right one to intersect with? I s
enne (OOO)
2015/04/14 16:55:19
Oops, sorry forgot to address this comment. You s
|
| + timer.AddArea(it.rect().size().GetArea()); |
| + |
| std::vector<gfx::Rect> invalid_tiles; |
| GetInvalidTileRects(interest_rect, &invalid_tiles); |
| std::vector<gfx::Rect> record_rects; |