| 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 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 wait_run_loop_->Run(); | 284 wait_run_loop_->Run(); |
| 285 compositor->RemoveObserver(this); | 285 compositor->RemoveObserver(this); |
| 286 } | 286 } |
| 287 | 287 |
| 288 void DrawWaiterForTest::OnCompositingDidCommit(Compositor* compositor) { | 288 void DrawWaiterForTest::OnCompositingDidCommit(Compositor* compositor) { |
| 289 if (wait_for_commit_) | 289 if (wait_for_commit_) |
| 290 wait_run_loop_->Quit(); | 290 wait_run_loop_->Quit(); |
| 291 } | 291 } |
| 292 | 292 |
| 293 void DrawWaiterForTest::OnCompositingStarted(Compositor* compositor, | 293 void DrawWaiterForTest::OnCompositingStarted(Compositor* compositor, |
| 294 base::TimeTicks start_time) { | 294 gfx::FrameTime start_time) { |
| 295 } | 295 } |
| 296 | 296 |
| 297 void DrawWaiterForTest::OnCompositingEnded(Compositor* compositor) { | 297 void DrawWaiterForTest::OnCompositingEnded(Compositor* compositor) { |
| 298 if (!wait_for_commit_) | 298 if (!wait_for_commit_) |
| 299 wait_run_loop_->Quit(); | 299 wait_run_loop_->Quit(); |
| 300 } | 300 } |
| 301 | 301 |
| 302 void DrawWaiterForTest::OnCompositingAborted(Compositor* compositor) { | 302 void DrawWaiterForTest::OnCompositingAborted(Compositor* compositor) { |
| 303 } | 303 } |
| 304 | 304 |
| (...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 734 } | 734 } |
| 735 | 735 |
| 736 void Compositor::DidCommit() { | 736 void Compositor::DidCommit() { |
| 737 DCHECK(!IsLocked()); | 737 DCHECK(!IsLocked()); |
| 738 FOR_EACH_OBSERVER(CompositorObserver, | 738 FOR_EACH_OBSERVER(CompositorObserver, |
| 739 observer_list_, | 739 observer_list_, |
| 740 OnCompositingDidCommit(this)); | 740 OnCompositingDidCommit(this)); |
| 741 } | 741 } |
| 742 | 742 |
| 743 void Compositor::DidCommitAndDrawFrame() { | 743 void Compositor::DidCommitAndDrawFrame() { |
| 744 base::TimeTicks start_time = gfx::FrameTime::Now(); | 744 gfx::FrameTime start_time = gfx::FrameTime::Now(); |
| 745 FOR_EACH_OBSERVER(CompositorObserver, | 745 FOR_EACH_OBSERVER(CompositorObserver, |
| 746 observer_list_, | 746 observer_list_, |
| 747 OnCompositingStarted(this, start_time)); | 747 OnCompositingStarted(this, start_time)); |
| 748 } | 748 } |
| 749 | 749 |
| 750 void Compositor::DidCompleteSwapBuffers() { | 750 void Compositor::DidCompleteSwapBuffers() { |
| 751 DCHECK(g_compositor_thread); | 751 DCHECK(g_compositor_thread); |
| 752 NotifyEnd(); | 752 NotifyEnd(); |
| 753 } | 753 } |
| 754 | 754 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 808 // CompositorObservers to be notified before starting another | 808 // CompositorObservers to be notified before starting another |
| 809 // draw cycle. | 809 // draw cycle. |
| 810 ScheduleDraw(); | 810 ScheduleDraw(); |
| 811 } | 811 } |
| 812 FOR_EACH_OBSERVER(CompositorObserver, | 812 FOR_EACH_OBSERVER(CompositorObserver, |
| 813 observer_list_, | 813 observer_list_, |
| 814 OnCompositingEnded(this)); | 814 OnCompositingEnded(this)); |
| 815 } | 815 } |
| 816 | 816 |
| 817 } // namespace ui | 817 } // namespace ui |
| OLD | NEW |