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

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

Issue 782583003: List sync points to wait on in AsyncFlush message Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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
« 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 28 matching lines...) Expand all
39 ppapi::ProxyLock::AssertAcquiredDebugOnly(); 39 ppapi::ProxyLock::AssertAcquiredDebugOnly();
40 return last_state_; 40 return last_state_;
41 } 41 }
42 42
43 int32 PpapiCommandBufferProxy::GetLastToken() { 43 int32 PpapiCommandBufferProxy::GetLastToken() {
44 ppapi::ProxyLock::AssertAcquiredDebugOnly(); 44 ppapi::ProxyLock::AssertAcquiredDebugOnly();
45 TryUpdateState(); 45 TryUpdateState();
46 return last_state_.token; 46 return last_state_.token;
47 } 47 }
48 48
49 void PpapiCommandBufferProxy::Flush(int32 put_offset) { 49 void PpapiCommandBufferProxy::Flush(int32 put_offset,
50 const std::vector<uint32>& sync_points) {
50 if (last_state_.error != gpu::error::kNoError) 51 if (last_state_.error != gpu::error::kNoError)
51 return; 52 return;
52 53
53 IPC::Message* message = new PpapiHostMsg_PPBGraphics3D_AsyncFlush( 54 IPC::Message* message = new PpapiHostMsg_PPBGraphics3D_AsyncFlush(
54 ppapi::API_ID_PPB_GRAPHICS_3D, resource_, put_offset); 55 ppapi::API_ID_PPB_GRAPHICS_3D, resource_, put_offset, sync_points);
55 56
56 // Do not let a synchronous flush hold up this message. If this handler is 57 // Do not let a synchronous flush hold up this message. If this handler is
57 // deferred until after the synchronous flush completes, it will overwrite the 58 // deferred until after the synchronous flush completes, it will overwrite the
58 // cached last_state_ with out-of-date data. 59 // cached last_state_ with out-of-date data.
59 message->set_unblock(true); 60 message->set_unblock(true);
60 Send(message); 61 Send(message);
61 } 62 }
62 63
63 void PpapiCommandBufferProxy::WaitForTokenInRange(int32 start, int32 end) { 64 void PpapiCommandBufferProxy::WaitForTokenInRange(int32 start, int32 end) {
64 TryUpdateState(); 65 TryUpdateState();
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 shared_state()->Read(&last_state_); 250 shared_state()->Read(&last_state_);
250 } 251 }
251 252
252 gpu::CommandBufferSharedState* PpapiCommandBufferProxy::shared_state() const { 253 gpu::CommandBufferSharedState* PpapiCommandBufferProxy::shared_state() const {
253 return reinterpret_cast<gpu::CommandBufferSharedState*>( 254 return reinterpret_cast<gpu::CommandBufferSharedState*>(
254 shared_state_shm_->memory()); 255 shared_state_shm_->memory());
255 } 256 }
256 257
257 } // namespace proxy 258 } // namespace proxy
258 } // namespace ppapi 259 } // 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