diff options
author | ernstm@chromium.org <ernstm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-30 05:29:22 +0000 |
---|---|---|
committer | ernstm@chromium.org <ernstm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-30 05:29:22 +0000 |
commit | 2bc19e5326705d8f94e927d026cf18d3538ddb45 (patch) | |
tree | 432675b0566c5b6c89fe65eb62cfd6e1f6b52400 /cc/debug | |
parent | 2fad0960a52b84e195f57d5bd73980f6e8fc0546 (diff) | |
download | chromium_src-2bc19e5326705d8f94e927d026cf18d3538ddb45.zip chromium_src-2bc19e5326705d8f94e927d026cf18d3538ddb45.tar.gz chromium_src-2bc19e5326705d8f94e927d026cf18d3538ddb45.tar.bz2 |
cc: Record statistics about approximated content.
Record the total visible content area and the approximated visible content
area. Approximated area is the visible area covered by low-res or missing tiles.
These statistics will be used in a follow-up patch to report the percentage of
pixels that were approximated in smoothness benchmark.
R=vmpstr@chromium.org,enne@chromium.org,
BUG=308652
Review URL: https://codereview.chromium.org/258093005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@267088 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/debug')
-rw-r--r-- | cc/debug/rendering_stats.cc | 10 | ||||
-rw-r--r-- | cc/debug/rendering_stats.h | 2 | ||||
-rw-r--r-- | cc/debug/rendering_stats_instrumentation.cc | 17 | ||||
-rw-r--r-- | cc/debug/rendering_stats_instrumentation.h | 2 |
4 files changed, 30 insertions, 1 deletions
diff --git a/cc/debug/rendering_stats.cc b/cc/debug/rendering_stats.cc index 5c194c6..3e123b66 100644 --- a/cc/debug/rendering_stats.cc +++ b/cc/debug/rendering_stats.cc @@ -33,7 +33,10 @@ void MainThreadRenderingStats::Add(const MainThreadRenderingStats& other) { ImplThreadRenderingStats::ImplThreadRenderingStats() : frame_count(0), - rasterized_pixel_count(0) {} + rasterized_pixel_count(0), + visible_content_area(0), + approximated_visible_content_area(0) { +} scoped_refptr<base::debug::ConvertableToTraceFormat> ImplThreadRenderingStats::AsTraceableData() const { @@ -41,6 +44,9 @@ ImplThreadRenderingStats::AsTraceableData() const { record_data->SetInteger("frame_count", frame_count); record_data->SetDouble("rasterize_time", rasterize_time.InSecondsF()); record_data->SetInteger("rasterized_pixel_count", rasterized_pixel_count); + record_data->SetInteger("visible_content_area", visible_content_area); + record_data->SetInteger("approximated_visible_content_area", + approximated_visible_content_area); return TracedValue::FromValue(record_data.release()); } @@ -49,6 +55,8 @@ void ImplThreadRenderingStats::Add(const ImplThreadRenderingStats& other) { rasterize_time += other.rasterize_time; analysis_time += other.analysis_time; rasterized_pixel_count += other.rasterized_pixel_count; + visible_content_area += other.visible_content_area; + approximated_visible_content_area += other.approximated_visible_content_area; } void RenderingStats::Add(const RenderingStats& other) { diff --git a/cc/debug/rendering_stats.h b/cc/debug/rendering_stats.h index 72262c8..bd3b7c7 100644 --- a/cc/debug/rendering_stats.h +++ b/cc/debug/rendering_stats.h @@ -35,6 +35,8 @@ struct CC_EXPORT ImplThreadRenderingStats { base::TimeDelta rasterize_time; base::TimeDelta analysis_time; int64 rasterized_pixel_count; + int64 visible_content_area; + int64 approximated_visible_content_area; ImplThreadRenderingStats(); scoped_refptr<base::debug::ConvertableToTraceFormat> AsTraceableData() const; diff --git a/cc/debug/rendering_stats_instrumentation.cc b/cc/debug/rendering_stats_instrumentation.cc index 63840a3..36893f8 100644 --- a/cc/debug/rendering_stats_instrumentation.cc +++ b/cc/debug/rendering_stats_instrumentation.cc @@ -108,4 +108,21 @@ void RenderingStatsInstrumentation::AddAnalysis(base::TimeDelta duration, impl_stats_.analysis_time += duration; } +void RenderingStatsInstrumentation::AddVisibleContentArea(int64 area) { + if (!record_rendering_stats_) + return; + + base::AutoLock scoped_lock(lock_); + impl_stats_.visible_content_area += area; +} + +void RenderingStatsInstrumentation::AddApproximatedVisibleContentArea( + int64 area) { + if (!record_rendering_stats_) + return; + + base::AutoLock scoped_lock(lock_); + impl_stats_.approximated_visible_content_area += area; +} + } // namespace cc diff --git a/cc/debug/rendering_stats_instrumentation.h b/cc/debug/rendering_stats_instrumentation.h index 6811755..3a02fe9 100644 --- a/cc/debug/rendering_stats_instrumentation.h +++ b/cc/debug/rendering_stats_instrumentation.h @@ -53,6 +53,8 @@ class CC_EXPORT RenderingStatsInstrumentation { void AddRecord(base::TimeDelta duration, int64 pixels); void AddRaster(base::TimeDelta duration, int64 pixels); void AddAnalysis(base::TimeDelta duration, int64 pixels); + void AddVisibleContentArea(int64 area); + void AddApproximatedVisibleContentArea(int64 area); protected: RenderingStatsInstrumentation(); |