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 "cc/base/cc_export.h" | |
13 #include "cc/output/begin_frame_args.h" | 12 #include "cc/output/begin_frame_args.h" |
14 #include "cc/scheduler/commit_earlyout_reason.h" | 13 #include "cc/scheduler/commit_earlyout_reason.h" |
15 #include "cc/scheduler/draw_result.h" | 14 #include "cc/scheduler/draw_result.h" |
16 #include "cc/scheduler/scheduler_settings.h" | 15 #include "cc/scheduler/scheduler_settings.h" |
17 | 16 |
18 namespace base { | 17 namespace base { |
19 namespace trace_event { | 18 namespace trace_event { |
20 class ConvertableToTraceFormat; | 19 class ConvertableToTraceFormat; |
21 class TracedValue; | 20 class TracedValue; |
22 } | 21 } |
23 class Value; | 22 class Value; |
24 } | 23 } |
25 | 24 |
26 namespace cc { | 25 namespace cc { |
27 | 26 |
28 // The SchedulerStateMachine decides how to coordinate main thread activites | 27 // The SchedulerStateMachine decides how to coordinate main thread activites |
29 // like painting/running javascript with rendering and input activities on the | 28 // like painting/running javascript with rendering and input activities on the |
30 // impl thread. | 29 // impl thread. |
31 // | 30 // |
32 // The state machine tracks internal state but is also influenced by external | 31 // The state machine tracks internal state but is also influenced by external |
33 // state. Internal state includes things like whether a frame has been | 32 // state. Internal state includes things like whether a frame has been |
34 // requested, while external state includes things like the current time being | 33 // requested, while external state includes things like the current time being |
35 // near to the vblank time. | 34 // near to the vblank time. |
36 // | 35 // |
37 // The scheduler seperates "what to do next" from the updating of its internal | 36 // The scheduler seperates "what to do next" from the updating of its internal |
38 // state to make testing cleaner. | 37 // state to make testing cleaner. |
39 class CC_EXPORT SchedulerStateMachine { | 38 class SchedulerStateMachine { |
40 public: | 39 public: |
41 // settings must be valid for the lifetime of this class. | 40 // settings must be valid for the lifetime of this class. |
42 explicit SchedulerStateMachine(const SchedulerSettings& settings); | 41 explicit SchedulerStateMachine(const SchedulerSettings& settings); |
43 | 42 |
44 enum OutputSurfaceState { | 43 enum OutputSurfaceState { |
45 OUTPUT_SURFACE_ACTIVE, | 44 OUTPUT_SURFACE_ACTIVE, |
46 OUTPUT_SURFACE_LOST, | 45 OUTPUT_SURFACE_LOST, |
47 OUTPUT_SURFACE_CREATING, | 46 OUTPUT_SURFACE_CREATING, |
48 OUTPUT_SURFACE_WAITING_FOR_FIRST_COMMIT, | 47 OUTPUT_SURFACE_WAITING_FOR_FIRST_COMMIT, |
49 OUTPUT_SURFACE_WAITING_FOR_FIRST_ACTIVATION, | 48 OUTPUT_SURFACE_WAITING_FOR_FIRST_ACTIVATION, |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
334 bool defer_commits_; | 333 bool defer_commits_; |
335 bool last_commit_had_no_updates_; | 334 bool last_commit_had_no_updates_; |
336 | 335 |
337 private: | 336 private: |
338 DISALLOW_COPY_AND_ASSIGN(SchedulerStateMachine); | 337 DISALLOW_COPY_AND_ASSIGN(SchedulerStateMachine); |
339 }; | 338 }; |
340 | 339 |
341 } // namespace cc | 340 } // namespace cc |
342 | 341 |
343 #endif // CC_SCHEDULER_SCHEDULER_STATE_MACHINE_H_ | 342 #endif // CC_SCHEDULER_SCHEDULER_STATE_MACHINE_H_ |
OLD | NEW |