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

Unified Diff: components/exo/compositor_frame_sink_holder.cc

Issue 2610513006: exo: Implement presentation interface. (Closed)
Patch Set: dcastagna nits Created 3 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
« no previous file with comments | « components/exo/compositor_frame_sink_holder.h ('k') | components/exo/surface.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/exo/compositor_frame_sink_holder.cc
diff --git a/components/exo/compositor_frame_sink_holder.cc b/components/exo/compositor_frame_sink_holder.cc
index e6cb2b8db280e76757e573423cad863d478f8069..7c2d2c4fb8468640e4178431e957d4f564da6034 100644
--- a/components/exo/compositor_frame_sink_holder.cc
+++ b/components/exo/compositor_frame_sink_holder.cc
@@ -36,20 +36,6 @@ void CompositorFrameSinkHolder::SetResourceReleaseCallback(
release_callbacks_[id] = callback;
}
-void CompositorFrameSinkHolder::ActivateFrameCallbacks(
- std::list<FrameCallback>* frame_callbacks) {
- active_frame_callbacks_.splice(active_frame_callbacks_.end(),
- *frame_callbacks);
- UpdateNeedsBeginFrame();
-}
-
-void CompositorFrameSinkHolder::CancelFrameCallbacks() {
- // Call pending frame callbacks with a null frame time to indicate that they
- // have been cancelled.
- for (const auto& frame_callback : active_frame_callbacks_)
- frame_callback.Run(base::TimeTicks());
-}
-
void CompositorFrameSinkHolder::SetNeedsBeginFrame(bool needs_begin_frame) {
needs_begin_frame_ = needs_begin_frame;
OnNeedsBeginFrames(needs_begin_frame);
@@ -72,10 +58,9 @@ void CompositorFrameSinkHolder::DidReceiveCompositorFrameAck() {
}
void CompositorFrameSinkHolder::OnBeginFrame(const cc::BeginFrameArgs& args) {
- while (!active_frame_callbacks_.empty()) {
- active_frame_callbacks_.front().Run(args.frame_time);
- active_frame_callbacks_.pop_front();
- }
+ if (surface_)
+ surface_->BeginFrame(args.frame_time);
+
begin_frame_source_->OnBeginFrame(args);
}
@@ -135,7 +120,7 @@ void CompositorFrameSinkHolder::UpdateNeedsBeginFrame() {
if (!begin_frame_source_)
return;
- bool needs_begin_frame = !active_frame_callbacks_.empty();
+ bool needs_begin_frame = surface_ && surface_->NeedsBeginFrame();
if (needs_begin_frame == needs_begin_frame_)
return;
« no previous file with comments | « components/exo/compositor_frame_sink_holder.h ('k') | components/exo/surface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698