Chromium Code Reviews| Index: content/common/gpu/image_transport_surface.cc |
| diff --git a/content/common/gpu/image_transport_surface.cc b/content/common/gpu/image_transport_surface.cc |
| index 91ab8dd71273c1b6a0a90d6152f10d2a41634784..f988c081d41c7783f766ad76bf44934336e634d8 100644 |
| --- a/content/common/gpu/image_transport_surface.cc |
| +++ b/content/common/gpu/image_transport_surface.cc |
| @@ -216,13 +216,9 @@ void ImageTransportHelper::SetLatencyInfo( |
| PassThroughImageTransportSurface::PassThroughImageTransportSurface( |
| GpuChannelManager* manager, |
| GpuCommandBufferStub* stub, |
| - gfx::GLSurface* surface, |
| - bool transport) |
| + gfx::GLSurface* surface) |
| : GLSurfaceAdapter(surface), |
| - transport_(transport), |
| - did_set_swap_interval_(false), |
| - did_unschedule_(false), |
| - is_swap_buffers_pending_(false) { |
| + did_set_swap_interval_(false) { |
| helper_.reset(new ImageTransportHelper(this, |
| manager, |
| stub, |
| @@ -239,16 +235,6 @@ void PassThroughImageTransportSurface::Destroy() { |
| GLSurfaceAdapter::Destroy(); |
| } |
| -bool PassThroughImageTransportSurface::DeferDraws() { |
| - if (is_swap_buffers_pending_) { |
| - DCHECK(!did_unschedule_); |
| - did_unschedule_ = true; |
| - helper_->SetScheduled(false); |
| - return true; |
| - } |
| - return false; |
| -} |
| - |
| void PassThroughImageTransportSurface::SetLatencyInfo( |
| const std::vector<ui::LatencyInfo>& latency_info) { |
| for (size_t i = 0; i < latency_info.size(); i++) |
| @@ -265,20 +251,7 @@ bool PassThroughImageTransportSurface::SwapBuffers() { |
| ui::INPUT_EVENT_LATENCY_TERMINATED_FRAME_SWAP_COMPONENT, 0, 0); |
| } |
| - if (transport_) { |
| - DCHECK(!is_swap_buffers_pending_); |
| - is_swap_buffers_pending_ = true; |
| - |
| - // Round trip to the browser UI thread, for throttling, by sending a dummy |
| - // SwapBuffers message. |
| - GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params params; |
| - params.surface_handle = 0; |
| - params.latency_info.swap(latency_info_); |
| - params.size = surface()->GetSize(); |
| - helper_->SendAcceleratedSurfaceBuffersSwapped(params); |
| - } else { |
| - helper_->SendLatencyInfo(latency_info_); |
| - } |
| + helper_->SendLatencyInfo(latency_info_); |
| latency_info_.clear(); |
| return result; |
| } |
| @@ -292,26 +265,7 @@ bool PassThroughImageTransportSurface::PostSubBuffer( |
| ui::INPUT_EVENT_LATENCY_TERMINATED_FRAME_SWAP_COMPONENT, 0, 0); |
| } |
| - if (transport_) { |
| - DCHECK(!is_swap_buffers_pending_); |
| - is_swap_buffers_pending_ = true; |
| - |
| - // Round trip to the browser UI thread, for throttling, by sending a dummy |
| - // PostSubBuffer message. |
| - GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params params; |
| - params.surface_handle = 0; |
| - params.latency_info.swap(latency_info_); |
| - params.surface_size = surface()->GetSize(); |
| - params.x = x; |
| - params.y = y; |
| - params.width = width; |
| - params.height = height; |
| - helper_->SendAcceleratedSurfacePostSubBuffer(params); |
| - |
| - helper_->SetScheduled(false); |
| - } else { |
| - helper_->SendLatencyInfo(latency_info_); |
| - } |
| + helper_->SendLatencyInfo(latency_info_); |
| latency_info_.clear(); |
| return result; |
| } |
| @@ -326,35 +280,16 @@ bool PassThroughImageTransportSurface::OnMakeCurrent(gfx::GLContext* context) { |
| void PassThroughImageTransportSurface::OnBufferPresented( |
| const AcceleratedSurfaceMsg_BufferPresented_Params& /* params */) { |
| - DCHECK(transport_); |
| - DCHECK(is_swap_buffers_pending_); |
| - is_swap_buffers_pending_ = false; |
| - if (did_unschedule_) { |
| - did_unschedule_ = false; |
| - helper_->SetScheduled(true); |
| - } |
| + NOTREACHED(); |
| } |
| void PassThroughImageTransportSurface::OnResizeViewACK() { |
| - DCHECK(transport_); |
| - Resize(new_size_); |
| - |
| - TRACE_EVENT_ASYNC_END0("gpu", "OnResize", this); |
| - helper_->SetScheduled(true); |
| + NOTREACHED(); |
| } |
| void PassThroughImageTransportSurface::OnResize(gfx::Size size, |
| float scale_factor) { |
| - new_size_ = size; |
| - |
| - if (transport_) { |
| - helper_->SendResizeView(size); |
|
no sievers
2014/04/25 17:51:00
ImageTransportHelper::SendResizeView(), GpuHostMsg
|
| - helper_->SetScheduled(false); |
| - TRACE_EVENT_ASYNC_BEGIN2("gpu", "OnResize", this, |
| - "width", size.width(), "height", size.height()); |
| - } else { |
| - Resize(new_size_); |
| - } |
| + Resize(size); |
| } |
| gfx::Size PassThroughImageTransportSurface::GetSize() { |