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

Side by Side Diff: ui/compositor/compositor_vsync_manager.cc

Issue 1040813002: Revert of Enable BeginFrame scheduling on aura (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 | « ui/compositor/compositor_vsync_manager.h ('k') | no next file » | 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 #include "ui/compositor/compositor_vsync_manager.h"
6
7 namespace ui {
8
9 CompositorVSyncManager::CompositorVSyncManager()
10 : authoritative_vsync_interval_(base::TimeDelta::FromSeconds(0)) {
11 }
12
13 CompositorVSyncManager::~CompositorVSyncManager() {}
14
15 void CompositorVSyncManager::SetAuthoritativeVSyncInterval(
16 base::TimeDelta interval) {
17 authoritative_vsync_interval_ = interval;
18 last_interval_ = interval;
19 NotifyObservers(last_timebase_, last_interval_);
20 }
21
22 void CompositorVSyncManager::UpdateVSyncParameters(base::TimeTicks timebase,
23 base::TimeDelta interval) {
24 if (authoritative_vsync_interval_ != base::TimeDelta::FromSeconds(0))
25 interval = authoritative_vsync_interval_;
26 last_timebase_ = timebase;
27 last_interval_ = interval;
28 NotifyObservers(timebase, interval);
29 }
30
31 void CompositorVSyncManager::AddObserver(Observer* observer) {
32 observer_list_.AddObserver(observer);
33 observer->OnUpdateVSyncParameters(last_timebase_, last_interval_);
34 }
35
36 void CompositorVSyncManager::RemoveObserver(Observer* observer) {
37 observer_list_.RemoveObserver(observer);
38 }
39
40 void CompositorVSyncManager::NotifyObservers(base::TimeTicks timebase,
41 base::TimeDelta interval) {
42 FOR_EACH_OBSERVER(CompositorVSyncManager::Observer, observer_list_,
43 OnUpdateVSyncParameters(timebase, interval));
44 }
45
46 } // namespace ui
OLDNEW
« no previous file with comments | « ui/compositor/compositor_vsync_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698