| 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" |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/time/time.h" | 12 #include "base/time/time.h" |
| 13 #include "cc/base/cc_export.h" | 13 #include "cc/base/cc_export.h" |
| 14 #include "cc/output/begin_frame_args.h" | 14 #include "cc/output/begin_frame_args.h" |
| 15 #include "cc/scheduler/draw_result.h" | 15 #include "cc/scheduler/draw_result.h" |
| 16 #include "cc/scheduler/scheduler_settings.h" | 16 #include "cc/scheduler/scheduler_settings.h" |
| 17 | 17 |
| 18 namespace base { | 18 namespace base { |
| 19 namespace debug { | |
| 20 class ConvertableToTraceForamt; | |
| 21 class TracedValue; | |
| 22 } | |
| 23 class Value; | 19 class Value; |
| 24 } | 20 } |
| 25 | 21 |
| 26 namespace cc { | 22 namespace cc { |
| 27 | 23 |
| 28 // The SchedulerStateMachine decides how to coordinate main thread activites | 24 // The SchedulerStateMachine decides how to coordinate main thread activites |
| 29 // like painting/running javascript with rendering and input activities on the | 25 // like painting/running javascript with rendering and input activities on the |
| 30 // impl thread. | 26 // impl thread. |
| 31 // | 27 // |
| 32 // The state machine tracks internal state but is also influenced by external | 28 // The state machine tracks internal state but is also influenced by external |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 ACTION_UPDATE_VISIBLE_TILES, | 95 ACTION_UPDATE_VISIBLE_TILES, |
| 100 ACTION_ACTIVATE_SYNC_TREE, | 96 ACTION_ACTIVATE_SYNC_TREE, |
| 101 ACTION_DRAW_AND_SWAP_IF_POSSIBLE, | 97 ACTION_DRAW_AND_SWAP_IF_POSSIBLE, |
| 102 ACTION_DRAW_AND_SWAP_FORCED, | 98 ACTION_DRAW_AND_SWAP_FORCED, |
| 103 ACTION_DRAW_AND_SWAP_ABORT, | 99 ACTION_DRAW_AND_SWAP_ABORT, |
| 104 ACTION_BEGIN_OUTPUT_SURFACE_CREATION, | 100 ACTION_BEGIN_OUTPUT_SURFACE_CREATION, |
| 105 ACTION_MANAGE_TILES, | 101 ACTION_MANAGE_TILES, |
| 106 }; | 102 }; |
| 107 static const char* ActionToString(Action action); | 103 static const char* ActionToString(Action action); |
| 108 | 104 |
| 109 scoped_refptr<base::debug::ConvertableToTraceFormat> AsValue() const; | 105 scoped_ptr<base::Value> AsValue() const; |
| 110 void AsValueInto(base::debug::TracedValue* dict) const; | |
| 111 | 106 |
| 112 Action NextAction() const; | 107 Action NextAction() const; |
| 113 void UpdateState(Action action); | 108 void UpdateState(Action action); |
| 114 | 109 |
| 115 // Indicates whether the impl thread needs a BeginImplFrame callback in order | 110 // Indicates whether the impl thread needs a BeginImplFrame callback in order |
| 116 // to make progress. | 111 // to make progress. |
| 117 bool BeginFrameNeeded() const; | 112 bool BeginFrameNeeded() const; |
| 118 | 113 |
| 119 // Indicates that we need to independently poll for new state and actions | 114 // Indicates that we need to independently poll for new state and actions |
| 120 // because we can't expect a BeginImplFrame. This is mostly used to avoid | 115 // because we can't expect a BeginImplFrame. This is mostly used to avoid |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 bool skip_begin_main_frame_to_reduce_latency_; | 301 bool skip_begin_main_frame_to_reduce_latency_; |
| 307 bool continuous_painting_; | 302 bool continuous_painting_; |
| 308 | 303 |
| 309 private: | 304 private: |
| 310 DISALLOW_COPY_AND_ASSIGN(SchedulerStateMachine); | 305 DISALLOW_COPY_AND_ASSIGN(SchedulerStateMachine); |
| 311 }; | 306 }; |
| 312 | 307 |
| 313 } // namespace cc | 308 } // namespace cc |
| 314 | 309 |
| 315 #endif // CC_SCHEDULER_SCHEDULER_STATE_MACHINE_H_ | 310 #endif // CC_SCHEDULER_SCHEDULER_STATE_MACHINE_H_ |
| OLD | NEW |