| 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 #ifndef CC_SCHEDULER_SCHEDULER_STATE_MACHINE_H_ | 5 #ifndef CC_SCHEDULER_SCHEDULER_STATE_MACHINE_H_ |
| 6 #define CC_SCHEDULER_SCHEDULER_STATE_MACHINE_H_ | 6 #define CC_SCHEDULER_SCHEDULER_STATE_MACHINE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 BEGIN_FRAME_STATE_INSIDE_BEGIN_FRAME, | 54 BEGIN_FRAME_STATE_INSIDE_BEGIN_FRAME, |
| 55 BEGIN_FRAME_STATE_DEADLINE_PENDING, | 55 BEGIN_FRAME_STATE_DEADLINE_PENDING, |
| 56 BEGIN_FRAME_STATE_INSIDE_DEADLINE, | 56 BEGIN_FRAME_STATE_INSIDE_DEADLINE, |
| 57 }; | 57 }; |
| 58 static const char* BeginFrameStateToString(BeginFrameState state); | 58 static const char* BeginFrameStateToString(BeginFrameState state); |
| 59 | 59 |
| 60 enum CommitState { | 60 enum CommitState { |
| 61 COMMIT_STATE_IDLE, | 61 COMMIT_STATE_IDLE, |
| 62 COMMIT_STATE_FRAME_IN_PROGRESS, | 62 COMMIT_STATE_FRAME_IN_PROGRESS, |
| 63 COMMIT_STATE_READY_TO_COMMIT, | 63 COMMIT_STATE_READY_TO_COMMIT, |
| 64 COMMIT_STATE_WAITING_FOR_FIRST_DRAW, | |
| 65 }; | 64 }; |
| 66 static const char* CommitStateToString(CommitState state); | 65 static const char* CommitStateToString(CommitState state); |
| 67 | 66 |
| 68 enum TextureState { | 67 enum TextureState { |
| 69 LAYER_TEXTURE_STATE_UNLOCKED, | 68 LAYER_TEXTURE_STATE_UNLOCKED, |
| 70 LAYER_TEXTURE_STATE_ACQUIRED_BY_MAIN_THREAD, | 69 LAYER_TEXTURE_STATE_ACQUIRED_BY_MAIN_THREAD, |
| 71 LAYER_TEXTURE_STATE_ACQUIRED_BY_IMPL_THREAD, | 70 LAYER_TEXTURE_STATE_ACQUIRED_BY_IMPL_THREAD, |
| 72 }; | 71 }; |
| 73 static const char* TextureStateToString(TextureState state); | 72 static const char* TextureStateToString(TextureState state); |
| 74 | 73 |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 | 184 |
| 186 // Indicates whether drawing would, at this time, make sense. | 185 // Indicates whether drawing would, at this time, make sense. |
| 187 // CanDraw can be used to supress flashes or checkerboarding | 186 // CanDraw can be used to supress flashes or checkerboarding |
| 188 // when such behavior would be undesirable. | 187 // when such behavior would be undesirable. |
| 189 void SetCanDraw(bool can); | 188 void SetCanDraw(bool can); |
| 190 | 189 |
| 191 // Indicates that the pending tree is ready for activation. | 190 // Indicates that the pending tree is ready for activation. |
| 192 void NotifyReadyToActivate(); | 191 void NotifyReadyToActivate(); |
| 193 | 192 |
| 194 bool has_pending_tree() const { return has_pending_tree_; } | 193 bool has_pending_tree() const { return has_pending_tree_; } |
| 194 bool active_tree_needs_first_draw() const { |
| 195 return active_tree_needs_first_draw_; |
| 196 } |
| 195 | 197 |
| 196 void DidLoseOutputSurface(); | 198 void DidLoseOutputSurface(); |
| 197 void DidCreateAndInitializeOutputSurface(); | 199 void DidCreateAndInitializeOutputSurface(); |
| 198 bool HasInitializedOutputSurface() const; | 200 bool HasInitializedOutputSurface() const; |
| 199 | 201 |
| 200 // True if we need to abort draws to make forward progress. | 202 // True if we need to abort draws to make forward progress. |
| 201 bool PendingDrawsShouldBeAborted() const; | 203 bool PendingDrawsShouldBeAborted() const; |
| 202 | 204 |
| 203 protected: | 205 protected: |
| 204 // True if we need to force activations to make forward progress. | 206 // True if we need to force activations to make forward progress. |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 bool draw_if_possible_failed_; | 260 bool draw_if_possible_failed_; |
| 259 bool did_create_and_initialize_first_output_surface_; | 261 bool did_create_and_initialize_first_output_surface_; |
| 260 | 262 |
| 261 private: | 263 private: |
| 262 DISALLOW_COPY_AND_ASSIGN(SchedulerStateMachine); | 264 DISALLOW_COPY_AND_ASSIGN(SchedulerStateMachine); |
| 263 }; | 265 }; |
| 264 | 266 |
| 265 } // namespace cc | 267 } // namespace cc |
| 266 | 268 |
| 267 #endif // CC_SCHEDULER_SCHEDULER_STATE_MACHINE_H_ | 269 #endif // CC_SCHEDULER_SCHEDULER_STATE_MACHINE_H_ |
| OLD | NEW |