| 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_H_ |    5 #ifndef CC_SCHEDULER_SCHEDULER_H_ | 
|    6 #define CC_SCHEDULER_SCHEDULER_H_ |    6 #define CC_SCHEDULER_SCHEDULER_H_ | 
|    7  |    7  | 
|    8 #include <deque> |    8 #include <deque> | 
|    9 #include <string> |    9 #include <string> | 
|   10  |   10  | 
|   11 #include "base/basictypes.h" |   11 #include "base/basictypes.h" | 
|   12 #include "base/cancelable_callback.h" |   12 #include "base/cancelable_callback.h" | 
|   13 #include "base/memory/scoped_ptr.h" |   13 #include "base/memory/scoped_ptr.h" | 
|   14 #include "base/power_monitor/power_monitor.h" |   14 #include "base/power_monitor/power_monitor.h" | 
|   15 #include "base/power_monitor/power_observer.h" |   15 #include "base/power_monitor/power_observer.h" | 
|   16 #include "base/time/time.h" |   16 #include "base/time/time.h" | 
|   17 #include "cc/base/cc_export.h" |   17 #include "cc/base/cc_export.h" | 
|   18 #include "cc/output/begin_frame_args.h" |   18 #include "cc/output/begin_frame_args.h" | 
|   19 #include "cc/output/vsync_parameter_observer.h" |   19 #include "cc/output/vsync_parameter_observer.h" | 
|   20 #include "cc/scheduler/begin_frame_source.h" |   20 #include "cc/scheduler/begin_frame_source.h" | 
|   21 #include "cc/scheduler/delay_based_time_source.h" |   21 #include "cc/scheduler/delay_based_time_source.h" | 
|   22 #include "cc/scheduler/draw_result.h" |   22 #include "cc/scheduler/draw_result.h" | 
|   23 #include "cc/scheduler/scheduler_settings.h" |   23 #include "cc/scheduler/scheduler_settings.h" | 
|   24 #include "cc/scheduler/scheduler_state_machine.h" |   24 #include "cc/scheduler/scheduler_state_machine.h" | 
|   25  |   25  | 
|   26 namespace base { |   26 namespace base { | 
|   27 namespace trace_event { |   27 namespace trace_event { | 
|   28 class ConvertableToTraceFormat; |   28 class ConvertableToTraceFormat; | 
|   29 } |   29 } | 
|   30  |   30 class SingleThreadTaskRunner; | 
|   31 // TODO(ssid): remove these aliases after the tracing clients are moved to the |  | 
|   32 // new trace_event namespace. See crbug.com/451032. ETA: March 2015 |  | 
|   33 namespace debug { |  | 
|   34 using ::base::trace_event::ConvertableToTraceFormat; |  | 
|   35 } |   31 } | 
|   36 class SingleThreadTaskRunner; |  | 
|   37 }  // namespace base |  | 
|   38  |   32  | 
|   39 namespace cc { |   33 namespace cc { | 
|   40  |   34  | 
|   41 class SchedulerClient { |   35 class SchedulerClient { | 
|   42  public: |   36  public: | 
|   43   virtual void WillBeginImplFrame(const BeginFrameArgs& args) = 0; |   37   virtual void WillBeginImplFrame(const BeginFrameArgs& args) = 0; | 
|   44   virtual void ScheduledActionSendBeginMainFrame() = 0; |   38   virtual void ScheduledActionSendBeginMainFrame() = 0; | 
|   45   virtual DrawResult ScheduledActionDrawAndSwapIfPossible() = 0; |   39   virtual DrawResult ScheduledActionDrawAndSwapIfPossible() = 0; | 
|   46   virtual DrawResult ScheduledActionDrawAndSwapForced() = 0; |   40   virtual DrawResult ScheduledActionDrawAndSwapForced() = 0; | 
|   47   virtual void ScheduledActionAnimate() = 0; |   41   virtual void ScheduledActionAnimate() = 0; | 
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  163   } |  157   } | 
|  164  |  158  | 
|  165   base::TimeTicks AnticipatedDrawTime() const; |  159   base::TimeTicks AnticipatedDrawTime() const; | 
|  166  |  160  | 
|  167   void NotifyBeginMainFrameStarted(); |  161   void NotifyBeginMainFrameStarted(); | 
|  168  |  162  | 
|  169   base::TimeTicks LastBeginImplFrameTime(); |  163   base::TimeTicks LastBeginImplFrameTime(); | 
|  170  |  164  | 
|  171   void SetDeferCommits(bool defer_commits); |  165   void SetDeferCommits(bool defer_commits); | 
|  172  |  166  | 
|  173   scoped_refptr<base::debug::ConvertableToTraceFormat> AsValue() const; |  167   scoped_refptr<base::trace_event::ConvertableToTraceFormat> AsValue() const; | 
|  174   void AsValueInto(base::debug::TracedValue* value) const override; |  168   void AsValueInto(base::trace_event::TracedValue* value) const override; | 
|  175  |  169  | 
|  176   void SetContinuousPainting(bool continuous_painting) { |  170   void SetContinuousPainting(bool continuous_painting) { | 
|  177     state_machine_.SetContinuousPainting(continuous_painting); |  171     state_machine_.SetContinuousPainting(continuous_painting); | 
|  178   } |  172   } | 
|  179  |  173  | 
|  180   void SetChildrenNeedBeginFrames(bool children_need_begin_frames); |  174   void SetChildrenNeedBeginFrames(bool children_need_begin_frames); | 
|  181  |  175  | 
|  182  protected: |  176  protected: | 
|  183   Scheduler(SchedulerClient* client, |  177   Scheduler(SchedulerClient* client, | 
|  184             const SchedulerSettings& scheduler_settings, |  178             const SchedulerSettings& scheduler_settings, | 
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  264  |  258  | 
|  265   friend class SchedulerFrameSourcesConstructor; |  259   friend class SchedulerFrameSourcesConstructor; | 
|  266   friend class TestSchedulerFrameSourcesConstructor; |  260   friend class TestSchedulerFrameSourcesConstructor; | 
|  267  |  261  | 
|  268   DISALLOW_COPY_AND_ASSIGN(Scheduler); |  262   DISALLOW_COPY_AND_ASSIGN(Scheduler); | 
|  269 }; |  263 }; | 
|  270  |  264  | 
|  271 }  // namespace cc |  265 }  // namespace cc | 
|  272  |  266  | 
|  273 #endif  // CC_SCHEDULER_SCHEDULER_H_ |  267 #endif  // CC_SCHEDULER_SCHEDULER_H_ | 
| OLD | NEW |