| 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 base::Bind(&CommandBufferImpl::BindToRequest, | 60 base::Bind(&CommandBufferImpl::BindToRequest, |
| 61 base::Unretained(this), base::Passed(&request))); | 61 base::Unretained(this), base::Passed(&request))); |
| 62 } | 62 } |
| 63 | 63 |
| 64 void CommandBufferImpl::DidLoseContext(uint32_t reason) { | 64 void CommandBufferImpl::DidLoseContext(uint32_t reason) { |
| 65 driver_->set_client(nullptr); | 65 driver_->set_client(nullptr); |
| 66 loss_observer_->DidLoseContext(reason); | 66 loss_observer_->DidLoseContext(reason); |
| 67 } | 67 } |
| 68 | 68 |
| 69 CommandBufferImpl::~CommandBufferImpl() { | 69 CommandBufferImpl::~CommandBufferImpl() { |
| 70 // Retire all sync points. | |
| 71 for (uint32_t sync_point : sync_points_) | |
| 72 gpu_state_->sync_point_manager()->RetireSyncPoint(sync_point); | |
| 73 if (observer_) | 70 if (observer_) |
| 74 observer_->OnCommandBufferImplDestroyed(); | 71 observer_->OnCommandBufferImplDestroyed(); |
| 75 } | 72 } |
| 76 | 73 |
| 77 void CommandBufferImpl::Initialize( | 74 void CommandBufferImpl::Initialize( |
| 78 mus::mojom::CommandBufferLostContextObserverPtr loss_observer, | 75 mus::mojom::CommandBufferLostContextObserverPtr loss_observer, |
| 79 mojo::ScopedSharedBufferHandle shared_state, | 76 mojo::ScopedSharedBufferHandle shared_state, |
| 80 mojo::Array<int32_t> attribs, | 77 mojo::Array<int32_t> attribs, |
| 81 const mojom::CommandBuffer::InitializeCallback& callback) { | 78 const mojom::CommandBuffer::InitializeCallback& callback) { |
| 82 gpu_state_->command_buffer_task_runner()->task_runner()->PostTask( | 79 gpu_state_->command_buffer_task_runner()->task_runner()->PostTask( |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 driver_.get(), base::Bind(&CommandBufferImpl::DeleteOnGpuThread, | 255 driver_.get(), base::Bind(&CommandBufferImpl::DeleteOnGpuThread, |
| 259 base::Unretained(this))); | 256 base::Unretained(this))); |
| 260 } | 257 } |
| 261 | 258 |
| 262 bool CommandBufferImpl::DeleteOnGpuThread() { | 259 bool CommandBufferImpl::DeleteOnGpuThread() { |
| 263 delete this; | 260 delete this; |
| 264 return true; | 261 return true; |
| 265 } | 262 } |
| 266 | 263 |
| 267 } // namespace mus | 264 } // namespace mus |
| OLD | NEW |