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> |
11 | 11 |
12 #include "base/macros.h" | 12 #include "base/macros.h" |
13 #include "ui/gfx/vsync_provider.h" | 13 #include "ui/gfx/vsync_provider.h" |
14 | 14 |
15 namespace gfx { | 15 namespace gl { |
16 | 16 |
17 // Base class for providers based on extensions like GLX_OML_sync_control and | 17 // Base class for providers based on extensions like GLX_OML_sync_control and |
18 // EGL_CHROMIUM_sync_control. | 18 // EGL_CHROMIUM_sync_control. |
19 class SyncControlVSyncProvider : public VSyncProvider { | 19 class SyncControlVSyncProvider : public gfx::VSyncProvider { |
20 public: | 20 public: |
21 SyncControlVSyncProvider(); | 21 SyncControlVSyncProvider(); |
22 ~SyncControlVSyncProvider() override; | 22 ~SyncControlVSyncProvider() override; |
23 | 23 |
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; |
(...skipping 10 matching lines...) Expand all Loading... |
40 // A short history of the last few computed intervals. | 40 // A short history of the last few computed intervals. |
41 // 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 |
42 // from configuration change (monitor reconfiguration, moving windows | 42 // from configuration change (monitor reconfiguration, moving windows |
43 // between monitors, suspend and resume, etc.). | 43 // between monitors, suspend and resume, etc.). |
44 std::queue<base::TimeDelta> last_computed_intervals_; | 44 std::queue<base::TimeDelta> last_computed_intervals_; |
45 #endif | 45 #endif |
46 | 46 |
47 DISALLOW_COPY_AND_ASSIGN(SyncControlVSyncProvider); | 47 DISALLOW_COPY_AND_ASSIGN(SyncControlVSyncProvider); |
48 }; | 48 }; |
49 | 49 |
50 } // namespace gfx | 50 } // namespace gl |
51 | 51 |
52 #endif // UI_GL_SYNC_CONTROL_VSYNC_PROVIDER_H_ | 52 #endif // UI_GL_SYNC_CONTROL_VSYNC_PROVIDER_H_ |
OLD | NEW |