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

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

Issue 896723008: Add OrderingBarrierCHROMIUM API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed nits. Created 5 years, 10 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
« no previous file with comments | « ppapi/proxy/ppapi_command_buffer_proxy.h ('k') | no next file » | 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 IPC::Message* message = new PpapiHostMsg_PPBGraphics3D_AsyncFlush( 53 IPC::Message* message = new PpapiHostMsg_PPBGraphics3D_AsyncFlush(
54 ppapi::API_ID_PPB_GRAPHICS_3D, resource_, put_offset); 54 ppapi::API_ID_PPB_GRAPHICS_3D, resource_, put_offset);
55 55
56 // Do not let a synchronous flush hold up this message. If this handler is 56 // 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 57 // deferred until after the synchronous flush completes, it will overwrite the
58 // cached last_state_ with out-of-date data. 58 // cached last_state_ with out-of-date data.
59 message->set_unblock(true); 59 message->set_unblock(true);
60 Send(message); 60 Send(message);
61 } 61 }
62 62
63 void PpapiCommandBufferProxy::OrderingBarrier(int32 put_offset) {
64 Flush(put_offset);
65 }
66
63 void PpapiCommandBufferProxy::WaitForTokenInRange(int32 start, int32 end) { 67 void PpapiCommandBufferProxy::WaitForTokenInRange(int32 start, int32 end) {
64 TryUpdateState(); 68 TryUpdateState();
65 if (!InRange(start, end, last_state_.token) && 69 if (!InRange(start, end, last_state_.token) &&
66 last_state_.error == gpu::error::kNoError) { 70 last_state_.error == gpu::error::kNoError) {
67 bool success = false; 71 bool success = false;
68 gpu::CommandBuffer::State state; 72 gpu::CommandBuffer::State state;
69 if (Send(new PpapiHostMsg_PPBGraphics3D_WaitForTokenInRange( 73 if (Send(new PpapiHostMsg_PPBGraphics3D_WaitForTokenInRange(
70 ppapi::API_ID_PPB_GRAPHICS_3D, 74 ppapi::API_ID_PPB_GRAPHICS_3D,
71 resource_, 75 resource_,
72 start, 76 start,
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 shared_state()->Read(&last_state_); 250 shared_state()->Read(&last_state_);
247 } 251 }
248 252
249 gpu::CommandBufferSharedState* PpapiCommandBufferProxy::shared_state() const { 253 gpu::CommandBufferSharedState* PpapiCommandBufferProxy::shared_state() const {
250 return reinterpret_cast<gpu::CommandBufferSharedState*>( 254 return reinterpret_cast<gpu::CommandBufferSharedState*>(
251 shared_state_shm_->memory()); 255 shared_state_shm_->memory());
252 } 256 }
253 257
254 } // namespace proxy 258 } // namespace proxy
255 } // namespace ppapi 259 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/proxy/ppapi_command_buffer_proxy.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698