diff options
author | backer@chromium.org <backer@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-29 21:11:00 +0000 |
---|---|---|
committer | backer@chromium.org <backer@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-29 21:11:00 +0000 |
commit | cff176a476e0a9d9f0154d679a497fe21ed8b9ca (patch) | |
tree | fb726110b028659b36ab10f16fa6165d19af541e /content | |
parent | d88e17fa4882a14b86ac753780f20d9481d7d113 (diff) | |
download | chromium_src-cff176a476e0a9d9f0154d679a497fe21ed8b9ca.zip chromium_src-cff176a476e0a9d9f0154d679a497fe21ed8b9ca.tar.gz chromium_src-cff176a476e0a9d9f0154d679a497fe21ed8b9ca.tar.bz2 |
Aura: ACK on the start of the frame generation for greater async.
By responding to AcceleratedSurfaceBuffersSwapped and AcceleratedSurfacePostSubBuffer early, we allow the GPU process to service the renderer while the browser UI is generating it's next frame. This buys us about 2 ms of processing according to chrome://tracing
BUG=none
TEST=none
Review URL: https://chromiumcodereview.appspot.com/10692044
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@144990 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r-- | content/browser/renderer_host/render_widget_host_view_aura.cc | 21 | ||||
-rw-r--r-- | content/browser/renderer_host/render_widget_host_view_aura.h | 4 |
2 files changed, 16 insertions, 9 deletions
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc index b115829..e0e3c52 100644 --- a/content/browser/renderer_host/render_widget_host_view_aura.cc +++ b/content/browser/renderer_host/render_widget_host_view_aura.cc @@ -564,8 +564,8 @@ void RenderWidgetHostViewAura::AcceleratedSurfaceBuffersSwapped( // If we are waiting for the resize, fast-track the ACK. InsertSyncPointAndACK(params_in_pixel.route_id, gpu_host_id); } else { - // Add sending an ACK to the list of things to do OnCompositingStarted - on_compositing_started_callbacks_.push_back( + // Add sending an ACK to the list of things to do OnCompositingWillStart + on_compositing_will_start_callbacks_.push_back( base::Bind(&RenderWidgetHostViewAura::InsertSyncPointAndACK, base::Unretained(this), params_in_pixel.route_id, @@ -605,8 +605,8 @@ void RenderWidgetHostViewAura::AcceleratedSurfacePostSubBuffer( // If we are waiting for the resize, fast-track the ACK. InsertSyncPointAndACK(params_in_pixel.route_id, gpu_host_id); } else { - // Add sending an ACK to the list of things to do OnCompositingStarted - on_compositing_started_callbacks_.push_back( + // Add sending an ACK to the list of things to do OnCompositingWillStart + on_compositing_will_start_callbacks_.push_back( base::Bind(&RenderWidgetHostViewAura::InsertSyncPointAndACK, base::Unretained(this), params_in_pixel.route_id, @@ -1213,10 +1213,15 @@ void RenderWidgetHostViewAura::OnLostActive() { //////////////////////////////////////////////////////////////////////////////// // RenderWidgetHostViewAura, ui::CompositorObserver implementation: + +void RenderWidgetHostViewAura::OnCompositingWillStart( + ui::Compositor* compositor) { + RunCompositingCallbacks(); +} + void RenderWidgetHostViewAura::OnCompositingStarted( ui::Compositor* compositor) { locks_pending_draw_.clear(); - RunCompositingCallbacks(); compositor->RemoveObserver(this); } @@ -1361,11 +1366,11 @@ bool RenderWidgetHostViewAura::ShouldMoveToCenter() { void RenderWidgetHostViewAura::RunCompositingCallbacks() { for (std::vector< base::Callback<void(void)> >::const_iterator - it = on_compositing_started_callbacks_.begin(); - it != on_compositing_started_callbacks_.end(); ++it) { + it = on_compositing_will_start_callbacks_.begin(); + it != on_compositing_will_start_callbacks_.end(); ++it) { it->Run(); } - on_compositing_started_callbacks_.clear(); + on_compositing_will_start_callbacks_.clear(); } void RenderWidgetHostViewAura::InsertSyncPointAndACK(int32 route_id, diff --git a/content/browser/renderer_host/render_widget_host_view_aura.h b/content/browser/renderer_host/render_widget_host_view_aura.h index e94cc0b..1af2487 100644 --- a/content/browser/renderer_host/render_widget_host_view_aura.h +++ b/content/browser/renderer_host/render_widget_host_view_aura.h @@ -195,6 +195,7 @@ class RenderWidgetHostViewAura friend class WindowObserver; // Overridden from ui::CompositorObserver: + virtual void OnCompositingWillStart(ui::Compositor* compositor) OVERRIDE; virtual void OnCompositingStarted(ui::Compositor* compositor) OVERRIDE; virtual void OnCompositingEnded(ui::Compositor* compositor) OVERRIDE; virtual void OnCompositingAborted(ui::Compositor* compositor) OVERRIDE; @@ -294,7 +295,8 @@ class RenderWidgetHostViewAura // Current tooltip text. string16 tooltip_; - std::vector< base::Callback<void(void)> > on_compositing_started_callbacks_; + std::vector< base::Callback<void(void)> > + on_compositing_will_start_callbacks_; std::map<uint64, scoped_refptr<ImageTransportClient> > image_transport_clients_; |