| 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 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 unsigned internalformat, | 243 unsigned internalformat, |
| 244 int32* id) { | 244 int32* id) { |
| 245 NOTREACHED(); | 245 NOTREACHED(); |
| 246 return NULL; | 246 return NULL; |
| 247 } | 247 } |
| 248 | 248 |
| 249 void PpapiCommandBufferProxy::DestroyGpuMemoryBuffer(int32 id) { | 249 void PpapiCommandBufferProxy::DestroyGpuMemoryBuffer(int32 id) { |
| 250 NOTREACHED(); | 250 NOTREACHED(); |
| 251 } | 251 } |
| 252 | 252 |
| 253 bool PpapiCommandBufferProxy::GenerateMailboxNames( | |
| 254 unsigned num, std::vector<gpu::Mailbox>* names) { | |
| 255 // TODO(piman): implement this so we can expose mailboxes to pepper | |
| 256 // eventually. | |
| 257 NOTREACHED(); | |
| 258 return false; | |
| 259 } | |
| 260 | |
| 261 | |
| 262 bool PpapiCommandBufferProxy::Send(IPC::Message* msg) { | 253 bool PpapiCommandBufferProxy::Send(IPC::Message* msg) { |
| 263 DCHECK(last_state_.error == gpu::error::kNoError); | 254 DCHECK(last_state_.error == gpu::error::kNoError); |
| 264 | 255 |
| 265 if (channel_->Send(msg)) | 256 if (channel_->Send(msg)) |
| 266 return true; | 257 return true; |
| 267 | 258 |
| 268 last_state_.error = gpu::error::kLostContext; | 259 last_state_.error = gpu::error::kLostContext; |
| 269 return false; | 260 return false; |
| 270 } | 261 } |
| 271 | 262 |
| 272 void PpapiCommandBufferProxy::UpdateState( | 263 void PpapiCommandBufferProxy::UpdateState( |
| 273 const gpu::CommandBuffer::State& state, | 264 const gpu::CommandBuffer::State& state, |
| 274 bool success) { | 265 bool success) { |
| 275 // 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 |
| 276 // updates in flight across which reordering occurs. | 267 // updates in flight across which reordering occurs. |
| 277 if (success) { | 268 if (success) { |
| 278 if (state.generation - last_state_.generation < 0x80000000U) { | 269 if (state.generation - last_state_.generation < 0x80000000U) { |
| 279 last_state_ = state; | 270 last_state_ = state; |
| 280 } | 271 } |
| 281 } else { | 272 } else { |
| 282 last_state_.error = gpu::error::kLostContext; | 273 last_state_.error = gpu::error::kLostContext; |
| 283 ++last_state_.generation; | 274 ++last_state_.generation; |
| 284 } | 275 } |
| 285 } | 276 } |
| 286 | 277 |
| 287 } // namespace proxy | 278 } // namespace proxy |
| 288 } // namespace ppapi | 279 } // namespace ppapi |
| OLD | NEW |