summaryrefslogtreecommitdiffstats
path: root/cc/debug
diff options
context:
space:
mode:
Diffstat (limited to 'cc/debug')
-rw-r--r--cc/debug/rendering_stats.cc10
-rw-r--r--cc/debug/rendering_stats.h2
-rw-r--r--cc/debug/rendering_stats_instrumentation.cc17
-rw-r--r--cc/debug/rendering_stats_instrumentation.h2
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();