| Index: content/browser/renderer_host/render_widget_host_view_aura.cc
|
| ===================================================================
|
| --- content/browser/renderer_host/render_widget_host_view_aura.cc (revision 111041)
|
| +++ content/browser/renderer_host/render_widget_host_view_aura.cc (working copy)
|
| @@ -275,51 +275,48 @@
|
| void RenderWidgetHostViewAura::OnAcceleratedCompositingStateChange() {
|
| }
|
|
|
| +#if defined(UI_COMPOSITOR_IMAGE_TRANSPORT)
|
| +void RenderWidgetHostViewAura::AcceleratedSurfaceNew(
|
| + int32 width,
|
| + int32 height,
|
| + uint64* surface_id,
|
| + TransportDIB::Handle* surface_handle) {
|
| + scoped_refptr<AcceleratedSurfaceContainerLinux> surface(
|
| + AcceleratedSurfaceContainerLinux::Create(gfx::Size(width, height)));
|
| + if (!surface->Initialize(surface_id)) {
|
| + LOG(ERROR) << "Failed to create AcceleratedSurfaceContainer";
|
| + return;
|
| + }
|
| + *surface_handle = surface->Handle();
|
| +
|
| + accelerated_surface_containers_[*surface_id] = surface;
|
| +}
|
| +
|
| void RenderWidgetHostViewAura::AcceleratedSurfaceBuffersSwapped(
|
| - const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params,
|
| + uint64 surface_id,
|
| + int32 route_id,
|
| int gpu_host_id) {
|
| -#if defined(UI_COMPOSITOR_IMAGE_TRANSPORT)
|
| window_->layer()->SetExternalTexture(
|
| - accelerated_surface_containers_[params.surface_id]->GetTexture());
|
| + accelerated_surface_containers_[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.
|
| - host_->AcknowledgeSwapBuffers(params.route_id, gpu_host_id);
|
| + host_->AcknowledgeSwapBuffers(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));
|
| + base::Unretained(host_), route_id, gpu_host_id));
|
| ui::Compositor* compositor = window_->layer()->GetCompositor();
|
| if (!compositor->HasObserver(this))
|
| compositor->AddObserver(this);
|
| }
|
| -#else
|
| - NOTREACHED();
|
| -#endif
|
| }
|
|
|
| -#if defined(UI_COMPOSITOR_IMAGE_TRANSPORT)
|
| -void RenderWidgetHostViewAura::AcceleratedSurfaceNew(
|
| - int32 width,
|
| - int32 height,
|
| - uint64* surface_id,
|
| - TransportDIB::Handle* surface_handle) {
|
| - scoped_refptr<AcceleratedSurfaceContainerLinux> surface(
|
| - AcceleratedSurfaceContainerLinux::Create(gfx::Size(width, height)));
|
| - if (!surface->Initialize(surface_id)) {
|
| - LOG(ERROR) << "Failed to create AcceleratedSurfaceContainer";
|
| - return;
|
| - }
|
| - *surface_handle = surface->Handle();
|
| -
|
| - accelerated_surface_containers_[*surface_id] = surface;
|
| -}
|
| -
|
| void RenderWidgetHostViewAura::AcceleratedSurfaceRelease(uint64 surface_id) {
|
| accelerated_surface_containers_.erase(surface_id);
|
| }
|
|
|