Chromium Code Reviews| Index: content/common/gpu/client/command_buffer_proxy_impl.cc |
| diff --git a/content/common/gpu/client/command_buffer_proxy_impl.cc b/content/common/gpu/client/command_buffer_proxy_impl.cc |
| index ec473f3295f74957a3d246df20e1deb84d09908e..5070c1bd7f7b36be15d7082fd17f302302902715 100644 |
| --- a/content/common/gpu/client/command_buffer_proxy_impl.cc |
| +++ b/content/common/gpu/client/command_buffer_proxy_impl.cc |
| @@ -25,13 +25,13 @@ |
| namespace content { |
| -CommandBufferProxyImpl::CommandBufferProxyImpl( |
| - GpuChannelHost* channel, |
| - int route_id) |
| +CommandBufferProxyImpl::CommandBufferProxyImpl(GpuChannelHost* channel, |
| + int route_id) |
| : channel_(channel), |
| route_id_(route_id), |
| flush_count_(0), |
| last_put_offset_(-1), |
| + last_barrier_put_offset_(-1), |
| next_signal_id_(0) { |
| } |
| @@ -179,16 +179,34 @@ void CommandBufferProxyImpl::Flush(int32 put_offset) { |
| "put_offset", |
| put_offset); |
| - if (last_put_offset_ == put_offset) |
| + bool put_offset_changed = last_put_offset_ != put_offset; |
| + last_put_offset_ = put_offset; |
| + last_barrier_put_offset_ = put_offset; |
| + |
| + if (channel_) |
|
piman
2015/02/06 03:37:48
nit: style requires brackets because body is >1 li
vmiura
2015/02/06 05:15:22
Done.
|
| + channel_->OrderingBarrier(route_id_, put_offset, ++flush_count_, |
| + latency_info_, put_offset_changed, true); |
| + |
| + if (put_offset_changed) |
| + latency_info_.clear(); |
| +} |
| + |
| +void CommandBufferProxyImpl::OrderingBarrier(int32 put_offset) { |
| + if (last_state_.error != gpu::error::kNoError) |
| return; |
| - last_put_offset_ = put_offset; |
| + TRACE_EVENT1("gpu", "CommandBufferProxyImpl::OrderingBarrier", "put_offset", |
| + put_offset); |
| + |
| + bool put_offset_changed = last_barrier_put_offset_ != put_offset; |
| + last_barrier_put_offset_ = put_offset; |
| + |
| + if (channel_) |
|
piman
2015/02/06 03:37:48
nit: brackets here too.
vmiura
2015/02/06 05:15:22
Done.
|
| + channel_->OrderingBarrier(route_id_, put_offset, ++flush_count_, |
| + latency_info_, put_offset_changed, false); |
| - Send(new GpuCommandBufferMsg_AsyncFlush(route_id_, |
| - put_offset, |
| - ++flush_count_, |
| - latency_info_)); |
| - latency_info_.clear(); |
| + if (put_offset_changed) |
| + latency_info_.clear(); |
| } |
| void CommandBufferProxyImpl::SetLatencyInfo( |