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

Unified Diff: cc/playback/picture_pile.cc

Issue 1139743004: cc: Reland "Add UMA stats for record and raster time." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge with master (conflicts with cc/resources move) Created 5 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/playback/picture_pile.cc
diff --git a/cc/playback/picture_pile.cc b/cc/playback/picture_pile.cc
index b7b2822195bed289580a052401bcbf8a1704b9cd..55a5f80997a4a68685a3d720eaf5f84efe4c6f7b 100644
--- a/cc/playback/picture_pile.cc
+++ b/cc/playback/picture_pile.cc
@@ -8,6 +8,7 @@
#include <limits>
#include <vector>
+#include "cc/base/histograms.h"
#include "cc/base/region.h"
#include "cc/playback/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,
+ "Compositing.PicturePile.UpdateUs",
+ "Compositing.PicturePile.UpdateInvalidatedAreaPerMs");
+
} // 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,13 @@ bool PicturePile::UpdateAndExpandInvalidation(
bool updated = ApplyInvalidationAndResize(interest_rect, invalidation,
layer_size, frame_number);
+
+ // Count the area that is being invalidated.
+ Region recorded_invalidation(*invalidation);
+ recorded_invalidation.Intersect(recorded_viewport_);
+ for (Region::Iterator it(recorded_invalidation); it.has_rect(); it.next())
+ timer.AddArea(it.rect().size().GetArea());
+
std::vector<gfx::Rect> invalid_tiles;
GetInvalidTileRects(interest_rect, &invalid_tiles);
std::vector<gfx::Rect> record_rects;

Powered by Google App Engine
This is Rietveld 408576698