OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_BEGIN_FRAME_SOURCE_H_ | 5 #ifndef CC_SCHEDULER_BEGIN_FRAME_SOURCE_H_ |
6 #define CC_SCHEDULER_BEGIN_FRAME_SOURCE_H_ | 6 #define CC_SCHEDULER_BEGIN_FRAME_SOURCE_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 // A BeginFrameSource that does nothing. | 140 // A BeginFrameSource that does nothing. |
141 class CC_EXPORT StubBeginFrameSource : public BeginFrameSource { | 141 class CC_EXPORT StubBeginFrameSource : public BeginFrameSource { |
142 public: | 142 public: |
143 void DidFinishFrame(BeginFrameObserver* obs, | 143 void DidFinishFrame(BeginFrameObserver* obs, |
144 const BeginFrameAck& ack) override {} | 144 const BeginFrameAck& ack) override {} |
145 void AddObserver(BeginFrameObserver* obs) override {} | 145 void AddObserver(BeginFrameObserver* obs) override {} |
146 void RemoveObserver(BeginFrameObserver* obs) override {} | 146 void RemoveObserver(BeginFrameObserver* obs) override {} |
147 bool IsThrottled() const override; | 147 bool IsThrottled() const override; |
148 }; | 148 }; |
149 | 149 |
150 // A frame source which ticks itself independently. | 150 // A frame source which parameters are updated externally. |
151 class CC_EXPORT SyntheticBeginFrameSource : public BeginFrameSource { | 151 class CC_EXPORT SyntheticBeginFrameSource : public BeginFrameSource { |
152 public: | 152 public: |
153 ~SyntheticBeginFrameSource() override; | 153 ~SyntheticBeginFrameSource() override; |
154 | 154 |
| 155 // Depending on implementation this might either update parameters used to |
| 156 // generate BeginFrame signal in BeginFrameSource or be used as an actual |
| 157 // VSync signal. |
155 virtual void OnUpdateVSyncParameters(base::TimeTicks timebase, | 158 virtual void OnUpdateVSyncParameters(base::TimeTicks timebase, |
156 base::TimeDelta interval) = 0; | 159 base::TimeDelta interval) = 0; |
157 // This overrides any past or future interval from updating vsync parameters. | 160 // This overrides any past or future interval from updating vsync parameters. |
158 virtual void SetAuthoritativeVSyncInterval(base::TimeDelta interval) = 0; | 161 virtual void SetAuthoritativeVSyncInterval(base::TimeDelta interval) = 0; |
159 }; | 162 }; |
160 | 163 |
161 // A frame source which calls BeginFrame (at the next possible time) as soon as | 164 // A frame source which calls BeginFrame (at the next possible time) as soon as |
162 // remaining frames reaches zero. | 165 // remaining frames reaches zero. |
163 class CC_EXPORT BackToBackBeginFrameSource : public SyntheticBeginFrameSource, | 166 class CC_EXPORT BackToBackBeginFrameSource : public SyntheticBeginFrameSource, |
164 public DelayBasedTimeSourceClient { | 167 public DelayBasedTimeSourceClient { |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 ExternalBeginFrameSourceClient* client_; | 265 ExternalBeginFrameSourceClient* client_; |
263 bool paused_ = false; | 266 bool paused_ = false; |
264 | 267 |
265 private: | 268 private: |
266 DISALLOW_COPY_AND_ASSIGN(ExternalBeginFrameSource); | 269 DISALLOW_COPY_AND_ASSIGN(ExternalBeginFrameSource); |
267 }; | 270 }; |
268 | 271 |
269 } // namespace cc | 272 } // namespace cc |
270 | 273 |
271 #endif // CC_SCHEDULER_BEGIN_FRAME_SOURCE_H_ | 274 #endif // CC_SCHEDULER_BEGIN_FRAME_SOURCE_H_ |
OLD | NEW |