OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_driver.h" | 5 #include "components/mus/gles2/command_buffer_driver.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/memory/shared_memory.h" | 9 #include "base/memory/shared_memory.h" |
10 #include "components/mus/gles2/command_buffer_type_conversions.h" | 10 #include "components/mus/gles2/command_buffer_type_conversions.h" |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 | 281 |
282 bool CommandBufferDriver::OnWaitSyncPoint(uint32_t sync_point) { | 282 bool CommandBufferDriver::OnWaitSyncPoint(uint32_t sync_point) { |
283 if (!sync_point) | 283 if (!sync_point) |
284 return true; | 284 return true; |
285 if (gpu_state_->sync_point_manager()->IsSyncPointRetired(sync_point)) | 285 if (gpu_state_->sync_point_manager()->IsSyncPointRetired(sync_point)) |
286 return true; | 286 return true; |
287 scheduler_->SetScheduled(false); | 287 scheduler_->SetScheduled(false); |
288 gpu_state_->sync_point_manager()->AddSyncPointCallback( | 288 gpu_state_->sync_point_manager()->AddSyncPointCallback( |
289 sync_point, base::Bind(&CommandBufferDriver::OnSyncPointRetired, | 289 sync_point, base::Bind(&CommandBufferDriver::OnSyncPointRetired, |
290 weak_factory_.GetWeakPtr())); | 290 weak_factory_.GetWeakPtr())); |
291 return scheduler_->IsScheduled(); | 291 return scheduler_->scheduled(); |
292 } | 292 } |
293 | 293 |
294 void CommandBufferDriver::OnSyncPointRetired() { | 294 void CommandBufferDriver::OnSyncPointRetired() { |
295 scheduler_->SetScheduled(true); | 295 scheduler_->SetScheduled(true); |
296 } | 296 } |
297 | 297 |
298 void CommandBufferDriver::OnContextLost(uint32_t reason) { | 298 void CommandBufferDriver::OnContextLost(uint32_t reason) { |
299 loss_observer_->DidLoseContext(reason); | 299 loss_observer_->DidLoseContext(reason); |
300 client_->DidLoseContext(); | 300 client_->DidLoseContext(); |
301 } | 301 } |
302 | 302 |
303 void CommandBufferDriver::DestroyDecoder() { | 303 void CommandBufferDriver::DestroyDecoder() { |
304 if (decoder_) { | 304 if (decoder_) { |
305 bool have_context = decoder_->MakeCurrent(); | 305 bool have_context = decoder_->MakeCurrent(); |
306 decoder_->Destroy(have_context); | 306 decoder_->Destroy(have_context); |
307 decoder_.reset(); | 307 decoder_.reset(); |
308 } | 308 } |
309 } | 309 } |
310 | 310 |
311 } // namespace mus | 311 } // namespace mus |
OLD | NEW |