| 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 CommandBufferDelegate::~CommandBufferDelegate() {} | 44 CommandBufferDelegate::~CommandBufferDelegate() {} |
| 45 | 45 |
| 46 void CommandBufferDelegate::ContextLost() {} | 46 void CommandBufferDelegate::ContextLost() {} |
| 47 void CommandBufferDelegate::DrawAnimationFrame() {} | 47 void CommandBufferDelegate::DrawAnimationFrame() {} |
| 48 | 48 |
| 49 CommandBufferClientImpl::CommandBufferClientImpl( | 49 CommandBufferClientImpl::CommandBufferClientImpl( |
| 50 CommandBufferDelegate* delegate, | 50 CommandBufferDelegate* delegate, |
| 51 MojoAsyncWaiter* async_waiter, | 51 MojoAsyncWaiter* async_waiter, |
| 52 ScopedMessagePipeHandle command_buffer_handle) | 52 ScopedMessagePipeHandle command_buffer_handle) |
| 53 : delegate_(delegate), | 53 : delegate_(delegate), |
| 54 command_buffer_(MakeProxy<mojo::CommandBuffer>( | |
| 55 command_buffer_handle.Pass(), async_waiter)), | |
| 56 shared_state_(NULL), | 54 shared_state_(NULL), |
| 57 last_put_offset_(-1), | 55 last_put_offset_(-1), |
| 58 next_transfer_buffer_id_(0), | 56 next_transfer_buffer_id_(0), |
| 59 initialize_result_(false), | 57 initialize_result_(false), |
| 60 async_waiter_(async_waiter) { | 58 async_waiter_(async_waiter) { |
| 59 command_buffer_.Bind(command_buffer_handle.Pass(), async_waiter); |
| 61 command_buffer_.set_error_handler(this); | 60 command_buffer_.set_error_handler(this); |
| 62 command_buffer_.set_client(this); | 61 command_buffer_.set_client(this); |
| 63 } | 62 } |
| 64 | 63 |
| 65 CommandBufferClientImpl::~CommandBufferClientImpl() {} | 64 CommandBufferClientImpl::~CommandBufferClientImpl() {} |
| 66 | 65 |
| 67 bool CommandBufferClientImpl::Initialize() { | 66 bool CommandBufferClientImpl::Initialize() { |
| 68 const size_t kSharedStateSize = sizeof(gpu::CommandBufferSharedState); | 67 const size_t kSharedStateSize = sizeof(gpu::CommandBufferSharedState); |
| 69 void* memory = NULL; | 68 void* memory = NULL; |
| 70 mojo::ScopedSharedBufferHandle duped; | 69 mojo::ScopedSharedBufferHandle duped; |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 267 return; | 266 return; |
| 268 } | 267 } |
| 269 } | 268 } |
| 270 | 269 |
| 271 void CommandBufferClientImpl::DrawAnimationFrame() { | 270 void CommandBufferClientImpl::DrawAnimationFrame() { |
| 272 delegate_->DrawAnimationFrame(); | 271 delegate_->DrawAnimationFrame(); |
| 273 } | 272 } |
| 274 | 273 |
| 275 } // namespace gles2 | 274 } // namespace gles2 |
| 276 } // namespace mojo | 275 } // namespace mojo |
| OLD | NEW |