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

Unified Diff: content/renderer/render_widget.cc

Issue 10982078: Adding hooks for gathering total pixels painted and rasterized stats. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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
Index: content/renderer/render_widget.cc
diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc
index 9e723b5cc14f45f8ac68f62d6c46b406f2156fd9..bd72d3621cf28679228f76e34723a5f0050d13bb 100644
--- a/content/renderer/render_widget.cc
+++ b/content/renderer/render_widget.cc
@@ -666,6 +666,8 @@ void RenderWidget::PaintRect(const gfx::Rect& rect,
skia::PlatformCanvas* canvas) {
TRACE_EVENT2("renderer", "PaintRect",
"width", rect.width(), "height", rect.height());
+
+ base::TimeTicks rasterize_begin_ticks = base::TimeTicks::Now();
nduca 2012/11/06 21:30:53 HighResNow
hartmanng 2012/11/06 21:53:16 Done here and for the paint version of this.
canvas->save();
// Bring the canvas into the coordinate system of the paint rect.
@@ -744,6 +746,14 @@ void RenderWidget::PaintRect(const gfx::Rect& rect,
PaintDebugBorder(rect, canvas);
canvas->restore();
+
+ base::TimeDelta rasterize_time =
+ base::TimeTicks::Now() - rasterize_begin_ticks;
+ software_stats_.totalRasterizeTimeInSeconds += rasterize_time.InSecondsF();
+
+ int64 num_pixels_processed = rect.width() * rect.height();
+ software_stats_.totalPixelsPainted += num_pixels_processed;
+ software_stats_.totalPixelsRasterized += num_pixels_processed;
}
void RenderWidget::PaintDebugBorder(const gfx::Rect& rect,
@@ -1890,6 +1900,10 @@ void RenderWidget::GetRenderingStats(WebKit::WebRenderingStats& stats) const {
stats.numAnimationFrames += software_stats_.numAnimationFrames;
stats.numFramesSentToScreen += software_stats_.numFramesSentToScreen;
stats.totalPaintTimeInSeconds += software_stats_.totalPaintTimeInSeconds;
+ stats.totalPixelsPainted += software_stats_.totalPixelsPainted;
+ stats.totalRasterizeTimeInSeconds +=
+ software_stats_.totalRasterizeTimeInSeconds;
+ stats.totalPixelsRasterized += software_stats_.totalPixelsRasterized;
}
bool RenderWidget::GetGpuRenderingStats(GpuRenderingStats* stats) const {
« no previous file with comments | « content/renderer/gpu/gpu_benchmarking_extension.cc ('k') | webkit/compositor_bindings/web_layer_tree_view_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698