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

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

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
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 #include "chromecast/graphics/cast_vsync_settings.h"
6
7 namespace chromecast {
8 namespace {
9 base::LazyInstance<CastVSyncSettings>::DestructorAtExit g_instance =
10 LAZY_INSTANCE_INITIALIZER;
11 } // namespace
12
13 // static
14 CastVSyncSettings* CastVSyncSettings::GetInstance() {
15 return g_instance.Pointer();
16 }
17
18 base::TimeDelta CastVSyncSettings::GetVSyncInterval() const {
19 return interval_;
20 }
21
22 void CastVSyncSettings::SetVSyncInterval(base::TimeDelta interval) {
23 if (interval_ == interval)
24 return;
25 interval_ = interval;
26 for (auto& observer : observers_)
27 observer.OnVSyncIntervalChanged(interval);
28 }
29
30 void CastVSyncSettings::AddObserver(Observer* observer) {
31 observers_.AddObserver(observer);
32 }
33
34 void CastVSyncSettings::RemoveObserver(Observer* observer) {
35 observers_.RemoveObserver(observer);
36 }
37
38 // Default to 60fps until set otherwise
39 CastVSyncSettings::CastVSyncSettings()
40 : interval_(base::TimeDelta::FromMicroseconds(16666)) {}
41
42 CastVSyncSettings::~CastVSyncSettings() = default;
43
44 } // namespace chromecast
OLDNEW
« no previous file with comments | « chromecast/graphics/cast_vsync_settings.h ('k') | chromecast/graphics/cast_window_manager_aura.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698