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