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

Unified Diff: content/renderer/render_widget.cc

Issue 10818038: Make GPU benchmarking numAnimationFrames and totalPaintTime work in software mode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Calculate software paint time in RenderWidget. Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/render_widget.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_widget.cc
diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc
index 0a7f2f46189f3fdb908d4a0bc8d0e396130f86c1..8f35c3f997399427214c3622490baf76d1b1bbac 100644
--- a/content/renderer/render_widget.cc
+++ b/content/renderer/render_widget.cc
@@ -691,8 +691,12 @@ void RenderWidget::PaintRect(const gfx::Rect& rect,
optimized_instance->Paint(webkit_glue::ToWebCanvas(canvas),
optimized_copy_location, rect);
} else {
+ base::TimeTicks paint_begin_ticks = base::TimeTicks::Now();
// Normal painting case.
webwidget_->paint(webkit_glue::ToWebCanvas(canvas), rect);
+ base::TimeDelta paint_time = base::TimeTicks::Now() - paint_begin_ticks;
dtu 2012/07/31 01:35:00 Does base::TimeTicks::Now() have the needed resolu
+ if (!is_accelerated_compositing_active_)
+ software_stats_.totalPaintTimeInSeconds += paint_time.InSecondsF();
piman 2012/07/31 03:32:49 We should have this in the "optimized_instance" ca
dtu 2012/08/03 23:02:47 Done.
// Flush to underlying bitmap. TODO(darin): is this needed?
skia::GetTopDevice(*canvas)->accessBitmap(false);
@@ -889,6 +893,11 @@ void RenderWidget::DoDeferredUpdate() {
}
last_do_deferred_update_time_ = frame_begin_ticks;
+ if (!is_accelerated_compositing_active_) {
+ software_stats_.numAnimationFrames++;
+ software_stats_.numFramesSentToScreen++;
+ }
+
// OK, save the pending update to a local since painting may cause more
// invalidation. Some WebCore rendering objects only layout when painted.
PaintAggregator::PendingUpdate update;
@@ -1769,6 +1778,13 @@ void RenderWidget::CleanupWindowInPluginMoves(gfx::PluginWindowHandle window) {
}
}
+void RenderWidget::GetRenderingStats(WebKit::WebRenderingStats& stats) const {
+ webwidget()->renderingStats(stats);
+ stats.numAnimationFrames += software_stats_.numAnimationFrames;
+ stats.numFramesSentToScreen += software_stats_.numFramesSentToScreen;
+ stats.totalPaintTimeInSeconds += software_stats_.totalPaintTimeInSeconds;
+}
+
void RenderWidget::BeginSmoothScroll(bool down, bool scroll_far) {
Send(new ViewHostMsg_BeginSmoothScroll(routing_id_, down, scroll_far));
}
« no previous file with comments | « content/renderer/render_widget.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698