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

Side by Side Diff: chromecast/graphics/cast_vsync_settings.h

Issue 2801163002: Deletes NativeViewGLSurfaceEGL::Initialize(gfx::VSyncProvider). (Closed)
Patch Set: fixes DirectCompositionSurfaceTest Created 3 years, 8 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
« no previous file with comments | « chromecast/graphics/BUILD.gn ('k') | chromecast/graphics/cast_vsync_settings.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 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 CHROMECAST_GRAPHICS_CAST_VSYNC_SETTINGS_H_
6 #define CHROMECAST_GRAPHICS_CAST_VSYNC_SETTINGS_H_
7
8 #include "base/lazy_instance.h"
9 #include "base/macros.h"
10 #include "base/observer_list.h"
11 #include "base/time/time.h"
12
13 namespace chromecast {
14
15 // Provides a central place to manage VSync interval, supports observers
16 // to be notified of changes.
17 // TODO(halliwell): plumb this via Ozone or ui::Display instead.
18 class CastVSyncSettings {
19 public:
20 class Observer {
21 public:
22 virtual ~Observer() {}
23 virtual void OnVSyncIntervalChanged(base::TimeDelta interval) = 0;
24 };
25
26 static CastVSyncSettings* GetInstance();
27
28 base::TimeDelta GetVSyncInterval() const;
29 void SetVSyncInterval(base::TimeDelta interval);
30
31 void AddObserver(Observer* observer);
32 void RemoveObserver(Observer* observer);
33
34 private:
35 friend struct base::LazyInstanceTraitsBase<CastVSyncSettings>;
36
37 CastVSyncSettings();
38 ~CastVSyncSettings();
39
40 base::TimeDelta interval_;
41 base::ObserverList<Observer> observers_;
42
43 DISALLOW_COPY_AND_ASSIGN(CastVSyncSettings);
44 };
45
46 } // namespace chromecast
47
48 #endif // CHROMECAST_GRAPHICS_CAST_VSYNC_SETTINGS_H_
OLDNEW
« no previous file with comments | « chromecast/graphics/BUILD.gn ('k') | chromecast/graphics/cast_vsync_settings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698