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

Side by Side Diff: cc/debug/rendering_stats.cc

Issue 363003002: Add duration estimation data to RenderingStats. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Check we only add duration data once per frame. Created 6 years, 5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/values.h" 5 #include "base/values.h"
6 #include "cc/debug/rendering_stats.h" 6 #include "cc/debug/rendering_stats.h"
7 7
8 namespace cc { 8 namespace cc {
9 9
10 MainThreadRenderingStats::MainThreadRenderingStats() 10 MainThreadRenderingStats::MainThreadRenderingStats()
(...skipping 29 matching lines...) Expand all
40 40
41 scoped_refptr<base::debug::ConvertableToTraceFormat> 41 scoped_refptr<base::debug::ConvertableToTraceFormat>
42 ImplThreadRenderingStats::AsTraceableData() const { 42 ImplThreadRenderingStats::AsTraceableData() const {
43 scoped_ptr<base::DictionaryValue> record_data(new base::DictionaryValue()); 43 scoped_ptr<base::DictionaryValue> record_data(new base::DictionaryValue());
44 record_data->SetInteger("frame_count", frame_count); 44 record_data->SetInteger("frame_count", frame_count);
45 record_data->SetDouble("rasterize_time", rasterize_time.InSecondsF()); 45 record_data->SetDouble("rasterize_time", rasterize_time.InSecondsF());
46 record_data->SetInteger("rasterized_pixel_count", rasterized_pixel_count); 46 record_data->SetInteger("rasterized_pixel_count", rasterized_pixel_count);
47 record_data->SetInteger("visible_content_area", visible_content_area); 47 record_data->SetInteger("visible_content_area", visible_content_area);
48 record_data->SetInteger("approximated_visible_content_area", 48 record_data->SetInteger("approximated_visible_content_area",
49 approximated_visible_content_area); 49 approximated_visible_content_area);
50 record_data->SetDouble("draw_duration", draw_duration.InMillisecondsF());
51 record_data->SetDouble("draw_duration_estimate",
52 draw_duration_estimate.InMillisecondsF());
53 record_data->SetDouble("begin_main_frame_to_commit_duration",
54 begin_main_frame_to_commit_duration.InMillisecondsF());
55 record_data->SetDouble(
56 "begin_main_frame_to_commit_duration_estimate",
57 begin_main_frame_to_commit_duration_estimate.InMillisecondsF());
58 record_data->SetDouble("commit_to_activate_duration",
59 commit_to_activate_duration.InMillisecondsF());
60 record_data->SetDouble(
61 "commit_to_activate_duration_estimate",
brianderson 2014/07/02 22:39:28 Postfix labels with _ms so units are easy to figur
Dominik Grewe 2014/07/03 13:16:38 Done.
ernstm 2014/07/08 15:01:36 I'd prefer consistent units for all time values. I
62 commit_to_activate_duration_estimate.InMillisecondsF());
50 return TracedValue::FromValue(record_data.release()); 63 return TracedValue::FromValue(record_data.release());
51 } 64 }
52 65
53 void ImplThreadRenderingStats::Add(const ImplThreadRenderingStats& other) { 66 void ImplThreadRenderingStats::Add(const ImplThreadRenderingStats& other) {
54 frame_count += other.frame_count; 67 frame_count += other.frame_count;
55 rasterize_time += other.rasterize_time; 68 rasterize_time += other.rasterize_time;
56 analysis_time += other.analysis_time; 69 analysis_time += other.analysis_time;
57 rasterized_pixel_count += other.rasterized_pixel_count; 70 rasterized_pixel_count += other.rasterized_pixel_count;
58 visible_content_area += other.visible_content_area; 71 visible_content_area += other.visible_content_area;
59 approximated_visible_content_area += other.approximated_visible_content_area; 72 approximated_visible_content_area += other.approximated_visible_content_area;
73
74 // There should only ever be one sample of these durations per frame.
Dominik Grewe 2014/07/02 14:43:22 Adding up values doesn't really make sense. We cou
brianderson 2014/07/02 22:39:28 Yeah, it doesn't make sense. Definitely get rid of
ernstm 2014/07/08 15:01:36 I think we can get rid of the accumulated stats en
Dominik Grewe 2014/07/08 15:10:41 I don't think it would simplify this patch a lot.
75 draw_duration += other.draw_duration;
76 draw_duration_estimate += other.draw_duration_estimate;
77 begin_main_frame_to_commit_duration +=
78 other.begin_main_frame_to_commit_duration;
79 begin_main_frame_to_commit_duration_estimate +=
80 other.begin_main_frame_to_commit_duration_estimate;
81 commit_to_activate_duration += other.commit_to_activate_duration;
82 commit_to_activate_duration_estimate +=
83 other.commit_to_activate_duration_estimate;
60 } 84 }
61 85
62 void RenderingStats::Add(const RenderingStats& other) { 86 void RenderingStats::Add(const RenderingStats& other) {
63 main_stats.Add(other.main_stats); 87 main_stats.Add(other.main_stats);
64 impl_stats.Add(other.impl_stats); 88 impl_stats.Add(other.impl_stats);
65 } 89 }
66 90
67 } // namespace cc 91 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698