OLD | NEW |
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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 // deferred until after the synchronous flush completes, it will overwrite the | 50 // deferred until after the synchronous flush completes, it will overwrite the |
51 // cached last_state_ with out-of-date data. | 51 // cached last_state_ with out-of-date data. |
52 message->set_unblock(true); | 52 message->set_unblock(true); |
53 Send(message); | 53 Send(message); |
54 } | 54 } |
55 | 55 |
56 void PpapiCommandBufferProxy::WaitForTokenInRange(int32 start, int32 end) { | 56 void PpapiCommandBufferProxy::WaitForTokenInRange(int32 start, int32 end) { |
57 if (last_state_.error != gpu::error::kNoError) | 57 if (last_state_.error != gpu::error::kNoError) |
58 return; | 58 return; |
59 | 59 |
60 bool success; | 60 bool success = false; |
61 gpu::CommandBuffer::State state; | 61 gpu::CommandBuffer::State state; |
62 if (Send(new PpapiHostMsg_PPBGraphics3D_WaitForTokenInRange( | 62 if (Send(new PpapiHostMsg_PPBGraphics3D_WaitForTokenInRange( |
63 ppapi::API_ID_PPB_GRAPHICS_3D, | 63 ppapi::API_ID_PPB_GRAPHICS_3D, |
64 resource_, | 64 resource_, |
65 start, | 65 start, |
66 end, | 66 end, |
67 &state, | 67 &state, |
68 &success))) | 68 &success))) |
69 UpdateState(state, success); | 69 UpdateState(state, success); |
70 } | 70 } |
71 | 71 |
72 void PpapiCommandBufferProxy::WaitForGetOffsetInRange(int32 start, int32 end) { | 72 void PpapiCommandBufferProxy::WaitForGetOffsetInRange(int32 start, int32 end) { |
73 if (last_state_.error != gpu::error::kNoError) | 73 if (last_state_.error != gpu::error::kNoError) |
74 return; | 74 return; |
75 | 75 |
76 bool success; | 76 bool success = false; |
77 gpu::CommandBuffer::State state; | 77 gpu::CommandBuffer::State state; |
78 if (Send(new PpapiHostMsg_PPBGraphics3D_WaitForGetOffsetInRange( | 78 if (Send(new PpapiHostMsg_PPBGraphics3D_WaitForGetOffsetInRange( |
79 ppapi::API_ID_PPB_GRAPHICS_3D, | 79 ppapi::API_ID_PPB_GRAPHICS_3D, |
80 resource_, | 80 resource_, |
81 start, | 81 start, |
82 end, | 82 end, |
83 &state, | 83 &state, |
84 &success))) | 84 &success))) |
85 UpdateState(state, success); | 85 UpdateState(state, success); |
86 } | 86 } |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 last_state_ = state; | 222 last_state_ = state; |
223 } | 223 } |
224 } else { | 224 } else { |
225 last_state_.error = gpu::error::kLostContext; | 225 last_state_.error = gpu::error::kLostContext; |
226 ++last_state_.generation; | 226 ++last_state_.generation; |
227 } | 227 } |
228 } | 228 } |
229 | 229 |
230 } // namespace proxy | 230 } // namespace proxy |
231 } // namespace ppapi | 231 } // namespace ppapi |
OLD | NEW |