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

Unified 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 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 3b8a576c4ed9fa8363aeea15a2bdef772355234e..8086bed64bf787fb9387c6c7ed61c20ff26a59f3 100644
--- a/cc/scheduler/begin_frame_source.h
+++ b/cc/scheduler/begin_frame_source.h
@@ -10,6 +10,7 @@
#include "base/debug/trace_event.h"
#include "base/logging.h"
+#include "base/memory/ref_counted.h"
#include "cc/output/begin_frame_args.h"
#include "cc/output/vsync_parameter_observer.h"
#include "cc/scheduler/delay_based_time_source.h"
@@ -162,6 +163,27 @@ class CC_EXPORT BeginFrameSourceMixIn : public BeginFrameSource {
bool inside_as_value_into_;
};
+// A frame source that delivers BeginFrame from outside of cc.
+// ExternalBeginFrameSource is ref-counted object because it could be used by
+// outside of cc to deliver new BeginFrame.
+class CC_EXPORT ExternalBeginFrameSource
+ : public BeginFrameSourceMixIn,
+ public base::RefCounted<ExternalBeginFrameSource>,
+ public NON_EXPORTED_BASE(base::NonThreadSafe) {
+ public:
+ ExternalBeginFrameSource() {}
+
+ // Tells the Source that client is ready to handle external BeginFrames.
+ virtual void SetClientReady() {}
+
+ protected:
+ friend class base::RefCounted<ExternalBeginFrameSource>;
+ virtual ~ExternalBeginFrameSource() {}
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ExternalBeginFrameSource);
+};
+
// 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