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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 ScopedMessagePipeHandle command_buffer_handle) | 53 ScopedMessagePipeHandle command_buffer_handle) |
54 : delegate_(delegate), | 54 : delegate_(delegate), |
55 command_buffer_(MakeProxy<mojo::CommandBuffer>( | 55 command_buffer_(MakeProxy<mojo::CommandBuffer>( |
56 command_buffer_handle.Pass(), async_waiter)), | 56 command_buffer_handle.Pass(), async_waiter)), |
57 shared_state_(NULL), | 57 shared_state_(NULL), |
58 last_put_offset_(-1), | 58 last_put_offset_(-1), |
59 next_transfer_buffer_id_(0), | 59 next_transfer_buffer_id_(0), |
60 initialize_result_(false), | 60 initialize_result_(false), |
61 async_waiter_(async_waiter) { | 61 async_waiter_(async_waiter) { |
62 command_buffer_.set_error_handler(this); | 62 command_buffer_.set_error_handler(this); |
63 command_buffer_->SetClient(this); | 63 command_buffer_.set_client(this); |
64 } | 64 } |
65 | 65 |
66 CommandBufferClientImpl::~CommandBufferClientImpl() {} | 66 CommandBufferClientImpl::~CommandBufferClientImpl() {} |
67 | 67 |
68 bool CommandBufferClientImpl::Initialize() { | 68 bool CommandBufferClientImpl::Initialize() { |
69 const size_t kSharedStateSize = sizeof(gpu::CommandBufferSharedState); | 69 const size_t kSharedStateSize = sizeof(gpu::CommandBufferSharedState); |
70 void* memory = NULL; | 70 void* memory = NULL; |
71 mojo::ScopedSharedBufferHandle duped; | 71 mojo::ScopedSharedBufferHandle duped; |
72 bool result = CreateMapAndDupSharedBuffer( | 72 bool result = CreateMapAndDupSharedBuffer( |
73 kSharedStateSize, &memory, &shared_state_handle_, &duped); | 73 kSharedStateSize, &memory, &shared_state_handle_, &duped); |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 return; | 270 return; |
271 } | 271 } |
272 } | 272 } |
273 | 273 |
274 void CommandBufferClientImpl::DrawAnimationFrame() { | 274 void CommandBufferClientImpl::DrawAnimationFrame() { |
275 delegate_->DrawAnimationFrame(); | 275 delegate_->DrawAnimationFrame(); |
276 } | 276 } |
277 | 277 |
278 } // namespace gles2 | 278 } // namespace gles2 |
279 } // namespace mojo | 279 } // namespace mojo |
OLD | NEW |