Chromium Code Reviews| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <deque> | 10 #include <deque> |
| (...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 538 | 538 |
| 539 void Compositor::SetLayerTreeDebugState( | 539 void Compositor::SetLayerTreeDebugState( |
| 540 const cc::LayerTreeDebugState& debug_state) { | 540 const cc::LayerTreeDebugState& debug_state) { |
| 541 host_->SetDebugState(debug_state); | 541 host_->SetDebugState(debug_state); |
| 542 } | 542 } |
| 543 | 543 |
| 544 const cc::RendererSettings& Compositor::GetRendererSettings() const { | 544 const cc::RendererSettings& Compositor::GetRendererSettings() const { |
| 545 return host_->GetSettings().renderer_settings; | 545 return host_->GetSettings().renderer_settings; |
| 546 } | 546 } |
| 547 | 547 |
| 548 int Compositor::GetFrameNumber() { | |
| 549 return host_->SourceFrameNumber(); | |
|
ajuma
2017/01/18 23:02:51
This number won't get incremented for frames that
varkha
2017/01/20 00:16:47
Done.
| |
| 550 } | |
| 551 | |
| 548 scoped_refptr<CompositorLock> Compositor::GetCompositorLock() { | 552 scoped_refptr<CompositorLock> Compositor::GetCompositorLock() { |
| 549 if (!compositor_lock_) { | 553 if (!compositor_lock_) { |
| 550 compositor_lock_ = new CompositorLock(this); | 554 compositor_lock_ = new CompositorLock(this); |
| 551 host_->SetDeferCommits(true); | 555 host_->SetDeferCommits(true); |
| 552 for (auto& observer : observer_list_) | 556 for (auto& observer : observer_list_) |
| 553 observer.OnCompositingLockStateChanged(this); | 557 observer.OnCompositingLockStateChanged(this); |
| 554 } | 558 } |
| 555 return compositor_lock_; | 559 return compositor_lock_; |
| 556 } | 560 } |
| 557 | 561 |
| 558 void Compositor::UnlockCompositor() { | 562 void Compositor::UnlockCompositor() { |
| 559 DCHECK(compositor_lock_); | 563 DCHECK(compositor_lock_); |
| 560 compositor_lock_ = NULL; | 564 compositor_lock_ = NULL; |
| 561 host_->SetDeferCommits(false); | 565 host_->SetDeferCommits(false); |
| 562 for (auto& observer : observer_list_) | 566 for (auto& observer : observer_list_) |
| 563 observer.OnCompositingLockStateChanged(this); | 567 observer.OnCompositingLockStateChanged(this); |
| 564 } | 568 } |
| 565 | 569 |
| 566 void Compositor::CancelCompositorLock() { | 570 void Compositor::CancelCompositorLock() { |
| 567 if (compositor_lock_) | 571 if (compositor_lock_) |
| 568 compositor_lock_->CancelLock(); | 572 compositor_lock_->CancelLock(); |
| 569 } | 573 } |
| 570 | 574 |
| 571 } // namespace ui | 575 } // namespace ui |
| OLD | NEW |