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

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

Issue 253943002: Remove CommandBuffer::GetState (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: I forgot Poland^Wmojo Created 6 years, 7 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 | « ppapi/proxy/ppapi_command_buffer_proxy.h ('k') | ppapi/proxy/ppapi_messages.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"
(...skipping 11 matching lines...) Expand all
22 22
23 PpapiCommandBufferProxy::~PpapiCommandBufferProxy() { 23 PpapiCommandBufferProxy::~PpapiCommandBufferProxy() {
24 // gpu::Buffers are no longer referenced, allowing shared memory objects to be 24 // gpu::Buffers are no longer referenced, allowing shared memory objects to be
25 // deleted, closing the handle in this process. 25 // deleted, closing the handle in this process.
26 } 26 }
27 27
28 bool PpapiCommandBufferProxy::Initialize() { 28 bool PpapiCommandBufferProxy::Initialize() {
29 return true; 29 return true;
30 } 30 }
31 31
32 gpu::CommandBuffer::State PpapiCommandBufferProxy::GetState() {
33 // Send will flag state with lost context if IPC fails.
34 if (last_state_.error == gpu::error::kNoError) {
35 gpu::CommandBuffer::State state;
36 bool success = false;
37 if (Send(new PpapiHostMsg_PPBGraphics3D_GetState(
38 ppapi::API_ID_PPB_GRAPHICS_3D, resource_, &state, &success))) {
39 UpdateState(state, success);
40 }
41 }
42
43 return last_state_;
44 }
45
46 gpu::CommandBuffer::State PpapiCommandBufferProxy::GetLastState() { 32 gpu::CommandBuffer::State PpapiCommandBufferProxy::GetLastState() {
47 ppapi::ProxyLock::AssertAcquiredDebugOnly(); 33 ppapi::ProxyLock::AssertAcquiredDebugOnly();
48 return last_state_; 34 return last_state_;
49 } 35 }
50 36
51 int32 PpapiCommandBufferProxy::GetLastToken() { 37 int32 PpapiCommandBufferProxy::GetLastToken() {
52 ppapi::ProxyLock::AssertAcquiredDebugOnly(); 38 ppapi::ProxyLock::AssertAcquiredDebugOnly();
53 return last_state_.token; 39 return last_state_.token;
54 } 40 }
55 41
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 last_state_ = state; 210 last_state_ = state;
225 } 211 }
226 } else { 212 } else {
227 last_state_.error = gpu::error::kLostContext; 213 last_state_.error = gpu::error::kLostContext;
228 ++last_state_.generation; 214 ++last_state_.generation;
229 } 215 }
230 } 216 }
231 217
232 } // namespace proxy 218 } // namespace proxy
233 } // namespace ppapi 219 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/proxy/ppapi_command_buffer_proxy.h ('k') | ppapi/proxy/ppapi_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698