Chromium Code Reviews| 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 <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 131 // BeginFrameSource. | 131 // BeginFrameSource. |
| 132 // - Use the CallOnBeginFrame method to call to the observer(s). | 132 // - Use the CallOnBeginFrame method to call to the observer(s). |
| 133 // - Recommended (but not required) to call BeginFrameSourceMixIn::AsValueInto | 133 // - Recommended (but not required) to call BeginFrameSourceMixIn::AsValueInto |
| 134 // in their own AsValueInto implementation. | 134 // in their own AsValueInto implementation. |
| 135 class CC_EXPORT BeginFrameSourceMixIn : public BeginFrameSource { | 135 class CC_EXPORT BeginFrameSourceMixIn : public BeginFrameSource { |
| 136 public: | 136 public: |
| 137 ~BeginFrameSourceMixIn() override {} | 137 ~BeginFrameSourceMixIn() override {} |
| 138 | 138 |
| 139 // BeginFrameSource | 139 // BeginFrameSource |
| 140 bool NeedsBeginFrames() const override; | 140 bool NeedsBeginFrames() const override; |
| 141 void SetNeedsBeginFrames(bool needs_begin_frames) override; | 141 void SetNeedsBeginFrames(bool needs_begin_frames) final; |
| 142 void DidFinishFrame(size_t remaining_frames) override {} | 142 void DidFinishFrame(size_t remaining_frames) override {} |
| 143 void AddObserver(BeginFrameObserver* obs) final; | 143 void AddObserver(BeginFrameObserver* obs) final; |
| 144 void RemoveObserver(BeginFrameObserver* obs) final; | 144 void RemoveObserver(BeginFrameObserver* obs) final; |
| 145 void SetClientReady() override {} | 145 void SetClientReady() override {} |
| 146 | 146 |
| 147 // Tracing support - Recommend (but not required) to call this implementation | 147 // Tracing support - Recommend (but not required) to call this implementation |
| 148 // in any override. | 148 // in any override. |
| 149 void AsValueInto(base::debug::TracedValue* dict) const override; | 149 void AsValueInto(base::debug::TracedValue* dict) const override; |
| 150 | 150 |
| 151 protected: | 151 protected: |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 254 | 254 |
| 255 // BeginFrameObserver | 255 // BeginFrameObserver |
| 256 // The mux is an BeginFrameObserver as it needs to proxy the OnBeginFrame | 256 // The mux is an BeginFrameObserver as it needs to proxy the OnBeginFrame |
| 257 // calls to preserve the monotonicity of the BeginFrameArgs when switching | 257 // calls to preserve the monotonicity of the BeginFrameArgs when switching |
| 258 // sources. | 258 // sources. |
| 259 void OnBeginFrame(const BeginFrameArgs& args) override; | 259 void OnBeginFrame(const BeginFrameArgs& args) override; |
| 260 const BeginFrameArgs LastUsedBeginFrameArgs() const override; | 260 const BeginFrameArgs LastUsedBeginFrameArgs() const override; |
| 261 | 261 |
| 262 // BeginFrameSource | 262 // BeginFrameSource |
| 263 bool NeedsBeginFrames() const override; | 263 bool NeedsBeginFrames() const override; |
| 264 void SetNeedsBeginFrames(bool needs_begin_frames) override; | 264 // BeginFrameSourceMixIn |
| 265 void OnNeedsBeginFramesChange(bool needs_begin_frames) override; | |
|
simonhong
2015/02/03 19:37:55
Below DidFinishFrame(...) overrides BeginFrameSour
Jimmy Jo
2015/02/04 01:46:47
Done.
| |
| 265 void DidFinishFrame(size_t remaining_frames) override; | 266 void DidFinishFrame(size_t remaining_frames) override; |
| 266 | 267 |
| 267 // Tracing | 268 // Tracing |
| 268 void AsValueInto(base::debug::TracedValue* dict) const override; | 269 void AsValueInto(base::debug::TracedValue* dict) const override; |
| 269 | 270 |
| 270 protected: | 271 protected: |
| 271 BeginFrameSourceMultiplexer(); | 272 BeginFrameSourceMultiplexer(); |
| 272 explicit BeginFrameSourceMultiplexer(base::TimeDelta minimum_interval); | 273 explicit BeginFrameSourceMultiplexer(base::TimeDelta minimum_interval); |
| 273 | 274 |
| 274 bool HasSource(BeginFrameSource* source); | 275 bool HasSource(BeginFrameSource* source); |
| 275 bool IsIncreasing(const BeginFrameArgs& args); | 276 bool IsIncreasing(const BeginFrameArgs& args); |
| 276 | 277 |
| 277 base::TimeDelta minimum_interval_; | 278 base::TimeDelta minimum_interval_; |
| 278 | 279 |
| 279 BeginFrameSource* active_source_; | 280 BeginFrameSource* active_source_; |
| 280 std::set<BeginFrameSource*> source_list_; | 281 std::set<BeginFrameSource*> source_list_; |
| 281 }; | 282 }; |
| 282 | 283 |
| 283 } // namespace cc | 284 } // namespace cc |
| 284 | 285 |
| 285 #endif // CC_SCHEDULER_BEGIN_FRAME_SOURCE_H_ | 286 #endif // CC_SCHEDULER_BEGIN_FRAME_SOURCE_H_ |
| OLD | NEW |