OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "cc/scheduler/vsync_time_source.h" | 5 #include "cc/scheduler/vsync_time_source.h" |
6 | 6 |
7 namespace cc { | 7 namespace cc { |
8 | 8 |
9 scoped_refptr<VSyncTimeSource> VSyncTimeSource::Create( | 9 scoped_refptr<VSyncTimeSource> VSyncTimeSource::Create( |
10 VSyncProvider* vsync_provider) { | 10 VSyncProvider* vsync_provider) { |
11 return make_scoped_refptr(new VSyncTimeSource(vsync_provider)); | 11 return make_scoped_refptr(new VSyncTimeSource(vsync_provider)); |
12 } | 12 } |
13 | 13 |
14 VSyncTimeSource::VSyncTimeSource(VSyncProvider* vsync_provider) | 14 VSyncTimeSource::VSyncTimeSource(VSyncProvider* vsync_provider) |
15 : active_(false), | 15 : vsync_provider_(vsync_provider) |
16 notification_requested_(false), | 16 , client_(NULL) |
17 vsync_provider_(vsync_provider), | 17 , active_(false) |
18 client_(NULL) {} | 18 , notification_requested_(false) {} |
19 | 19 |
20 VSyncTimeSource::~VSyncTimeSource() {} | 20 VSyncTimeSource::~VSyncTimeSource() {} |
21 | 21 |
22 void VSyncTimeSource::SetClient(TimeSourceClient* client) { | 22 void VSyncTimeSource::SetClient(TimeSourceClient* client) { |
23 client_ = client; | 23 client_ = client; |
24 } | 24 } |
25 | 25 |
26 void VSyncTimeSource::SetActive(bool active) { | 26 void VSyncTimeSource::SetActive(bool active) { |
27 if (active_ == active) | 27 if (active_ == active) |
28 return; | 28 return; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 notification_requested_ = false; | 60 notification_requested_ = false; |
61 vsync_provider_->RequestVSyncNotification(NULL); | 61 vsync_provider_->RequestVSyncNotification(NULL); |
62 } | 62 } |
63 return; | 63 return; |
64 } | 64 } |
65 if (client_) | 65 if (client_) |
66 client_->OnTimerTick(); | 66 client_->OnTimerTick(); |
67 } | 67 } |
68 | 68 |
69 } // namespace cc | 69 } // namespace cc |
OLD | NEW |