| 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/commit_earlyout_reason.h" | 15 #include "cc/scheduler/commit_earlyout_reason.h" |
| 16 #include "cc/scheduler/draw_result.h" | 16 #include "cc/scheduler/draw_result.h" |
| 17 #include "cc/scheduler/scheduler_settings.h" | 17 #include "cc/scheduler/scheduler_settings.h" |
| 18 | 18 |
| 19 namespace base { | 19 namespace base { |
| 20 namespace debug { | 20 namespace trace_event { |
| 21 class ConvertableToTraceFormat; | 21 class ConvertableToTraceFormat; |
| 22 class TracedValue; | 22 class TracedValue; |
| 23 } | 23 } |
| 24 |
| 25 // TODO(ssid): remove these aliases after the tracing clients are moved to the |
| 26 // new trace_event namespace. See crbug.com/451032. ETA: March 2015 |
| 27 namespace debug { |
| 28 using ::base::trace_event::ConvertableToTraceFormat; |
| 29 using ::base::trace_event::TracedValue; |
| 30 } |
| 24 class Value; | 31 class Value; |
| 25 } | 32 } // namespace base |
| 26 | 33 |
| 27 namespace cc { | 34 namespace cc { |
| 28 | 35 |
| 29 // The SchedulerStateMachine decides how to coordinate main thread activites | 36 // The SchedulerStateMachine decides how to coordinate main thread activites |
| 30 // like painting/running javascript with rendering and input activities on the | 37 // like painting/running javascript with rendering and input activities on the |
| 31 // impl thread. | 38 // impl thread. |
| 32 // | 39 // |
| 33 // The state machine tracks internal state but is also influenced by external | 40 // The state machine tracks internal state but is also influenced by external |
| 34 // state. Internal state includes things like whether a frame has been | 41 // state. Internal state includes things like whether a frame has been |
| 35 // requested, while external state includes things like the current time being | 42 // requested, while external state includes things like the current time being |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 bool BeginFrameNeededForChildren() const; | 282 bool BeginFrameNeededForChildren() const; |
| 276 bool ProactiveBeginFrameWanted() const; | 283 bool ProactiveBeginFrameWanted() const; |
| 277 | 284 |
| 278 bool ShouldTriggerBeginImplFrameDeadlineImmediately() const; | 285 bool ShouldTriggerBeginImplFrameDeadlineImmediately() const; |
| 279 | 286 |
| 280 // True if we need to force activations to make forward progress. | 287 // True if we need to force activations to make forward progress. |
| 281 bool PendingActivationsShouldBeForced() const; | 288 bool PendingActivationsShouldBeForced() const; |
| 282 | 289 |
| 283 bool ShouldAnimate() const; | 290 bool ShouldAnimate() const; |
| 284 bool ShouldBeginOutputSurfaceCreation() const; | 291 bool ShouldBeginOutputSurfaceCreation() const; |
| 285 bool ShouldDrawForced() const; | |
| 286 bool ShouldDraw() const; | 292 bool ShouldDraw() const; |
| 287 bool ShouldActivatePendingTree() const; | 293 bool ShouldActivatePendingTree() const; |
| 288 bool ShouldSendBeginMainFrame() const; | 294 bool ShouldSendBeginMainFrame() const; |
| 289 bool ShouldCommit() const; | 295 bool ShouldCommit() const; |
| 290 bool ShouldPrepareTiles() const; | 296 bool ShouldPrepareTiles() const; |
| 291 | 297 |
| 292 void AdvanceCurrentFrameNumber(); | 298 void AdvanceCurrentFrameNumber(); |
| 293 bool HasAnimatedThisFrame() const; | 299 bool HasAnimatedThisFrame() const; |
| 294 bool HasSentBeginMainFrameThisFrame() const; | 300 bool HasSentBeginMainFrameThisFrame() const; |
| 295 bool HasRequestedSwapThisFrame() const; | 301 bool HasRequestedSwapThisFrame() const; |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 345 bool children_need_begin_frames_; | 351 bool children_need_begin_frames_; |
| 346 bool defer_commits_; | 352 bool defer_commits_; |
| 347 | 353 |
| 348 private: | 354 private: |
| 349 DISALLOW_COPY_AND_ASSIGN(SchedulerStateMachine); | 355 DISALLOW_COPY_AND_ASSIGN(SchedulerStateMachine); |
| 350 }; | 356 }; |
| 351 | 357 |
| 352 } // namespace cc | 358 } // namespace cc |
| 353 | 359 |
| 354 #endif // CC_SCHEDULER_SCHEDULER_STATE_MACHINE_H_ | 360 #endif // CC_SCHEDULER_SCHEDULER_STATE_MACHINE_H_ |
| OLD | NEW |