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 740 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
751 FOR_EACH_OBSERVER(CompositorObserver, | 751 FOR_EACH_OBSERVER(CompositorObserver, |
752 observer_list_, | 752 observer_list_, |
753 OnCompositingDidCommit(this)); | 753 OnCompositingDidCommit(this)); |
754 } | 754 } |
755 | 755 |
756 void Compositor::DidCommitAndDrawFrame() { | 756 void Compositor::DidCommitAndDrawFrame() { |
757 base::TimeTicks start_time = base::TimeTicks::Now(); | 757 base::TimeTicks start_time = base::TimeTicks::Now(); |
758 FOR_EACH_OBSERVER(CompositorObserver, | 758 FOR_EACH_OBSERVER(CompositorObserver, |
759 observer_list_, | 759 observer_list_, |
760 OnCompositingStarted(this, start_time)); | 760 OnCompositingStarted(this, start_time)); |
761 // If we're threaded without a swap complete callback, we have to | |
762 // call DidCompleteSwapBuffersManually. | |
763 if (g_compositor_thread && | |
764 !host_->GetRendererCapabilities().using_swap_complete_callback) | |
765 DidCompleteSwapBuffers(); | |
766 } | 761 } |
767 | 762 |
768 void Compositor::DidCompleteSwapBuffers() { | 763 void Compositor::DidCompleteSwapBuffers() { |
769 DCHECK(g_compositor_thread); | 764 DCHECK(g_compositor_thread); |
770 NotifyEnd(); | 765 NotifyEnd(); |
771 } | 766 } |
772 | 767 |
773 void Compositor::ScheduleComposite() { | 768 void Compositor::ScheduleComposite() { |
774 if (!disable_schedule_composite_) | 769 if (!disable_schedule_composite_) |
775 ScheduleDraw(); | 770 ScheduleDraw(); |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
846 COMPOSITOR_EXPORT void DisableTestCompositor() { | 841 COMPOSITOR_EXPORT void DisableTestCompositor() { |
847 ResetImplicitFactory(); | 842 ResetImplicitFactory(); |
848 g_test_compositor_enabled = false; | 843 g_test_compositor_enabled = false; |
849 } | 844 } |
850 | 845 |
851 COMPOSITOR_EXPORT bool IsTestCompositorEnabled() { | 846 COMPOSITOR_EXPORT bool IsTestCompositorEnabled() { |
852 return g_test_compositor_enabled; | 847 return g_test_compositor_enabled; |
853 } | 848 } |
854 | 849 |
855 } // namespace ui | 850 } // namespace ui |
OLD | NEW |