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

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

Issue 24466004: PPAPI: Make GLES2 calls resilient to bad/dead resources. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add AssertAcquiredDebugOnly Created 7 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « gpu/command_buffer/build_gles2_cmd_buffer.py ('k') | ppapi/proxy/ppb_graphics_3d_proxy.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "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"
11 #include "ppapi/shared_impl/proxy_lock.h"
11 12
12 namespace ppapi { 13 namespace ppapi {
13 namespace proxy { 14 namespace proxy {
14 15
15 PpapiCommandBufferProxy::PpapiCommandBufferProxy( 16 PpapiCommandBufferProxy::PpapiCommandBufferProxy(
16 const ppapi::HostResource& resource, 17 const ppapi::HostResource& resource,
17 ProxyChannel* channel) 18 ProxyChannel* channel)
18 : resource_(resource), 19 : resource_(resource),
19 channel_(channel) { 20 channel_(channel) {
20 } 21 }
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 if (Send(new PpapiHostMsg_PPBGraphics3D_GetState( 68 if (Send(new PpapiHostMsg_PPBGraphics3D_GetState(
68 ppapi::API_ID_PPB_GRAPHICS_3D, resource_, &state, &success))) { 69 ppapi::API_ID_PPB_GRAPHICS_3D, resource_, &state, &success))) {
69 UpdateState(state, success); 70 UpdateState(state, success);
70 } 71 }
71 } 72 }
72 73
73 return last_state_; 74 return last_state_;
74 } 75 }
75 76
76 gpu::CommandBuffer::State PpapiCommandBufferProxy::GetLastState() { 77 gpu::CommandBuffer::State PpapiCommandBufferProxy::GetLastState() {
77 // Note: The locking command buffer wrapper does not take a global lock before 78 ppapi::ProxyLock::AssertAcquiredDebugOnly();
dmichael (off chromium) 2013/09/26 22:26:38 I was able to confirm with From Dust that these ar
78 // calling this function.
79 return last_state_; 79 return last_state_;
80 } 80 }
81 81
82 int32 PpapiCommandBufferProxy::GetLastToken() { 82 int32 PpapiCommandBufferProxy::GetLastToken() {
83 // Note: The locking command buffer wrapper does not take a global lock before 83 ppapi::ProxyLock::AssertAcquiredDebugOnly();
84 // calling this function.
85 return last_state_.token; 84 return last_state_.token;
86 } 85 }
87 86
88 void PpapiCommandBufferProxy::Flush(int32 put_offset) { 87 void PpapiCommandBufferProxy::Flush(int32 put_offset) {
89 if (last_state_.error != gpu::error::kNoError) 88 if (last_state_.error != gpu::error::kNoError)
90 return; 89 return;
91 90
92 IPC::Message* message = new PpapiHostMsg_PPBGraphics3D_AsyncFlush( 91 IPC::Message* message = new PpapiHostMsg_PPBGraphics3D_AsyncFlush(
93 ppapi::API_ID_PPB_GRAPHICS_3D, resource_, put_offset); 92 ppapi::API_ID_PPB_GRAPHICS_3D, resource_, put_offset);
94 93
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 last_state_ = state; 249 last_state_ = state;
251 } 250 }
252 } else { 251 } else {
253 last_state_.error = gpu::error::kLostContext; 252 last_state_.error = gpu::error::kLostContext;
254 ++last_state_.generation; 253 ++last_state_.generation;
255 } 254 }
256 } 255 }
257 256
258 } // namespace proxy 257 } // namespace proxy
259 } // namespace ppapi 258 } // namespace ppapi
OLDNEW
« no previous file with comments | « gpu/command_buffer/build_gles2_cmd_buffer.py ('k') | ppapi/proxy/ppb_graphics_3d_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698