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 #ifndef UI_GL_SYNC_CONTROL_VSYNC_PROVIDER_H_ | 5 #ifndef UI_GL_SYNC_CONTROL_VSYNC_PROVIDER_H_ |
6 #define UI_GL_SYNC_CONTROL_VSYNC_PROVIDER_H_ | 6 #define UI_GL_SYNC_CONTROL_VSYNC_PROVIDER_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <queue> | 10 #include <queue> |
(...skipping 13 matching lines...) Expand all Loading... |
24 void GetVSyncParameters(const UpdateVSyncCallback& callback) override; | 24 void GetVSyncParameters(const UpdateVSyncCallback& callback) override; |
25 | 25 |
26 protected: | 26 protected: |
27 virtual bool GetSyncValues(int64_t* system_time, | 27 virtual bool GetSyncValues(int64_t* system_time, |
28 int64_t* media_stream_counter, | 28 int64_t* media_stream_counter, |
29 int64_t* swap_buffer_counter) = 0; | 29 int64_t* swap_buffer_counter) = 0; |
30 | 30 |
31 virtual bool GetMscRate(int32_t* numerator, int32_t* denominator) = 0; | 31 virtual bool GetMscRate(int32_t* numerator, int32_t* denominator) = 0; |
32 | 32 |
33 private: | 33 private: |
| 34 #if defined(OS_LINUX) |
34 base::TimeTicks last_timebase_; | 35 base::TimeTicks last_timebase_; |
35 uint64_t last_media_stream_counter_; | 36 uint64_t last_media_stream_counter_ = 0; |
36 base::TimeDelta last_good_interval_; | 37 base::TimeDelta last_good_interval_; |
37 bool invalid_msc_; | 38 bool invalid_msc_ = false; |
38 | 39 |
39 // A short history of the last few computed intervals. | 40 // A short history of the last few computed intervals. |
40 // We use this to filter out the noise in the computation resulting | 41 // We use this to filter out the noise in the computation resulting |
41 // from configuration change (monitor reconfiguration, moving windows | 42 // from configuration change (monitor reconfiguration, moving windows |
42 // between monitors, suspend and resume, etc.). | 43 // between monitors, suspend and resume, etc.). |
43 std::queue<base::TimeDelta> last_computed_intervals_; | 44 std::queue<base::TimeDelta> last_computed_intervals_; |
| 45 #endif |
44 | 46 |
45 DISALLOW_COPY_AND_ASSIGN(SyncControlVSyncProvider); | 47 DISALLOW_COPY_AND_ASSIGN(SyncControlVSyncProvider); |
46 }; | 48 }; |
47 | 49 |
48 } // namespace gfx | 50 } // namespace gfx |
49 | 51 |
50 #endif // UI_GL_SYNC_CONTROL_VSYNC_PROVIDER_H_ | 52 #endif // UI_GL_SYNC_CONTROL_VSYNC_PROVIDER_H_ |
OLD | NEW |