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

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: 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
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"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 if (Send(new PpapiHostMsg_PPBGraphics3D_GetState( 67 if (Send(new PpapiHostMsg_PPBGraphics3D_GetState(
68 ppapi::API_ID_PPB_GRAPHICS_3D, resource_, &state, &success))) { 68 ppapi::API_ID_PPB_GRAPHICS_3D, resource_, &state, &success))) {
69 UpdateState(state, success); 69 UpdateState(state, success);
70 } 70 }
71 } 71 }
72 72
73 return last_state_; 73 return last_state_;
74 } 74 }
75 75
76 gpu::CommandBuffer::State PpapiCommandBufferProxy::GetLastState() { 76 gpu::CommandBuffer::State PpapiCommandBufferProxy::GetLastState() {
77 // Note: The locking command buffer wrapper does not take a global lock before
78 // calling this function.
dmichael (off chromium) 2013/09/25 20:05:13 I can't find where the GetLastState actually gets
79 return last_state_; 77 return last_state_;
80 } 78 }
81 79
82 int32 PpapiCommandBufferProxy::GetLastToken() { 80 int32 PpapiCommandBufferProxy::GetLastToken() {
83 // Note: The locking command buffer wrapper does not take a global lock before
84 // calling this function.
85 return last_state_.token; 81 return last_state_.token;
86 } 82 }
87 83
88 void PpapiCommandBufferProxy::Flush(int32 put_offset) { 84 void PpapiCommandBufferProxy::Flush(int32 put_offset) {
89 if (last_state_.error != gpu::error::kNoError) 85 if (last_state_.error != gpu::error::kNoError)
90 return; 86 return;
91 87
92 IPC::Message* message = new PpapiHostMsg_PPBGraphics3D_AsyncFlush( 88 IPC::Message* message = new PpapiHostMsg_PPBGraphics3D_AsyncFlush(
93 ppapi::API_ID_PPB_GRAPHICS_3D, resource_, put_offset); 89 ppapi::API_ID_PPB_GRAPHICS_3D, resource_, put_offset);
94 90
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 last_state_ = state; 246 last_state_ = state;
251 } 247 }
252 } else { 248 } else {
253 last_state_.error = gpu::error::kLostContext; 249 last_state_.error = gpu::error::kLostContext;
254 ++last_state_.generation; 250 ++last_state_.generation;
255 } 251 }
256 } 252 }
257 253
258 } // namespace proxy 254 } // namespace proxy
259 } // namespace ppapi 255 } // namespace ppapi
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698