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

Side by Side Diff: services/gfx/compositor/frame_dispatcher.h

Issue 1997513002: Mozart: Generalize frame scheduling. (Closed) Base URL: git@github.com:domokit/mojo.git@moz-jank2
Patch Set: add comments Created 4 years, 7 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
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef SERVICES_GFX_COMPOSITOR_FRAME_DISPATCHER_H_
6 #define SERVICES_GFX_COMPOSITOR_FRAME_DISPATCHER_H_
7
8 #include <vector>
9
10 #include "base/callback.h"
11 #include "base/macros.h"
12 #include "mojo/services/gfx/composition/interfaces/scheduling.mojom.h"
13
14 namespace compositor {
15
16 using FrameCallback =
17 base::Callback<void(mojo::gfx::composition::FrameInfoPtr)>;
18
19 // Maintains a list of pending frame callbacks to be dispatched.
20 class FrameDispatcher {
21 public:
22 FrameDispatcher();
23 ~FrameDispatcher();
24
25 // Adds a callback, returns true if it was the first pending callback.
26 bool AddCallback(const FrameCallback& callback);
27
28 // Dispatches all pending callbacks then clears the list.
29 void DispatchCallbacks(const mojo::gfx::composition::FrameInfo& frame_info);
30
31 private:
32 std::vector<FrameCallback> pending_callbacks_;
33
34 DISALLOW_COPY_AND_ASSIGN(FrameDispatcher);
35 };
36
37 } // namespace compositor
38
39 #endif // SERVICES_GFX_COMPOSITOR_FRAME_DISPATCHER_H_
OLDNEW
« no previous file with comments | « services/gfx/compositor/compositor_engine.cc ('k') | services/gfx/compositor/frame_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698