OLD | NEW |
---|---|
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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 "cc/scheduler/scheduler_state_machine.h" | 5 #include "cc/scheduler/scheduler_state_machine.h" |
6 | 6 |
7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
8 #include "base/format_macros.h" | 8 #include "base/format_macros.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
(...skipping 785 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
796 return !BeginFrameNeededToDraw() && ProactiveBeginFrameWanted(); | 796 return !BeginFrameNeededToDraw() && ProactiveBeginFrameWanted(); |
797 } | 797 } |
798 | 798 |
799 // Non synchronous compositors should rely on | 799 // Non synchronous compositors should rely on |
800 // ProactiveBeginFrameWanted to poll for state instead. | 800 // ProactiveBeginFrameWanted to poll for state instead. |
801 return false; | 801 return false; |
802 } | 802 } |
803 | 803 |
804 bool SchedulerStateMachine::SupportsProactiveBeginFrame() const { | 804 bool SchedulerStateMachine::SupportsProactiveBeginFrame() const { |
805 // Both the synchronous compositor and disabled vsync settings | 805 // Both the synchronous compositor and disabled vsync settings |
806 // make it undesirable to proactively request BeginImplFrames. | 806 // make it undesirable to proactively request BeginFrames. |
807 // If this is true, the scheduler should poll. | 807 // If this is true, the scheduler should poll. |
808 return !settings_.using_synchronous_renderer_compositor; | 808 return !settings_.using_synchronous_renderer_compositor; |
Sami
2014/04/22 18:34:13
Should we also check throttle_frame_production her
brianderson
2014/04/22 22:34:49
I will update the comment. The way disabled vsync
| |
809 } | 809 } |
810 | 810 |
811 // These are the cases where we definitely (or almost definitely) have a | 811 // These are the cases where we definitely (or almost definitely) have a |
812 // new frame to draw and can draw. | 812 // new frame to draw and can draw. |
813 bool SchedulerStateMachine::BeginFrameNeededToDraw() const { | 813 bool SchedulerStateMachine::BeginFrameNeededToDraw() const { |
814 // The output surface is the provider of BeginImplFrames, so we are not going | 814 // The output surface is the provider of BeginImplFrames, so we are not going |
815 // to get them even if we ask for them. | 815 // to get them even if we ask for them. |
816 if (!HasInitializedOutputSurface()) | 816 if (!HasInitializedOutputSurface()) |
817 return false; | 817 return false; |
818 | 818 |
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1184 case OUTPUT_SURFACE_ACTIVE: | 1184 case OUTPUT_SURFACE_ACTIVE: |
1185 case OUTPUT_SURFACE_WAITING_FOR_FIRST_COMMIT: | 1185 case OUTPUT_SURFACE_WAITING_FOR_FIRST_COMMIT: |
1186 case OUTPUT_SURFACE_WAITING_FOR_FIRST_ACTIVATION: | 1186 case OUTPUT_SURFACE_WAITING_FOR_FIRST_ACTIVATION: |
1187 return true; | 1187 return true; |
1188 } | 1188 } |
1189 NOTREACHED(); | 1189 NOTREACHED(); |
1190 return false; | 1190 return false; |
1191 } | 1191 } |
1192 | 1192 |
1193 } // namespace cc | 1193 } // namespace cc |
OLD | NEW |