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

Unified Diff: cc/scheduler/scheduler_state_machine.h

Issue 22926024: cc: Control activation from the Scheduler (Closed) Base URL: http://git.chromium.org/chromium/src.git@schedOutputSurface4
Patch Set: Created 7 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: cc/scheduler/scheduler_state_machine.h
diff --git a/cc/scheduler/scheduler_state_machine.h b/cc/scheduler/scheduler_state_machine.h
index 101b36d312ddceb74984274465a919dbbf5db25e..e50fcedf960c58a745702341cab7b8dd79b124d8 100644
--- a/cc/scheduler/scheduler_state_machine.h
+++ b/cc/scheduler/scheduler_state_machine.h
@@ -73,7 +73,7 @@ class CC_EXPORT SchedulerStateMachine {
ACTION_SEND_BEGIN_FRAME_TO_MAIN_THREAD,
ACTION_COMMIT,
ACTION_UPDATE_VISIBLE_TILES,
- ACTION_ACTIVATE_PENDING_TREE_IF_NEEDED,
+ ACTION_ACTIVATE_PENDING_TREE,
ACTION_DRAW_IF_POSSIBLE,
ACTION_DRAW_FORCED,
ACTION_DRAW_AND_SWAP_ABORT,
@@ -153,12 +153,16 @@ class CC_EXPORT SchedulerStateMachine {
// when such behavior would be undesirable.
void SetCanDraw(bool can);
- // Indicates whether or not there is a pending tree. This influences
- // whether or not we can succesfully commit at this time. If the
+ // Indicates that the pending tree is ready for activation.
+ void NotifyReadyToActivate();
+
+ // Indicates whether or not there is a pending tree (which may be null)
+ // and whether the active tree is null or not. This
+ // influences whether or not we can succesfully commit at this time. If the
// last commit is still being processed (but not blocking), it may not
// be possible to take another commit yet. This overrides force commit,
// as a commit is already still in flight.
- void SetHasPendingTree(bool has_pending_tree);
+ void SetHasTrees(bool has_pending_tree, bool active_tree_is_null_);
bool has_pending_tree() const { return has_pending_tree_; }
void DidLoseOutputSurface();
@@ -174,13 +178,13 @@ class CC_EXPORT SchedulerStateMachine {
protected:
bool ShouldDrawForced() const;
bool ShouldDraw() const;
- bool ShouldAttemptTreeActivation() const;
+ bool ShouldActivatePendingTree() const;
bool ShouldAcquireLayerTexturesForMainThread() const;
bool ShouldUpdateVisibleTiles() const;
bool ShouldSendBeginFrameToMainThread() const;
bool HasDrawnThisFrame() const;
- bool HasAttemptedTreeActivationThisFrame() const;
+ bool HasActivatedPendingTreeThisFrame() const;
bool HasUpdatedVisibleTilesThisFrame() const;
bool HasSentBeginFrameToMainThreadThisFrame() const;
@@ -196,7 +200,7 @@ class CC_EXPORT SchedulerStateMachine {
int current_frame_number_;
int last_frame_number_where_begin_frame_sent_to_main_thread_;
int last_frame_number_where_draw_was_called_;
- int last_frame_number_where_tree_activation_attempted_;
+ int last_frame_number_pending_tree_activated_;
int last_frame_number_where_update_visible_tiles_was_called_;
int consecutive_failed_draws_;
int maximum_number_of_failed_draws_before_draw_is_forced_;
@@ -210,10 +214,13 @@ class CC_EXPORT SchedulerStateMachine {
bool main_thread_needs_layer_textures_;
bool inside_begin_frame_;
BeginFrameArgs last_begin_frame_args_;
+ bool active_tree_has_been_drawn_;
+ bool active_tree_is_null_;
bool visible_;
bool can_start_;
bool can_draw_;
bool has_pending_tree_;
+ bool pending_tree_is_ready_for_activation_;
bool draw_if_possible_failed_;
TextureState texture_state_;
bool did_create_and_initialize_first_output_surface_;

Powered by Google App Engine
This is Rietveld 408576698