Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(49)

Side by Side Diff: ppapi/proxy/ppapi_command_buffer_proxy.cc

Issue 1345813002: Added a unique command buffer ID for command buffers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed tests Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 PpapiCommandBufferProxy::PpapiCommandBufferProxy( 16 PpapiCommandBufferProxy::PpapiCommandBufferProxy(
17 const ppapi::HostResource& resource, 17 const ppapi::HostResource& resource,
18 PluginDispatcher* dispatcher, 18 PluginDispatcher* dispatcher,
19 const gpu::Capabilities& capabilities, 19 const gpu::Capabilities& capabilities,
20 const SerializedHandle& shared_state) 20 const SerializedHandle& shared_state,
21 : capabilities_(capabilities), 21 gpu::CommandBufferNamespace namespace_id,
22 uint64_t command_buffer_id)
23 : namespace_id_(namespace_id),
24 command_buffer_id_(command_buffer_id),
25 capabilities_(capabilities),
22 resource_(resource), 26 resource_(resource),
23 dispatcher_(dispatcher) { 27 dispatcher_(dispatcher) {
24 shared_state_shm_.reset( 28 shared_state_shm_.reset(
25 new base::SharedMemory(shared_state.shmem(), false)); 29 new base::SharedMemory(shared_state.shmem(), false));
26 shared_state_shm_->Map(shared_state.size()); 30 shared_state_shm_->Map(shared_state.size());
27 InstanceData* data = dispatcher->GetInstanceData(resource.instance()); 31 InstanceData* data = dispatcher->GetInstanceData(resource.instance());
28 flush_info_ = &data->flush_info_; 32 flush_info_ = &data->flush_info_;
29 } 33 }
30 34
31 PpapiCommandBufferProxy::~PpapiCommandBufferProxy() { 35 PpapiCommandBufferProxy::~PpapiCommandBufferProxy() {
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 174
171 void PpapiCommandBufferProxy::SetLock(base::Lock*) { 175 void PpapiCommandBufferProxy::SetLock(base::Lock*) {
172 NOTIMPLEMENTED(); 176 NOTIMPLEMENTED();
173 } 177 }
174 178
175 bool PpapiCommandBufferProxy::IsGpuChannelLost() { 179 bool PpapiCommandBufferProxy::IsGpuChannelLost() {
176 NOTIMPLEMENTED(); 180 NOTIMPLEMENTED();
177 return false; 181 return false;
178 } 182 }
179 183
184 gpu::CommandBufferNamespace PpapiCommandBufferProxy::GetNamespaceID() const {
185 return namespace_id_;
186 }
187
188 uint64_t PpapiCommandBufferProxy::GetCommandBufferID() const {
189 return command_buffer_id_;
190 }
191
180 uint32 PpapiCommandBufferProxy::InsertSyncPoint() { 192 uint32 PpapiCommandBufferProxy::InsertSyncPoint() {
181 uint32 sync_point = 0; 193 uint32 sync_point = 0;
182 if (last_state_.error == gpu::error::kNoError) { 194 if (last_state_.error == gpu::error::kNoError) {
183 Send(new PpapiHostMsg_PPBGraphics3D_InsertSyncPoint( 195 Send(new PpapiHostMsg_PPBGraphics3D_InsertSyncPoint(
184 ppapi::API_ID_PPB_GRAPHICS_3D, resource_, &sync_point)); 196 ppapi::API_ID_PPB_GRAPHICS_3D, resource_, &sync_point));
185 } 197 }
186 return sync_point; 198 return sync_point;
187 } 199 }
188 200
189 uint32 PpapiCommandBufferProxy::InsertFutureSyncPoint() { 201 uint32 PpapiCommandBufferProxy::InsertFutureSyncPoint() {
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 // cached last_state_ with out-of-date data. 306 // cached last_state_ with out-of-date data.
295 message->set_unblock(true); 307 message->set_unblock(true);
296 Send(message); 308 Send(message);
297 309
298 flush_info_->flush_pending = false; 310 flush_info_->flush_pending = false;
299 flush_info_->resource.SetHostResource(0, 0); 311 flush_info_->resource.SetHostResource(0, 0);
300 } 312 }
301 313
302 } // namespace proxy 314 } // namespace proxy
303 } // namespace ppapi 315 } // namespace ppapi
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698