Chromium Code Reviews| 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); |