Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(819)

Unified Diff: cc/scheduler/begin_frame_source.h

Issue 845393002: cc: Create ProxyBeginFrameSource (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: cc/scheduler/begin_frame_source.h
diff --git a/cc/scheduler/begin_frame_source.h b/cc/scheduler/begin_frame_source.h
index 299db8e31d9b36176ffc98c17092ccc251110fd3..8afeafa3d20d7d4e74f8b37dbe0dbd718479b445 100644
--- a/cc/scheduler/begin_frame_source.h
+++ b/cc/scheduler/begin_frame_source.h
@@ -166,6 +166,44 @@ class CC_EXPORT BeginFrameSourceMixIn : public BeginFrameSource {
bool inside_as_value_into_;
};
+class CC_EXPORT ProxyBeginFrameSource : public BeginFrameSource {
mithro-old 2015/03/23 11:32:17 If I understand correctly, this just takes a messa
simonhong 2015/03/23 11:46:39 Yes, right.
+ public:
+ class Delegate {
+ public:
+ virtual void SetChildrenNeedBeginFrames(bool needs_begin_frames) = 0;
+ };
+
+ ProxyBeginFrameSource();
+ ~ProxyBeginFrameSource() override;
+
+ // BeginFrameSource
+ bool NeedsBeginFrames() const override;
+ // SetNeedsBeginFrames() is not used for now.
+ // Instead, turning BeginFrame on/off is controlled by Add/RemoveObserver.
mithro-old 2015/03/23 11:32:17 I think this violates the BeginFrameSource interfa
simonhong 2015/03/23 11:46:39 This is special login for ProxyBeginFrameSource. W
+ void SetNeedsBeginFrames(bool needs_begin_frames) override {}
+ void DidFinishFrame(size_t remaining_frames) override {}
+ void AddObserver(BeginFrameObserver* obs) override;
+ void RemoveObserver(BeginFrameObserver* obs) override;
+ void SetClientReady() override {}
+ void AsValueInto(base::debug::TracedValue* dict) const override;
+
+ void set_delegate(Delegate* delegate) {
mithro-old 2015/03/23 11:32:17 Why is this set_delegate rather than SetDelegate?
simonhong 2015/03/23 11:46:39 As I know, this style is used for just get/set met
+ delegate_ = delegate;
+ }
+
+ // virtual for testing.
+ virtual void BeginFrames(const BeginFrameArgs& args);
+
+ private:
+ Delegate* delegate_; // Not owned.
+ // Used to send to any new BeginFrameObserver immediately.
+ BeginFrameArgs missed_begin_frame_args_;
+ ObserverList<BeginFrameObserver> observer_list_;
+
+ DISALLOW_COPY_AND_ASSIGN(ProxyBeginFrameSource);
+};
+
+
// A frame source which calls BeginFrame (at the next possible time) as soon as
// remaining frames reaches zero.
class CC_EXPORT BackToBackBeginFrameSource : public BeginFrameSourceMixIn {

Powered by Google App Engine
This is Rietveld 408576698