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

Side by Side Diff: cc/scheduler/begin_frame_source.h

Issue 619843002: cc: Make separate interface for BeginFrame ipc from OutputSurface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 unified diff | Download patch
OLDNEW
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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 // needs_begin_frames change. 155 // needs_begin_frames change.
156 virtual void OnNeedsBeginFramesChange(bool needs_begin_frames) {} 156 virtual void OnNeedsBeginFramesChange(bool needs_begin_frames) {}
157 157
158 BeginFrameObserver* observer_; 158 BeginFrameObserver* observer_;
159 bool needs_begin_frames_; 159 bool needs_begin_frames_;
160 160
161 private: 161 private:
162 bool inside_as_value_into_; 162 bool inside_as_value_into_;
163 }; 163 };
164 164
165 // A frame source that delivers BeginFrame from outside of CC layer.
danakj 2014/10/10 16:03:35 from outside of cc.
simonhong 2014/10/15 01:04:21 Done.
166 class CC_EXPORT ExternalBeginFrameSource : public BeginFrameSourceMixIn {
danakj 2014/10/10 16:03:35 This should inherit from BeginFrameSource (or why
simonhong 2014/10/15 01:04:21 I think ExternalBeginFrameSource should have a dif
danakj 2014/10/15 06:49:49 So you have a use case for why it would need to be
167 public:
168 virtual ~ExternalBeginFrameSource() {}
169
170 // Tells the Source that client is ready to handle external BeginFrames.
171 virtual void SetClientReady() = 0;
172 };
173
165 // A frame source which calls BeginFrame (at the next possible time) as soon as 174 // A frame source which calls BeginFrame (at the next possible time) as soon as
166 // remaining frames reaches zero. 175 // remaining frames reaches zero.
167 class CC_EXPORT BackToBackBeginFrameSource : public BeginFrameSourceMixIn { 176 class CC_EXPORT BackToBackBeginFrameSource : public BeginFrameSourceMixIn {
168 public: 177 public:
169 static scoped_ptr<BackToBackBeginFrameSource> Create( 178 static scoped_ptr<BackToBackBeginFrameSource> Create(
170 base::SingleThreadTaskRunner* task_runner); 179 base::SingleThreadTaskRunner* task_runner);
171 virtual ~BackToBackBeginFrameSource(); 180 virtual ~BackToBackBeginFrameSource();
172 181
173 // BeginFrameSource 182 // BeginFrameSource
174 virtual void DidFinishFrame(size_t remaining_frames) override; 183 virtual void DidFinishFrame(size_t remaining_frames) override;
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 280
272 base::TimeDelta minimum_interval_; 281 base::TimeDelta minimum_interval_;
273 282
274 BeginFrameSource* active_source_; 283 BeginFrameSource* active_source_;
275 std::set<BeginFrameSource*> source_list_; 284 std::set<BeginFrameSource*> source_list_;
276 }; 285 };
277 286
278 } // namespace cc 287 } // namespace cc
279 288
280 #endif // CC_SCHEDULER_BEGIN_FRAME_SOURCE_H_ 289 #endif // CC_SCHEDULER_BEGIN_FRAME_SOURCE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698