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 "ppapi/proxy/ppapi_command_buffer_proxy.h" | 5 #include "ppapi/proxy/ppapi_command_buffer_proxy.h" |
6 | 6 |
7 #include "ppapi/proxy/ppapi_messages.h" | 7 #include "ppapi/proxy/ppapi_messages.h" |
8 #include "ppapi/proxy/proxy_channel.h" | 8 #include "ppapi/proxy/proxy_channel.h" |
9 #include "ppapi/shared_impl/api_id.h" | 9 #include "ppapi/shared_impl/api_id.h" |
10 #include "ppapi/shared_impl/host_resource.h" | 10 #include "ppapi/shared_impl/host_resource.h" |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 } | 261 } |
262 | 262 |
263 void PpapiCommandBufferProxy::UpdateState( | 263 void PpapiCommandBufferProxy::UpdateState( |
264 const gpu::CommandBuffer::State& state, | 264 const gpu::CommandBuffer::State& state, |
265 bool success) { | 265 bool success) { |
266 // Handle wraparound. It works as long as we don't have more than 2B state | 266 // Handle wraparound. It works as long as we don't have more than 2B state |
267 // updates in flight across which reordering occurs. | 267 // updates in flight across which reordering occurs. |
268 if (success) { | 268 if (success) { |
269 if (state.generation - last_state_.generation < 0x80000000U) { | 269 if (state.generation - last_state_.generation < 0x80000000U) { |
270 last_state_ = state; | 270 last_state_ = state; |
271 } else | 271 } |
| 272 } else { |
272 last_state_.error = gpu::error::kLostContext; | 273 last_state_.error = gpu::error::kLostContext; |
273 ++last_state_.generation; | 274 ++last_state_.generation; |
274 } | 275 } |
275 } | 276 } |
276 | 277 |
277 } // namespace proxy | 278 } // namespace proxy |
278 } // namespace ppapi | 279 } // namespace ppapi |
279 | 280 |
OLD | NEW |