| 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 62b1d27e6375d47a86366c894f084b756cfb5b75..3dbf57247d50b9bdc051636cb38e5d847f663490 100644
|
| --- a/content/browser/renderer_host/render_widget_host_view_aura.cc
|
| +++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
|
| @@ -277,8 +277,8 @@ void RenderWidgetHostViewAura::OnAcceleratedCompositingStateChange() {
|
| }
|
|
|
| void RenderWidgetHostViewAura::AcceleratedSurfaceBuffersSwapped(
|
| - const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params,
|
| - int gpu_host_id) {
|
| + const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params,
|
| + int gpu_host_id) {
|
| #if defined(UI_COMPOSITOR_IMAGE_TRANSPORT)
|
| window_->layer()->SetExternalTexture(
|
| accelerated_surface_containers_[params.surface_id]->GetTexture());
|
| @@ -287,14 +287,44 @@ void RenderWidgetHostViewAura::AcceleratedSurfaceBuffersSwapped(
|
| if (!window_->layer()->GetCompositor()) {
|
| // We have no compositor, so we have no way to display the surface.
|
| // Must still send the ACK.
|
| - host_->AcknowledgeSwapBuffers(params.route_id, gpu_host_id);
|
| + RenderWidgetHost::AcknowledgeSwapBuffers(params.route_id, gpu_host_id);
|
| } else {
|
| window_->layer()->ScheduleDraw();
|
|
|
| // Add sending an ACK to the list of things to do OnCompositingEnded
|
| on_compositing_ended_callbacks_.push_back(
|
| base::Bind(&RenderWidgetHost::AcknowledgeSwapBuffers,
|
| - base::Unretained(host_), params.route_id, gpu_host_id));
|
| + params.route_id, gpu_host_id));
|
| + ui::Compositor* compositor = window_->layer()->GetCompositor();
|
| + if (!compositor->HasObserver(this))
|
| + compositor->AddObserver(this);
|
| + }
|
| +#else
|
| + NOTREACHED();
|
| +#endif
|
| +}
|
| +
|
| +void RenderWidgetHostViewAura::AcceleratedSurfacePostSubBuffer(
|
| + const GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params& params,
|
| + int gpu_host_id) {
|
| +#if defined(UI_COMPOSITOR_IMAGE_TRANSPORT)
|
| + window_->layer()->SetExternalTexture(
|
| + accelerated_surface_containers_[params.surface_id]->GetTexture());
|
| + glFlush();
|
| +
|
| + if (!window_->layer()->GetCompositor()) {
|
| + // We have no compositor, so we have no way to display the surface
|
| + // Must still send the ACK
|
| + RenderWidgetHost::AcknowledgePostSubBuffer(params.route_id, gpu_host_id);
|
| + } else {
|
| + // TODO(backer): Plumb the damage rect to the ui compositor so that we
|
| + // can do a partial swap to display.
|
| + window_->layer()->ScheduleDraw();
|
| +
|
| + // Add sending an ACK to the list of things to do OnCompositingEnded
|
| + on_compositing_ended_callbacks_.push_back(
|
| + base::Bind(&RenderWidgetHost::AcknowledgePostSubBuffer,
|
| + params.route_id, gpu_host_id));
|
| ui::Compositor* compositor = window_->layer()->GetCompositor();
|
| if (!compositor->HasObserver(this))
|
| compositor->AddObserver(this);
|
|
|