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

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

Issue 258093005: cc: Record statistics about approximated content. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix resolution condition. Created 6 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « cc/debug/rendering_stats.h ('k') | cc/debug/rendering_stats_instrumentation.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 15 matching lines...) Expand all
26 void MainThreadRenderingStats::Add(const MainThreadRenderingStats& other) { 26 void MainThreadRenderingStats::Add(const MainThreadRenderingStats& other) {
27 frame_count += other.frame_count; 27 frame_count += other.frame_count;
28 paint_time += other.paint_time; 28 paint_time += other.paint_time;
29 painted_pixel_count += other.painted_pixel_count; 29 painted_pixel_count += other.painted_pixel_count;
30 record_time += other.record_time; 30 record_time += other.record_time;
31 recorded_pixel_count += other.recorded_pixel_count; 31 recorded_pixel_count += other.recorded_pixel_count;
32 } 32 }
33 33
34 ImplThreadRenderingStats::ImplThreadRenderingStats() 34 ImplThreadRenderingStats::ImplThreadRenderingStats()
35 : frame_count(0), 35 : frame_count(0),
36 rasterized_pixel_count(0) {} 36 rasterized_pixel_count(0),
37 visible_content_area(0),
38 approximated_visible_content_area(0) {
39 }
37 40
38 scoped_refptr<base::debug::ConvertableToTraceFormat> 41 scoped_refptr<base::debug::ConvertableToTraceFormat>
39 ImplThreadRenderingStats::AsTraceableData() const { 42 ImplThreadRenderingStats::AsTraceableData() const {
40 scoped_ptr<base::DictionaryValue> record_data(new base::DictionaryValue()); 43 scoped_ptr<base::DictionaryValue> record_data(new base::DictionaryValue());
41 record_data->SetInteger("frame_count", frame_count); 44 record_data->SetInteger("frame_count", frame_count);
42 record_data->SetDouble("rasterize_time", rasterize_time.InSecondsF()); 45 record_data->SetDouble("rasterize_time", rasterize_time.InSecondsF());
43 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);
48 record_data->SetInteger("approximated_visible_content_area",
49 approximated_visible_content_area);
44 return TracedValue::FromValue(record_data.release()); 50 return TracedValue::FromValue(record_data.release());
45 } 51 }
46 52
47 void ImplThreadRenderingStats::Add(const ImplThreadRenderingStats& other) { 53 void ImplThreadRenderingStats::Add(const ImplThreadRenderingStats& other) {
48 frame_count += other.frame_count; 54 frame_count += other.frame_count;
49 rasterize_time += other.rasterize_time; 55 rasterize_time += other.rasterize_time;
50 analysis_time += other.analysis_time; 56 analysis_time += other.analysis_time;
51 rasterized_pixel_count += other.rasterized_pixel_count; 57 rasterized_pixel_count += other.rasterized_pixel_count;
58 visible_content_area += other.visible_content_area;
59 approximated_visible_content_area += other.approximated_visible_content_area;
52 } 60 }
53 61
54 void RenderingStats::Add(const RenderingStats& other) { 62 void RenderingStats::Add(const RenderingStats& other) {
55 main_stats.Add(other.main_stats); 63 main_stats.Add(other.main_stats);
56 impl_stats.Add(other.impl_stats); 64 impl_stats.Add(other.impl_stats);
57 } 65 }
58 66
59 } // namespace cc 67 } // namespace cc
OLDNEW
« no previous file with comments | « cc/debug/rendering_stats.h ('k') | cc/debug/rendering_stats_instrumentation.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698