| Index: cc/resources/picture_pile.cc
|
| diff --git a/cc/resources/picture_pile.cc b/cc/resources/picture_pile.cc
|
| index 17283ddd2631f71a208b27633de1eb5dc6c2409f..2eac495dcbfd8de8b2722c3cbc9dca8077d25925 100644
|
| --- a/cc/resources/picture_pile.cc
|
| +++ b/cc/resources/picture_pile.cc
|
| @@ -5,10 +5,12 @@
|
| #include "cc/resources/picture_pile.h"
|
|
|
| #include <algorithm>
|
| +#include <limits>
|
| #include <vector>
|
|
|
| #include "cc/base/region.h"
|
| #include "cc/debug/benchmark_instrumentation.h"
|
| +#include "cc/debug/rendering_stats_instrumentation.h"
|
| #include "cc/resources/picture_pile_impl.h"
|
|
|
| namespace {
|
| @@ -114,8 +116,23 @@ bool PicturePile::Update(
|
| modified_pile = true;
|
| TRACE_EVENT0(benchmark_instrumentation::kCategory,
|
| benchmark_instrumentation::kRecordLoop);
|
| - for (int i = 0; i < repeat_count; i++)
|
| - (*pic)->Record(painter, tile_grid_info_, stats_instrumentation);
|
| + base::TimeDelta total_duration =
|
| + base::TimeDelta::FromInternalValue(0);
|
| + base::TimeDelta best_duration = base::TimeDelta::FromInternalValue(
|
| + std::numeric_limits<int64>::max());
|
| + for (int i = 0; i < repeat_count; i++) {
|
| + base::TimeTicks start_time = stats_instrumentation->StartRecording();
|
| + (*pic)->Record(painter, tile_grid_info_);
|
| + base::TimeDelta duration =
|
| + stats_instrumentation->EndRecording(start_time);
|
| + total_duration += duration;
|
| + best_duration = std::min(duration, best_duration);
|
| + }
|
| + int painted_pixels =
|
| + (*pic)->LayerRect().width() * (*pic)->LayerRect().height();
|
| + stats_instrumentation->AddRecord(total_duration,
|
| + best_duration,
|
| + painted_pixels);
|
| (*pic)->GatherPixelRefs(tile_grid_info_, stats_instrumentation);
|
| (*pic)->CloneForDrawing(num_raster_threads_);
|
| }
|
|
|