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

Unified Diff: cc/layers/picture_layer.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
« no previous file with comments | « no previous file | cc/layers/picture_layer_impl_unittest.cc » ('j') | cc/resources/recording_source.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/picture_layer.cc
diff --git a/cc/layers/picture_layer.cc b/cc/layers/picture_layer.cc
index 5c4cb068d14dda4ac3ea57e789f21097dc0755f1..a4108f29a1105a6e44b065233450b580b98f7939 100644
--- a/cc/layers/picture_layer.cc
+++ b/cc/layers/picture_layer.cc
@@ -5,6 +5,8 @@
#include "cc/layers/picture_layer.h"
#include "base/auto_reset.h"
+#include "base/metrics/histogram_macros.h"
+#include "base/timer/elapsed_timer.h"
#include "cc/layers/content_layer_client.h"
#include "cc/layers/picture_layer_impl.h"
#include "cc/resources/display_list_recording_source.h"
@@ -136,6 +138,7 @@ bool PictureLayer::Update(ResourceUpdateQueue* queue,
layer_tree_host()->source_frame_number());
devtools_instrumentation::ScopedLayerTreeTask update_layer(
devtools_instrumentation::kUpdateLayer, id(), layer_tree_host()->id());
+ base::ElapsedTimer timer;
// Calling paint in WebKit can sometimes cause invalidations, so save
// off the invalidation prior to calling update.
@@ -152,10 +155,12 @@ bool PictureLayer::Update(ResourceUpdateQueue* queue,
// anything not explicitly recorded in this frame. We give this region
// to the impl side so that it drops tiles that may not have a recording
// for them.
+ int recorded_area = 0;
DCHECK(client_);
updated |= recording_source_->UpdateAndExpandInvalidation(
client_, &recording_invalidation_, layer_size, visible_layer_rect,
- update_source_frame_number_, RecordingSource::RECORD_NORMALLY);
+ update_source_frame_number_, RecordingSource::RECORD_NORMALLY,
+ &recorded_area);
enne (OOO) 2015/04/09 17:37:34 Yeah, I think this is the right metric. Can you p
jbroman 2015/04/09 20:54:06 Okay, split (with different stat names). This trig
last_updated_visible_content_rect_ = visible_content_rect();
if (updated) {
@@ -166,6 +171,12 @@ bool PictureLayer::Update(ResourceUpdateQueue* queue,
recording_invalidation_.Clear();
}
+ base::TimeDelta elapsed = timer.Elapsed();
+ UMA_HISTOGRAM_COUNTS("Renderer4.PictureLayerUpdateUs",
+ elapsed.InMicroseconds());
+ UMA_HISTOGRAM_COUNTS("Renderer4.PictureLayerUpdatePixelsPerMs",
+ recorded_area / elapsed.InMillisecondsF());
+
return updated;
}
@@ -190,7 +201,7 @@ skia::RefPtr<SkPicture> PictureLayer::GetPicture() const {
Region recording_invalidation;
recording_source->UpdateAndExpandInvalidation(
client_, &recording_invalidation, layer_size, gfx::Rect(layer_size),
- update_source_frame_number_, RecordingSource::RECORD_NORMALLY);
+ update_source_frame_number_, RecordingSource::RECORD_NORMALLY, nullptr);
scoped_refptr<RasterSource> raster_source =
recording_source->CreateRasterSource(false);
« no previous file with comments | « no previous file | cc/layers/picture_layer_impl_unittest.cc » ('j') | cc/resources/recording_source.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698