OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ui/compositor/compositor.h" | 5 #include "ui/compositor/compositor.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <deque> | 8 #include <deque> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
393 | 393 |
394 void Compositor::SetLayerTreeDebugState( | 394 void Compositor::SetLayerTreeDebugState( |
395 const cc::LayerTreeDebugState& debug_state) { | 395 const cc::LayerTreeDebugState& debug_state) { |
396 host_->SetDebugState(debug_state); | 396 host_->SetDebugState(debug_state); |
397 } | 397 } |
398 | 398 |
399 const cc::RendererSettings& Compositor::GetRendererSettings() const { | 399 const cc::RendererSettings& Compositor::GetRendererSettings() const { |
400 return host_->settings().renderer_settings; | 400 return host_->settings().renderer_settings; |
401 } | 401 } |
402 | 402 |
| 403 const cc::LayerTreeHost& Compositor::GetLayerTreeHost() const { |
| 404 DCHECK(host_); |
| 405 return *host_.get(); |
| 406 } |
| 407 |
403 scoped_refptr<CompositorLock> Compositor::GetCompositorLock() { | 408 scoped_refptr<CompositorLock> Compositor::GetCompositorLock() { |
404 if (!compositor_lock_) { | 409 if (!compositor_lock_) { |
405 compositor_lock_ = new CompositorLock(this); | 410 compositor_lock_ = new CompositorLock(this); |
406 host_->SetDeferCommits(true); | 411 host_->SetDeferCommits(true); |
407 FOR_EACH_OBSERVER(CompositorObserver, | 412 FOR_EACH_OBSERVER(CompositorObserver, |
408 observer_list_, | 413 observer_list_, |
409 OnCompositingLockStateChanged(this)); | 414 OnCompositingLockStateChanged(this)); |
410 } | 415 } |
411 return compositor_lock_; | 416 return compositor_lock_; |
412 } | 417 } |
413 | 418 |
414 void Compositor::UnlockCompositor() { | 419 void Compositor::UnlockCompositor() { |
415 DCHECK(compositor_lock_); | 420 DCHECK(compositor_lock_); |
416 compositor_lock_ = NULL; | 421 compositor_lock_ = NULL; |
417 host_->SetDeferCommits(false); | 422 host_->SetDeferCommits(false); |
418 FOR_EACH_OBSERVER(CompositorObserver, | 423 FOR_EACH_OBSERVER(CompositorObserver, |
419 observer_list_, | 424 observer_list_, |
420 OnCompositingLockStateChanged(this)); | 425 OnCompositingLockStateChanged(this)); |
421 } | 426 } |
422 | 427 |
423 void Compositor::CancelCompositorLock() { | 428 void Compositor::CancelCompositorLock() { |
424 if (compositor_lock_) | 429 if (compositor_lock_) |
425 compositor_lock_->CancelLock(); | 430 compositor_lock_->CancelLock(); |
426 } | 431 } |
427 | 432 |
428 } // namespace ui | 433 } // namespace ui |
OLD | NEW |