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

Side by Side Diff: ui/base/compositor/begin_frame_manager.h

Issue 423773002: Unified BeginFrame scheduling (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add deadline params to SendBeginFrame() Created 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/base/BUILD.gn ('k') | ui/base/compositor/begin_frame_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef UI_BASE_COMPOSITOR_BEGIN_FRAME_MANAGER_H_
6 #define UI_BASE_COMPOSITOR_BEGIN_FRAME_MANAGER_H_
7
8 #include "base/basictypes.h"
9 #include "base/observer_list.h"
10 #include "base/threading/non_thread_safe.h"
11 #include "base/time/time.h"
12 #include "ui/base/ui_base_export.h"
13
14 namespace ui {
15
16 // This class delivers a BeginFrame request from the Compositor to its
17 // observers. It also handles next BeginFrame scheduling via its delegate.
18 // Browser compositor will own this.
19 // This class will be run only on main thread.
20 class UI_BASE_EXPORT BeginFrameManager : public base::NonThreadSafe {
21 public:
22 // Subclass should deliver BeginFrame to its client.
23 class Observer {
24 public:
25 virtual void OnSendBeginFrame(base::TimeTicks timebase,
26 base::TimeTicks deadline,
27 base::TimeDelta interval) = 0;
28 };
29
30 // Subclass should implement howto schedule next BeginFrame.
31 class Delegate {
32 public:
33 virtual void RequestBeginFrame() = 0;
34 };
35
36 BeginFrameManager();
37 ~BeginFrameManager();
38
39 void SendBeginFrame(base::TimeTicks frame_time,
brianderson 2014/07/30 19:44:29 Please use BeginFrameArgs instead.
simonhong 2014/07/31 00:18:03 Done.
40 base::TimeTicks deadline,
41 base::TimeDelta interval);
42 void RequestBeginFrame() const;
43
44 void AddObserver(Observer* observer);
45 void RemoveObserver(Observer* observer);
46
47 void set_delegate(Delegate* delegate) {
48 delegate_ = delegate;
49 }
50
51 private:
52 // Not owned by this class.
53 Delegate* delegate_;
54 ObserverList<BeginFrameManager::Observer> observer_list_;
55
56 DISALLOW_COPY_AND_ASSIGN(BeginFrameManager);
57 };
58
59 } // namespace ui
60
61 #endif // UI_BASE_COMPOSITOR_BEGIN_FRAME_MANAGER_H_
OLDNEW
« no previous file with comments | « ui/base/BUILD.gn ('k') | ui/base/compositor/begin_frame_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698