| 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 "services/gles2/command_buffer_impl.h" | 5 #include "services/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 "gpu/command_buffer/service/sync_point_manager.h" | 9 #include "gpu/command_buffer/service/sync_point_manager.h" |
| 10 #include "services/gles2/command_buffer_driver.h" | 10 #include "services/gles2/command_buffer_driver.h" |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 driver_task_runner_->PostTask( | 117 driver_task_runner_->PostTask( |
| 118 FROM_HERE, base::Bind(&CommandBufferDriver::DestroyTransferBuffer, | 118 FROM_HERE, base::Bind(&CommandBufferDriver::DestroyTransferBuffer, |
| 119 base::Unretained(driver_.get()), id)); | 119 base::Unretained(driver_.get()), id)); |
| 120 } | 120 } |
| 121 | 121 |
| 122 void CommandBufferImpl::InsertSyncPoint(bool retire) { | 122 void CommandBufferImpl::InsertSyncPoint(bool retire) { |
| 123 uint32_t sync_point = sync_point_manager_->GenerateSyncPoint(); | 123 uint32_t sync_point = sync_point_manager_->GenerateSyncPoint(); |
| 124 sync_point_client_->DidInsertSyncPoint(sync_point); | 124 sync_point_client_->DidInsertSyncPoint(sync_point); |
| 125 if (retire) { | 125 if (retire) { |
| 126 driver_task_runner_->PostTask( | 126 driver_task_runner_->PostTask( |
| 127 FROM_HERE, base::Bind(&gpu::SyncPointManager::RetireSyncPoint, | 127 FROM_HERE, base::Bind(&CommandBufferDriver::RetireSyncPointOnGpuThread, |
| 128 sync_point_manager_, sync_point)); | 128 base::Unretained(driver_.get()), sync_point)); |
| 129 } | 129 } |
| 130 } | 130 } |
| 131 | 131 |
| 132 void CommandBufferImpl::RetireSyncPoint(uint32_t sync_point) { | 132 void CommandBufferImpl::RetireSyncPoint(uint32_t sync_point) { |
| 133 driver_task_runner_->PostTask( | 133 driver_task_runner_->PostTask( |
| 134 FROM_HERE, base::Bind(&gpu::SyncPointManager::RetireSyncPoint, | 134 FROM_HERE, base::Bind(&CommandBufferDriver::RetireSyncPointOnGpuThread, |
| 135 sync_point_manager_, sync_point)); | 135 base::Unretained(driver_.get()), sync_point)); |
| 136 } | 136 } |
| 137 | 137 |
| 138 void CommandBufferImpl::Echo(const mojo::Callback<void()>& callback) { | 138 void CommandBufferImpl::Echo(const mojo::Callback<void()>& callback) { |
| 139 driver_task_runner_->PostTaskAndReply(FROM_HERE, base::Bind(&base::DoNothing), | 139 driver_task_runner_->PostTaskAndReply(FROM_HERE, base::Bind(&base::DoNothing), |
| 140 base::Bind(&RunCallback, callback)); | 140 base::Bind(&RunCallback, callback)); |
| 141 } | 141 } |
| 142 | 142 |
| 143 void CommandBufferImpl::DidLoseContext() { | 143 void CommandBufferImpl::DidLoseContext() { |
| 144 NotifyAndDestroy(); | 144 NotifyAndDestroy(); |
| 145 } | 145 } |
| (...skipping 30 matching lines...) Expand all Loading... |
| 176 control_task_runner_->PostTask( | 176 control_task_runner_->PostTask( |
| 177 FROM_HERE, | 177 FROM_HERE, |
| 178 base::Bind(&CommandBufferImpl::Destroy, base::Unretained(this))); | 178 base::Bind(&CommandBufferImpl::Destroy, base::Unretained(this))); |
| 179 } | 179 } |
| 180 | 180 |
| 181 void CommandBufferImpl::Destroy() { | 181 void CommandBufferImpl::Destroy() { |
| 182 delete this; | 182 delete this; |
| 183 } | 183 } |
| 184 | 184 |
| 185 } // namespace gles2 | 185 } // namespace gles2 |
| OLD | NEW |