| 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 "base/numerics/safe_conversions.h" | 7 #include "base/numerics/safe_conversions.h" |
| 8 #include "ppapi/proxy/ppapi_messages.h" | 8 #include "ppapi/proxy/ppapi_messages.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" |
| 11 #include "ppapi/shared_impl/proxy_lock.h" | 11 #include "ppapi/shared_impl/proxy_lock.h" |
| 12 | 12 |
| 13 namespace ppapi { | 13 namespace ppapi { |
| 14 namespace proxy { | 14 namespace proxy { |
| 15 | 15 |
| 16 // TODO(dyen): to support fences on Ppapi, we need to plumb the command buffer |
| 17 // id that the ppapi command buffer forwards to. |
| 16 PpapiCommandBufferProxy::PpapiCommandBufferProxy( | 18 PpapiCommandBufferProxy::PpapiCommandBufferProxy( |
| 17 const ppapi::HostResource& resource, | 19 const ppapi::HostResource& resource, |
| 18 PluginDispatcher* dispatcher, | 20 PluginDispatcher* dispatcher, |
| 19 const gpu::Capabilities& capabilities, | 21 const gpu::Capabilities& capabilities, |
| 20 const SerializedHandle& shared_state) | 22 const SerializedHandle& shared_state) |
| 21 : capabilities_(capabilities), | 23 : CommandBuffer(gpu::kCommandBufferNamespace_Invalid, 0), |
| 24 capabilities_(capabilities), |
| 22 resource_(resource), | 25 resource_(resource), |
| 23 dispatcher_(dispatcher) { | 26 dispatcher_(dispatcher) { |
| 24 shared_state_shm_.reset( | 27 shared_state_shm_.reset( |
| 25 new base::SharedMemory(shared_state.shmem(), false)); | 28 new base::SharedMemory(shared_state.shmem(), false)); |
| 26 shared_state_shm_->Map(shared_state.size()); | 29 shared_state_shm_->Map(shared_state.size()); |
| 27 InstanceData* data = dispatcher->GetInstanceData(resource.instance()); | 30 InstanceData* data = dispatcher->GetInstanceData(resource.instance()); |
| 28 flush_info_ = &data->flush_info_; | 31 flush_info_ = &data->flush_info_; |
| 29 } | 32 } |
| 30 | 33 |
| 31 PpapiCommandBufferProxy::~PpapiCommandBufferProxy() { | 34 PpapiCommandBufferProxy::~PpapiCommandBufferProxy() { |
| (...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 // cached last_state_ with out-of-date data. | 297 // cached last_state_ with out-of-date data. |
| 295 message->set_unblock(true); | 298 message->set_unblock(true); |
| 296 Send(message); | 299 Send(message); |
| 297 | 300 |
| 298 flush_info_->flush_pending = false; | 301 flush_info_->flush_pending = false; |
| 299 flush_info_->resource.SetHostResource(0, 0); | 302 flush_info_->resource.SetHostResource(0, 0); |
| 300 } | 303 } |
| 301 | 304 |
| 302 } // namespace proxy | 305 } // namespace proxy |
| 303 } // namespace ppapi | 306 } // namespace ppapi |
| OLD | NEW |