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 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
268 void RemoveObserver(BeginFrameObserver* obs) override; | 268 void RemoveObserver(BeginFrameObserver* obs) override; |
269 void DidFinishFrame(BeginFrameObserver* obs, | 269 void DidFinishFrame(BeginFrameObserver* obs, |
270 const BeginFrameAck& ack) override; | 270 const BeginFrameAck& ack) override; |
271 bool IsThrottled() const override; | 271 bool IsThrottled() const override; |
272 void AsValueInto(base::trace_event::TracedValue* state) const override; | 272 void AsValueInto(base::trace_event::TracedValue* state) const override; |
273 | 273 |
274 void OnSetBeginFrameSourcePaused(bool paused); | 274 void OnSetBeginFrameSourcePaused(bool paused); |
275 void OnBeginFrame(const BeginFrameArgs& args); | 275 void OnBeginFrame(const BeginFrameArgs& args); |
276 | 276 |
277 protected: | 277 protected: |
278 // Called on AddObserver and gets missed BeginFrameArgs for the given | |
279 // observer; returns true if the output |args| argument is valid and | |
280 // OnBeginFrame should be called. | |
281 virtual bool GetMissedBeginFrameArgs(BeginFrameObserver* obs, | |
sunnyps
2017/05/30 22:13:17
nit: Can you make this return BeginFrameArgs? The
stanisc
2017/05/31 01:17:52
Returning BeginFrameArgs would be slightly less op
| |
282 BeginFrameArgs* missed_args); | |
283 | |
278 BeginFrameArgs last_begin_frame_args_; | 284 BeginFrameArgs last_begin_frame_args_; |
sunnyps
2017/05/30 22:13:17
nit: Can you add a method to get last_begin_frame_
stanisc
2017/05/31 01:17:52
I am reluctant to do this because this member is a
| |
279 std::unordered_set<BeginFrameObserver*> observers_; | 285 std::unordered_set<BeginFrameObserver*> observers_; |
280 ExternalBeginFrameSourceClient* client_; | 286 ExternalBeginFrameSourceClient* client_; |
281 bool paused_ = false; | 287 bool paused_ = false; |
282 | 288 |
283 private: | 289 private: |
284 DISALLOW_COPY_AND_ASSIGN(ExternalBeginFrameSource); | 290 DISALLOW_COPY_AND_ASSIGN(ExternalBeginFrameSource); |
285 }; | 291 }; |
286 | 292 |
287 } // namespace cc | 293 } // namespace cc |
288 | 294 |
289 #endif // CC_SCHEDULER_BEGIN_FRAME_SOURCE_H_ | 295 #endif // CC_SCHEDULER_BEGIN_FRAME_SOURCE_H_ |
OLD | NEW |