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 "components/view_manager/gles2/command_buffer_impl.h" | 5 #include "components/mus/gles2/command_buffer_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "components/view_manager/gles2/command_buffer_driver.h" | 9 #include "components/mus/gles2/command_buffer_driver.h" |
10 #include "components/view_manager/gles2/command_buffer_impl_observer.h" | 10 #include "components/mus/gles2/command_buffer_impl_observer.h" |
11 #include "components/view_manager/gles2/gpu_state.h" | 11 #include "components/mus/gles2/gpu_state.h" |
12 #include "gpu/command_buffer/service/sync_point_manager.h" | 12 #include "gpu/command_buffer/service/sync_point_manager.h" |
13 | 13 |
14 namespace gles2 { | 14 namespace gles2 { |
15 namespace { | 15 namespace { |
16 void RunCallback(const mojo::Callback<void()>& callback) { | 16 void RunCallback(const mojo::Callback<void()>& callback) { |
17 callback.Run(); | 17 callback.Run(); |
18 } | 18 } |
19 } // namespace | 19 } // namespace |
20 | 20 |
21 class CommandBufferImpl::CommandBufferDriverClientImpl | 21 class CommandBufferImpl::CommandBufferDriverClientImpl |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 void CommandBufferImpl::Initialize( | 53 void CommandBufferImpl::Initialize( |
54 mojo::CommandBufferSyncClientPtr sync_client, | 54 mojo::CommandBufferSyncClientPtr sync_client, |
55 mojo::CommandBufferSyncPointClientPtr sync_point_client, | 55 mojo::CommandBufferSyncPointClientPtr sync_point_client, |
56 mojo::CommandBufferLostContextObserverPtr loss_observer, | 56 mojo::CommandBufferLostContextObserverPtr loss_observer, |
57 mojo::ScopedSharedBufferHandle shared_state) { | 57 mojo::ScopedSharedBufferHandle shared_state) { |
58 sync_point_client_ = sync_point_client.Pass(); | 58 sync_point_client_ = sync_point_client.Pass(); |
59 driver_task_runner_->PostTask( | 59 driver_task_runner_->PostTask( |
60 FROM_HERE, | 60 FROM_HERE, |
61 base::Bind(&CommandBufferDriver::Initialize, | 61 base::Bind(&CommandBufferDriver::Initialize, |
62 base::Unretained(driver_.get()), base::Passed(&sync_client), | 62 base::Unretained(driver_.get()), base::Passed(&sync_client), |
63 base::Passed(&loss_observer), | 63 base::Passed(&loss_observer), base::Passed(&shared_state))); |
64 base::Passed(&shared_state))); | |
65 } | 64 } |
66 | 65 |
67 void CommandBufferImpl::SetGetBuffer(int32_t buffer) { | 66 void CommandBufferImpl::SetGetBuffer(int32_t buffer) { |
68 driver_task_runner_->PostTask( | 67 driver_task_runner_->PostTask( |
69 FROM_HERE, base::Bind(&CommandBufferDriver::SetGetBuffer, | 68 FROM_HERE, base::Bind(&CommandBufferDriver::SetGetBuffer, |
70 base::Unretained(driver_.get()), buffer)); | 69 base::Unretained(driver_.get()), buffer)); |
71 } | 70 } |
72 | 71 |
73 void CommandBufferImpl::Flush(int32_t put_offset) { | 72 void CommandBufferImpl::Flush(int32_t put_offset) { |
74 driver_task_runner_->PostTask( | 73 driver_task_runner_->PostTask( |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 // Objects we own (such as CommandBufferDriver) need to be destroyed on the | 161 // Objects we own (such as CommandBufferDriver) need to be destroyed on the |
163 // thread we were created on. | 162 // thread we were created on. |
164 driver_task_runner_->DeleteSoon(FROM_HERE, this); | 163 driver_task_runner_->DeleteSoon(FROM_HERE, this); |
165 } | 164 } |
166 | 165 |
167 void CommandBufferImpl::DidLoseContext() { | 166 void CommandBufferImpl::DidLoseContext() { |
168 OnConnectionError(); | 167 OnConnectionError(); |
169 } | 168 } |
170 | 169 |
171 } // namespace gles2 | 170 } // namespace gles2 |
OLD | NEW |