| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "mojo/gles2/command_buffer_client_impl.h" | 5 #include "mojo/gles2/command_buffer_client_impl.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/process/process_handle.h" | 10 #include "base/process/process_handle.h" |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 AllocationScope scope; | 79 AllocationScope scope; |
| 80 command_buffer_->Initialize(sync_pipe.handle_to_self.Pass(), duped.Pass()); | 80 command_buffer_->Initialize(sync_pipe.handle_to_self.Pass(), duped.Pass()); |
| 81 // Wait for DidInitialize to come on the sync client pipe. | 81 // Wait for DidInitialize to come on the sync client pipe. |
| 82 if (!sync_dispatcher_->WaitAndDispatchOneMessage()) { | 82 if (!sync_dispatcher_->WaitAndDispatchOneMessage()) { |
| 83 VLOG(1) << "Channel encountered error while creating command buffer"; | 83 VLOG(1) << "Channel encountered error while creating command buffer"; |
| 84 return false; | 84 return false; |
| 85 } | 85 } |
| 86 return initialize_result_; | 86 return initialize_result_; |
| 87 } | 87 } |
| 88 | 88 |
| 89 gpu::CommandBuffer::State CommandBufferClientImpl::GetState() { | |
| 90 MakeProgressAndUpdateState(); | |
| 91 return last_state_; | |
| 92 } | |
| 93 | |
| 94 gpu::CommandBuffer::State CommandBufferClientImpl::GetLastState() { | 89 gpu::CommandBuffer::State CommandBufferClientImpl::GetLastState() { |
| 95 return last_state_; | 90 return last_state_; |
| 96 } | 91 } |
| 97 | 92 |
| 98 int32 CommandBufferClientImpl::GetLastToken() { | 93 int32 CommandBufferClientImpl::GetLastToken() { |
| 99 TryUpdateState(); | 94 TryUpdateState(); |
| 100 return last_state_.token; | 95 return last_state_.token; |
| 101 } | 96 } |
| 102 | 97 |
| 103 void CommandBufferClientImpl::Flush(int32 put_offset) { | 98 void CommandBufferClientImpl::Flush(int32 put_offset) { |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 return; | 258 return; |
| 264 } | 259 } |
| 265 } | 260 } |
| 266 | 261 |
| 267 void CommandBufferClientImpl::DrawAnimationFrame() { | 262 void CommandBufferClientImpl::DrawAnimationFrame() { |
| 268 delegate_->DrawAnimationFrame(); | 263 delegate_->DrawAnimationFrame(); |
| 269 } | 264 } |
| 270 | 265 |
| 271 } // namespace gles2 | 266 } // namespace gles2 |
| 272 } // namespace mojo | 267 } // namespace mojo |
| OLD | NEW |