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

Unified Diff: cc/resources/picture_pile.cc

Issue 1075523002: cc: Add UMA stats for record and raster time. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: use area actually recorded Created 5 years, 8 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/resources/picture_pile.cc
diff --git a/cc/resources/picture_pile.cc b/cc/resources/picture_pile.cc
index 1b814477b427f3324d0f5b9048187d5c658e949a..64a51eb5dab109a89f01f176184edd826a44d212 100644
--- a/cc/resources/picture_pile.cc
+++ b/cc/resources/picture_pile.cc
@@ -8,6 +8,7 @@
#include <limits>
#include <vector>
+#include "base/numerics/safe_math.h"
#include "cc/base/region.h"
#include "cc/resources/picture_pile_impl.h"
#include "skia/ext/analysis_canvas.h"
@@ -180,7 +181,8 @@ bool PicturePile::UpdateAndExpandInvalidation(
const gfx::Size& layer_size,
const gfx::Rect& visible_layer_rect,
int frame_number,
- RecordingSource::RecordingMode recording_mode) {
+ RecordingSource::RecordingMode recording_mode,
+ int* recorded_area) {
gfx::Rect interest_rect = visible_layer_rect;
interest_rect.Inset(-pixel_record_distance_, -pixel_record_distance_);
recorded_viewport_ = interest_rect;
@@ -194,6 +196,13 @@ bool PicturePile::UpdateAndExpandInvalidation(
std::vector<gfx::Rect> record_rects;
ClusterTiles(invalid_tiles, &record_rects);
+ if (recorded_area) {
+ base::CheckedNumeric<int> area = 0;
+ for (const auto& record_rect : record_rects)
+ area += record_rect.size().GetArea();
+ *recorded_area = area.ValueOrDefault(std::numeric_limits<int>::max());
+ }
+
if (record_rects.empty())
return updated;

Powered by Google App Engine
This is Rietveld 408576698