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

Unified Diff: cc/resources/picture_pile.cc

Issue 25284005: cc: Add best_record_time to rendering stats. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 7 years, 3 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 | « cc/resources/picture.cc ('k') | cc/resources/picture_pile_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_);
}
« no previous file with comments | « cc/resources/picture.cc ('k') | cc/resources/picture_pile_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698