Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/common/gpu/client/command_buffer_proxy_impl.h" | 5 #include "content/common/gpu/client/command_buffer_proxy_impl.h" |
| 6 | 6 |
| 7 #include "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/process_util.h" | 10 #include "base/process_util.h" |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 195 if (last_put_offset_ == put_offset) | 195 if (last_put_offset_ == put_offset) |
| 196 return; | 196 return; |
| 197 | 197 |
| 198 last_put_offset_ = put_offset; | 198 last_put_offset_ = put_offset; |
| 199 | 199 |
| 200 Send(new GpuCommandBufferMsg_AsyncFlush(route_id_, | 200 Send(new GpuCommandBufferMsg_AsyncFlush(route_id_, |
| 201 put_offset, | 201 put_offset, |
| 202 ++flush_count_)); | 202 ++flush_count_)); |
| 203 } | 203 } |
| 204 | 204 |
| 205 void CommandBufferProxyImpl::SetLatencyInfo( | |
| 206 const cc::LatencyInfo& latency_info) { | |
|
piman
2013/04/03 18:05:09
You need to check for last_state_.error != gpu::er
| |
| 207 Send(new GpuCommandBufferMsg_SetLatencyInfo(route_id_, latency_info)); | |
| 208 } | |
| 209 | |
| 205 gpu::CommandBuffer::State CommandBufferProxyImpl::FlushSync( | 210 gpu::CommandBuffer::State CommandBufferProxyImpl::FlushSync( |
| 206 int32 put_offset, | 211 int32 put_offset, |
| 207 int32 last_known_get) { | 212 int32 last_known_get) { |
| 208 TRACE_EVENT1("gpu", "CommandBufferProxyImpl::FlushSync", "put_offset", | 213 TRACE_EVENT1("gpu", "CommandBufferProxyImpl::FlushSync", "put_offset", |
| 209 put_offset); | 214 put_offset); |
| 210 Flush(put_offset); | 215 Flush(put_offset); |
| 211 TryUpdateState(); | 216 TryUpdateState(); |
| 212 if (last_known_get == last_state_.get_offset) { | 217 if (last_known_get == last_state_.get_offset) { |
| 213 // Send will flag state with lost context if IPC fails. | 218 // Send will flag state with lost context if IPC fails. |
| 214 if (last_state_.error == gpu::error::kNoError) { | 219 if (last_state_.error == gpu::error::kNoError) { |
| (...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 525 void CommandBufferProxyImpl::SendManagedMemoryStats( | 530 void CommandBufferProxyImpl::SendManagedMemoryStats( |
| 526 const GpuManagedMemoryStats& stats) { | 531 const GpuManagedMemoryStats& stats) { |
| 527 if (last_state_.error != gpu::error::kNoError) | 532 if (last_state_.error != gpu::error::kNoError) |
| 528 return; | 533 return; |
| 529 | 534 |
| 530 Send(new GpuCommandBufferMsg_SendClientManagedMemoryStats(route_id_, | 535 Send(new GpuCommandBufferMsg_SendClientManagedMemoryStats(route_id_, |
| 531 stats)); | 536 stats)); |
| 532 } | 537 } |
| 533 | 538 |
| 534 } // namespace content | 539 } // namespace content |
| OLD | NEW |