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

Unified Diff: content/renderer/render_widget.cc

Issue 11189081: Plumb cc::CCRenderingStats from gpu_benchmarking to cc (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix Windows compilie error Created 8 years, 2 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') | webkit/compositor_bindings/web_layer_tree_view_impl.cc » ('j') | 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 c7308d1fd00266f37d4fb76881b57c3b764c1c27..4ee9c5eb632ea419b458ece195b4bf12a8419752 100644
--- a/content/renderer/render_widget.cc
+++ b/content/renderer/render_widget.cc
@@ -40,6 +40,7 @@
#include "ui/gfx/skia_util.h"
#include "ui/gl/gl_switches.h"
#include "ui/surface/transport_dib.h"
+#include "webkit/glue/compositor_rendering_stats.h"
#include "webkit/glue/webkit_glue.h"
#include "webkit/plugins/npapi/webplugin.h"
#include "webkit/plugins/ppapi/ppapi_plugin_instance.h"
@@ -108,6 +109,9 @@ RenderWidget::RenderWidget(WebKit::WebPopupType popup_type,
is_accelerated_compositing_active_(false),
animation_update_pending_(false),
invalidation_task_posted_(false),
+ num_animation_frames_(0),
+ num_frames_sent_to_screen_(0),
+ total_paint_time_in_seconds_(0),
screen_info_(screen_info),
device_scale_factor_(1),
throttle_input_events_(true),
@@ -720,14 +724,14 @@ void RenderWidget::PaintRect(const gfx::Rect& rect,
canvas->restore();
base::TimeDelta paint_time = base::TimeTicks::Now() - paint_begin_ticks;
if (!is_accelerated_compositing_active_)
- software_stats_.totalPaintTimeInSeconds += paint_time.InSecondsF();
+ total_paint_time_in_seconds_ += 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();
+ total_paint_time_in_seconds_ += paint_time.InSecondsF();
// Flush to underlying bitmap. TODO(darin): is this needed?
skia::GetTopDevice(*canvas)->accessBitmap(false);
@@ -925,8 +929,8 @@ void RenderWidget::DoDeferredUpdate() {
last_do_deferred_update_time_ = frame_begin_ticks;
if (!is_accelerated_compositing_active_) {
- software_stats_.numAnimationFrames++;
- software_stats_.numFramesSentToScreen++;
+ num_animation_frames_++;
+ num_frames_sent_to_screen_++;
}
// OK, save the pending update to a local since painting may cause more
@@ -1862,9 +1866,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;
+
+ cc::CCRenderingStats& cc_stats =
+ static_cast<webkit_glue::CompositorRenderingStats*>(&stats)->cc_stats;
+
+ cc_stats.numAnimationFrames += num_animation_frames_;
+ cc_stats.numFramesSentToScreen += num_frames_sent_to_screen_;
+ cc_stats.totalPaintTimeInSeconds += total_paint_time_in_seconds_;
}
bool RenderWidget::GetGpuRenderingStats(GpuRenderingStats* stats) const {
« no previous file with comments | « content/renderer/render_widget.h ('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