Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(138)

Side by Side Diff: cc/scheduler/scheduler_state_machine.cc

Issue 221833009: cc: Move scheduling logic out of OutputSurface (Closed) Base URL: http://git.chromium.org/chromium/src.git@swapAck2Sched11
Patch Set: rebase; fix tests Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 848 matching lines...) Expand 10 before | Expand all | Expand 10 after
859 return !BeginFrameNeededToDraw() && ProactiveBeginFrameWanted(); 859 return !BeginFrameNeededToDraw() && ProactiveBeginFrameWanted();
860 } 860 }
861 861
862 // Non synchronous compositors should rely on 862 // Non synchronous compositors should rely on
863 // ProactiveBeginFrameWanted to poll for state instead. 863 // ProactiveBeginFrameWanted to poll for state instead.
864 return false; 864 return false;
865 } 865 }
866 866
867 bool SchedulerStateMachine::SupportsProactiveBeginFrame() const { 867 bool SchedulerStateMachine::SupportsProactiveBeginFrame() const {
868 // Both the synchronous compositor and disabled vsync settings 868 // Both the synchronous compositor and disabled vsync settings
869 // make it undesirable to proactively request BeginImplFrames. 869 // make it undesirable to proactively request BeginFrames.
870 // If this is true, the scheduler should poll. 870 // If this is true, the scheduler should poll.
871 return !settings_.using_synchronous_renderer_compositor; 871 return !settings_.using_synchronous_renderer_compositor;
872 } 872 }
873 873
874 // These are the cases where we definitely (or almost definitely) have a 874 // These are the cases where we definitely (or almost definitely) have a
875 // new frame to draw and can draw. 875 // new frame to draw and can draw.
876 bool SchedulerStateMachine::BeginFrameNeededToDraw() const { 876 bool SchedulerStateMachine::BeginFrameNeededToDraw() const {
877 // The output surface is the provider of BeginImplFrames, so we are not going 877 // The output surface is the provider of BeginImplFrames, so we are not going
878 // to get them even if we ask for them. 878 // to get them even if we ask for them.
879 if (!HasInitializedOutputSurface()) 879 if (!HasInitializedOutputSurface())
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after
1248 case OUTPUT_SURFACE_ACTIVE: 1248 case OUTPUT_SURFACE_ACTIVE:
1249 case OUTPUT_SURFACE_WAITING_FOR_FIRST_COMMIT: 1249 case OUTPUT_SURFACE_WAITING_FOR_FIRST_COMMIT:
1250 case OUTPUT_SURFACE_WAITING_FOR_FIRST_ACTIVATION: 1250 case OUTPUT_SURFACE_WAITING_FOR_FIRST_ACTIVATION:
1251 return true; 1251 return true;
1252 } 1252 }
1253 NOTREACHED(); 1253 NOTREACHED();
1254 return false; 1254 return false;
1255 } 1255 }
1256 1256
1257 } // namespace cc 1257 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698