Index: content/browser/renderer_host/render_widget_host_view_aura.cc |
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 d7dfadc0936a2d011ff6376aca800e200942189b..b5c696c9b38410fbadf4d50cdf99a2fc51732257 100644 |
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc |
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc |
@@ -947,6 +947,40 @@ void RenderWidgetHostViewAura::AcceleratedSurfaceRelease( |
image_transport_clients_.erase(surface_handle); |
} |
+void RenderWidgetHostViewAura::SwapCompositorFrame( |
+ const cc::CompositorFrame& frame) { |
+ ui::Compositor* compositor = GetCompositor(); |
+ if (!compositor) { |
+ SwapCompositorFrameAck(frame.resources, NULL); |
+ } else { |
+ released_front_lock_ = NULL; |
+ gfx::Size surface_size = ConvertSizeToDIP(this, frame.size); |
+ |
+ window_->SchedulePaintInRect(gfx::Rect(surface_size)); |
+ resize_locks_.clear(); // XXX |
+ window_->layer()->SetCompositorFrame(frame); |
+ |
+ on_compositing_did_commit_callbacks_.push_back( |
+ base::Bind(&RenderWidgetHostViewAura::SendSwapCompositorFrameAck, |
+ base::Unretained(this))); |
+ if (!compositor->HasObserver(this)) |
+ compositor->AddObserver(this); |
+ } |
+} |
+ |
+void RenderWidgetHostViewAura::SendSwapCompositorFrameAck(ui::Compositor*) { |
+ cc::TransferableResourceList resources; |
+ resources.sync_point = 0; |
+ window_->layer()->GetRecycledResources(&resources); |
+ SwapCompositorFrameAck(resources, NULL); |
+} |
+ |
+void RenderWidgetHostViewAura::SwapCompositorFrameAck(const cc::TransferableResourceList& resources, ui::Compositor*) { |
+ cc::CompositorFrameAck ack; |
+ ack.resources = resources; |
+ host_->SwapCompositorFrameAck(ack); |
+} |
+ |
void RenderWidgetHostViewAura::SetSurfaceNotInUseByCompositor(ui::Compositor*) { |
if (current_surface_ || !host_->is_hidden()) |
return; |