Index: content/renderer/render_widget.cc |
diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc |
index 43543df6224229ca3f9aa340d8e2718ba5f6a11d..489a20f71d5f661dc21a36dbe8b6d88857a5e8fd 100644 |
--- a/content/renderer/render_widget.cc |
+++ b/content/renderer/render_widget.cc |
@@ -688,11 +688,19 @@ void RenderWidget::PaintRect(const gfx::Rect& rect, |
// WebKit and filling the background (which can be slow) and just painting |
// the plugin. Unlike the DoDeferredUpdate case, an extra copy is still |
// required. |
+ base::TimeTicks paint_begin_ticks = base::TimeTicks::Now(); |
optimized_instance->Paint(webkit_glue::ToWebCanvas(canvas), |
optimized_copy_location, rect); |
+ base::TimeDelta paint_time = base::TimeTicks::Now() - paint_begin_ticks; |
+ if (!is_accelerated_compositing_active_) |
+ software_stats_.totalPaintTimeInSeconds += paint_time.InSecondsF(); |
} else { |
// Normal painting case. |
+ base::TimeTicks paint_begin_ticks = base::TimeTicks::Now(); |
webwidget_->paint(webkit_glue::ToWebCanvas(canvas), rect); |
+ base::TimeDelta paint_time = base::TimeTicks::Now() - paint_begin_ticks; |
+ if (!is_accelerated_compositing_active_) |
+ software_stats_.totalPaintTimeInSeconds += paint_time.InSecondsF(); |
// Flush to underlying bitmap. TODO(darin): is this needed? |
skia::GetTopDevice(*canvas)->accessBitmap(false); |
@@ -889,6 +897,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 +1782,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)); |
} |