OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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_VSYNC_PROVIDER_H_ | 5 #ifndef UI_GL_VSYNC_PROVIDER_H_ |
6 #define UI_GL_VSYNC_PROVIDER_H_ | 6 #define UI_GL_VSYNC_PROVIDER_H_ |
7 | 7 |
8 #include <queue> | 8 #include <queue> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/callback.h" | 11 #include "base/callback.h" |
12 #include "base/time/time.h" | 12 #include "base/time/time.h" |
| 13 #include "ui/gl/gl_export.h" |
13 | 14 |
14 namespace gfx { | 15 namespace gfx { |
15 | 16 |
16 class VSyncProvider { | 17 class GL_EXPORT VSyncProvider { |
17 public: | 18 public: |
18 VSyncProvider(); | 19 VSyncProvider(); |
19 virtual ~VSyncProvider(); | 20 virtual ~VSyncProvider(); |
20 | 21 |
21 typedef base::Callback<void(const base::TimeTicks timebase, | 22 typedef base::Callback<void(const base::TimeTicks timebase, |
22 const base::TimeDelta interval)> | 23 const base::TimeDelta interval)> |
23 UpdateVSyncCallback; | 24 UpdateVSyncCallback; |
24 | 25 |
25 // Get the time of the most recent screen refresh, along with the time | 26 // Get the time of the most recent screen refresh, along with the time |
26 // between consecutive refreshes. The callback is called as soon as | 27 // between consecutive refreshes. The callback is called as soon as |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 // from configuration change (monitor reconfiguration, moving windows | 62 // from configuration change (monitor reconfiguration, moving windows |
62 // between monitors, suspend and resume, etc.). | 63 // between monitors, suspend and resume, etc.). |
63 std::queue<base::TimeDelta> last_computed_intervals_; | 64 std::queue<base::TimeDelta> last_computed_intervals_; |
64 | 65 |
65 DISALLOW_COPY_AND_ASSIGN(SyncControlVSyncProvider); | 66 DISALLOW_COPY_AND_ASSIGN(SyncControlVSyncProvider); |
66 }; | 67 }; |
67 | 68 |
68 } // namespace gfx | 69 } // namespace gfx |
69 | 70 |
70 #endif // UI_GL_VSYNC_PROVIDER_H_ | 71 #endif // UI_GL_VSYNC_PROVIDER_H_ |
OLD | NEW |