| 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/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "components/mus/gles2/command_buffer_driver.h" | 10 #include "components/mus/gles2/command_buffer_driver.h" |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 | 207 |
| 208 bool CommandBufferImpl::FlushHelper(int32_t put_offset, | 208 bool CommandBufferImpl::FlushHelper(int32_t put_offset, |
| 209 uint32_t order_num) { | 209 uint32_t order_num) { |
| 210 DCHECK(driver_->IsScheduled()); | 210 DCHECK(driver_->IsScheduled()); |
| 211 driver_->sync_point_order_data()->BeginProcessingOrderNumber(order_num); | 211 driver_->sync_point_order_data()->BeginProcessingOrderNumber(order_num); |
| 212 driver_->Flush(put_offset); | 212 driver_->Flush(put_offset); |
| 213 | 213 |
| 214 // Return false if the Flush is not finished, so the CommandBufferTaskRunner | 214 // Return false if the Flush is not finished, so the CommandBufferTaskRunner |
| 215 // will not remove this task from the task queue. | 215 // will not remove this task from the task queue. |
| 216 const bool complete = !driver_->HasUnprocessedCommands(); | 216 const bool complete = !driver_->HasUnprocessedCommands(); |
| 217 if (complete) | 217 if (!complete) |
| 218 driver_->sync_point_order_data()->PauseProcessingOrderNumber(order_num); |
| 219 else |
| 218 driver_->sync_point_order_data()->FinishProcessingOrderNumber(order_num); | 220 driver_->sync_point_order_data()->FinishProcessingOrderNumber(order_num); |
| 219 return complete; | 221 return complete; |
| 220 } | 222 } |
| 221 | 223 |
| 222 bool CommandBufferImpl::MakeProgressHelper( | 224 bool CommandBufferImpl::MakeProgressHelper( |
| 223 int32_t last_get_offset, | 225 int32_t last_get_offset, |
| 224 const base::Callback<void(mojom::CommandBufferStatePtr)>& callback) { | 226 const base::Callback<void(mojom::CommandBufferStatePtr)>& callback) { |
| 225 DCHECK(driver_->IsScheduled()); | 227 DCHECK(driver_->IsScheduled()); |
| 226 mojom::CommandBufferStatePtr state = | 228 mojom::CommandBufferStatePtr state = |
| 227 mojom::CommandBufferState::From(driver_->GetLastState()); | 229 mojom::CommandBufferState::From(driver_->GetLastState()); |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 driver_.get(), | 285 driver_.get(), |
| 284 base::Bind(&CommandBufferImpl::DeleteHelper, base::Unretained(this))); | 286 base::Bind(&CommandBufferImpl::DeleteHelper, base::Unretained(this))); |
| 285 } | 287 } |
| 286 | 288 |
| 287 bool CommandBufferImpl::DeleteHelper() { | 289 bool CommandBufferImpl::DeleteHelper() { |
| 288 delete this; | 290 delete this; |
| 289 return true; | 291 return true; |
| 290 } | 292 } |
| 291 | 293 |
| 292 } // namespace mus | 294 } // namespace mus |
| OLD | NEW |