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/mus/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/mus/gles2/command_buffer_driver.h" | 9 #include "components/mus/gles2/command_buffer_driver.h" |
10 #include "components/mus/gles2/command_buffer_impl_observer.h" | 10 #include "components/mus/gles2/command_buffer_impl_observer.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 gpu_state_->control_task_runner()->PostTask( | 47 gpu_state_->control_task_runner()->PostTask( |
48 FROM_HERE, | 48 FROM_HERE, |
49 base::Bind(&CommandBufferImpl::BindToRequest, | 49 base::Bind(&CommandBufferImpl::BindToRequest, |
50 weak_ptr_factory_.GetWeakPtr(), base::Passed(&request))); | 50 weak_ptr_factory_.GetWeakPtr(), base::Passed(&request))); |
51 } | 51 } |
52 | 52 |
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 mojo::Array<int32_t> attribs) { |
58 sync_point_client_ = sync_point_client.Pass(); | 59 sync_point_client_ = sync_point_client.Pass(); |
59 driver_task_runner_->PostTask( | 60 driver_task_runner_->PostTask( |
60 FROM_HERE, | 61 FROM_HERE, |
61 base::Bind(&CommandBufferDriver::Initialize, | 62 base::Bind(&CommandBufferDriver::Initialize, |
62 base::Unretained(driver_.get()), base::Passed(&sync_client), | 63 base::Unretained(driver_.get()), base::Passed(&sync_client), |
63 base::Passed(&loss_observer), base::Passed(&shared_state))); | 64 base::Passed(&loss_observer), base::Passed(&shared_state), |
| 65 base::Passed(&attribs))); |
64 } | 66 } |
65 | 67 |
66 void CommandBufferImpl::SetGetBuffer(int32_t buffer) { | 68 void CommandBufferImpl::SetGetBuffer(int32_t buffer) { |
67 driver_task_runner_->PostTask( | 69 driver_task_runner_->PostTask( |
68 FROM_HERE, base::Bind(&CommandBufferDriver::SetGetBuffer, | 70 FROM_HERE, base::Bind(&CommandBufferDriver::SetGetBuffer, |
69 base::Unretained(driver_.get()), buffer)); | 71 base::Unretained(driver_.get()), buffer)); |
70 } | 72 } |
71 | 73 |
72 void CommandBufferImpl::Flush(int32_t put_offset) { | 74 void CommandBufferImpl::Flush(int32_t put_offset) { |
73 driver_task_runner_->PostTask( | 75 driver_task_runner_->PostTask( |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 // Objects we own (such as CommandBufferDriver) need to be destroyed on the | 163 // Objects we own (such as CommandBufferDriver) need to be destroyed on the |
162 // thread we were created on. | 164 // thread we were created on. |
163 driver_task_runner_->DeleteSoon(FROM_HERE, this); | 165 driver_task_runner_->DeleteSoon(FROM_HERE, this); |
164 } | 166 } |
165 | 167 |
166 void CommandBufferImpl::DidLoseContext() { | 168 void CommandBufferImpl::DidLoseContext() { |
167 OnConnectionError(); | 169 OnConnectionError(); |
168 } | 170 } |
169 | 171 |
170 } // namespace gles2 | 172 } // namespace gles2 |
OLD | NEW |