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

Unified Diff: content/renderer/gpu/compositor_external_begin_frame_source.h

Issue 2281143002: Refactor external begin frame source into a base class (Closed)
Patch Set: danakj review Created 4 years, 4 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
« no previous file with comments | « cc/scheduler/begin_frame_source.cc ('k') | content/renderer/gpu/compositor_external_begin_frame_source.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/gpu/compositor_external_begin_frame_source.h
diff --git a/content/renderer/gpu/compositor_external_begin_frame_source.h b/content/renderer/gpu/compositor_external_begin_frame_source.h
index 8a965772f36ddd4493fa854e7e66ba116c60aa36..64aa7d51944f70c99db4e8fb859c685a2b8a12a3 100644
--- a/content/renderer/gpu/compositor_external_begin_frame_source.h
+++ b/content/renderer/gpu/compositor_external_begin_frame_source.h
@@ -22,8 +22,15 @@ namespace content {
// This class can be created only on the main thread, but then becomes pinned
// to a fixed thread where cc::Scheduler is running.
+//
+// TODO(enne): This only implements the BeginFrameSource interface to
+// make it easier to give to cc as an external begin frame source. In the
+// future, if this is owned by an output surface, then the internal
+// cc::ExternalBeginFrameSource can be the BeginFrameSource passed to cc
+// directly rather than proxied by this class.
class CompositorExternalBeginFrameSource
: public cc::BeginFrameSource,
+ public cc::ExternalBeginFrameSourceClient,
public NON_EXPORTED_BASE(base::NonThreadSafe) {
public:
explicit CompositorExternalBeginFrameSource(
@@ -38,6 +45,9 @@ class CompositorExternalBeginFrameSource
void DidFinishFrame(cc::BeginFrameObserver* obs,
size_t remaining_frames) override {}
+ // cc::ExternalBeginFrameSourceClient implementation.
+ void OnNeedsBeginFrames(bool need_begin_frames) override;
+
private:
class CompositorExternalBeginFrameSourceProxy
: public base::RefCountedThreadSafe<
@@ -62,22 +72,20 @@ class CompositorExternalBeginFrameSource
DISALLOW_COPY_AND_ASSIGN(CompositorExternalBeginFrameSourceProxy);
};
- void SetClientReady();
void OnMessageReceived(const IPC::Message& message);
-
void OnSetBeginFrameSourcePaused(bool paused);
void OnBeginFrame(const cc::BeginFrameArgs& args);
bool Send(IPC::Message* message);
+ // Shared helper implementation.
+ cc::ExternalBeginFrameSource external_begin_frame_source_;
+
scoped_refptr<CompositorForwardingMessageFilter> begin_frame_source_filter_;
scoped_refptr<CompositorExternalBeginFrameSourceProxy>
begin_frame_source_proxy_;
scoped_refptr<IPC::SyncMessageFilter> message_sender_;
int routing_id_;
CompositorForwardingMessageFilter::Handler begin_frame_source_filter_handler_;
- cc::BeginFrameArgs missed_begin_frame_args_;
- std::unordered_set<cc::BeginFrameObserver*> observers_;
- bool paused_ = false;
DISALLOW_COPY_AND_ASSIGN(CompositorExternalBeginFrameSource);
};
« no previous file with comments | « cc/scheduler/begin_frame_source.cc ('k') | content/renderer/gpu/compositor_external_begin_frame_source.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698