| 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_FRAME_RATE_CONTROLLER_H_ | 5 #ifndef CC_SCHEDULER_FRAME_RATE_CONTROLLER_H_ |
| 6 #define CC_SCHEDULER_FRAME_RATE_CONTROLLER_H_ | 6 #define CC_SCHEDULER_FRAME_RATE_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 void SetDeadlineAdjustment(base::TimeDelta delta); | 66 void SetDeadlineAdjustment(base::TimeDelta delta); |
| 67 | 67 |
| 68 protected: | 68 protected: |
| 69 friend class FrameRateControllerTimeSourceAdapter; | 69 friend class FrameRateControllerTimeSourceAdapter; |
| 70 void OnTimerTick(); | 70 void OnTimerTick(); |
| 71 | 71 |
| 72 void PostManualTick(); | 72 void PostManualTick(); |
| 73 void ManualTick(); | 73 void ManualTick(); |
| 74 | 74 |
| 75 // This returns null for unthrottled frame-rate. | 75 // This returns null for unthrottled frame-rate. |
| 76 base::TimeTicks NextTickTime(); | 76 gfx::FrameTime NextTickTime(); |
| 77 // This returns now for unthrottled frame-rate. | 77 // This returns now for unthrottled frame-rate. |
| 78 base::TimeTicks LastTickTime(); | 78 gfx::FrameTime LastTickTime(); |
| 79 | 79 |
| 80 FrameRateControllerClient* client_; | 80 FrameRateControllerClient* client_; |
| 81 int num_frames_pending_; | 81 int num_frames_pending_; |
| 82 int max_swaps_pending_; | 82 int max_swaps_pending_; |
| 83 base::TimeDelta interval_; | 83 base::TimeDelta interval_; |
| 84 base::TimeDelta deadline_adjustment_; | 84 base::TimeDelta deadline_adjustment_; |
| 85 scoped_refptr<TimeSource> time_source_; | 85 scoped_refptr<TimeSource> time_source_; |
| 86 scoped_ptr<FrameRateControllerTimeSourceAdapter> time_source_client_adapter_; | 86 scoped_ptr<FrameRateControllerTimeSourceAdapter> time_source_client_adapter_; |
| 87 bool active_; | 87 bool active_; |
| 88 | 88 |
| 89 // Members for unthrottled frame-rate. | 89 // Members for unthrottled frame-rate. |
| 90 bool is_time_source_throttling_; | 90 bool is_time_source_throttling_; |
| 91 base::SingleThreadTaskRunner* task_runner_; | 91 base::SingleThreadTaskRunner* task_runner_; |
| 92 base::WeakPtrFactory<FrameRateController> weak_factory_; | 92 base::WeakPtrFactory<FrameRateController> weak_factory_; |
| 93 | 93 |
| 94 private: | 94 private: |
| 95 DISALLOW_COPY_AND_ASSIGN(FrameRateController); | 95 DISALLOW_COPY_AND_ASSIGN(FrameRateController); |
| 96 }; | 96 }; |
| 97 | 97 |
| 98 } // namespace cc | 98 } // namespace cc |
| 99 | 99 |
| 100 #endif // CC_SCHEDULER_FRAME_RATE_CONTROLLER_H_ | 100 #endif // CC_SCHEDULER_FRAME_RATE_CONTROLLER_H_ |
| OLD | NEW |