OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_SURFACE_ACCELERATED_SURFACE_WIN_H_ | 5 #ifndef UI_SURFACE_ACCELERATED_SURFACE_WIN_H_ |
6 #define UI_SURFACE_ACCELERATED_SURFACE_WIN_H_ | 6 #define UI_SURFACE_ACCELERATED_SURFACE_WIN_H_ |
7 | 7 |
8 #include <d3d9.h> | 8 #include <d3d9.h> |
9 | 9 |
10 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
64 // presenter has affinity. | 64 // presenter has affinity. |
65 void DoPresentAndAcknowledge( | 65 void DoPresentAndAcknowledge( |
66 const gfx::Size& size, | 66 const gfx::Size& size, |
67 int64 surface_handle, | 67 int64 surface_handle, |
68 const base::Callback<void(bool)>& completion_task); | 68 const base::Callback<void(bool)>& completion_task); |
69 void DoSuspend(); | 69 void DoSuspend(); |
70 void DoPresent(HDC dc, bool* presented); | 70 void DoPresent(HDC dc, bool* presented); |
71 bool DoRealPresent(HDC dc); | 71 bool DoRealPresent(HDC dc); |
72 void DoReleaseSurface(); | 72 void DoReleaseSurface(); |
73 | 73 |
74 // This gets the timestamp and period of the display's last vsync. | |
75 // The period is represented as a ratio which, when divided, will give you | |
76 // the interval in seconds. | |
77 void GetPresentationStats(base::TimeTicks *timebase, | |
jbates
2012/07/30 18:37:51
- comments should explicitly say how to calculate
jbates
2012/07/30 19:27:00
Err, except in reverse since you already swap them
brianderson
2012/07/30 19:38:13
Yeah, I just swapped them in a recent commit. Wil
| |
78 uint32 *interval_numerator, | |
79 uint32 *interval_denominator); | |
80 | |
74 // The thread with which this presenter has affinity. | 81 // The thread with which this presenter has affinity. |
75 PresentThread* const present_thread_; | 82 PresentThread* const present_thread_; |
76 | 83 |
77 // The window that is presented to. | 84 // The window that is presented to. |
78 gfx::NativeWindow window_; | 85 gfx::NativeWindow window_; |
79 | 86 |
80 // The lock is taken while any thread is calling the object, except those that | 87 // The lock is taken while any thread is calling the object, except those that |
81 // simply post from the main thread to the present thread via the immutable | 88 // simply post from the main thread to the present thread via the immutable |
82 // present_thread_ member. | 89 // present_thread_ member. |
83 base::Lock lock_; | 90 base::Lock lock_; |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
128 | 135 |
129 // Indicates that the surface has become invisible. | 136 // Indicates that the surface has become invisible. |
130 void WasHidden(); | 137 void WasHidden(); |
131 | 138 |
132 private: | 139 private: |
133 const scoped_refptr<AcceleratedPresenter> presenter_; | 140 const scoped_refptr<AcceleratedPresenter> presenter_; |
134 DISALLOW_COPY_AND_ASSIGN(AcceleratedSurface); | 141 DISALLOW_COPY_AND_ASSIGN(AcceleratedSurface); |
135 }; | 142 }; |
136 | 143 |
137 #endif // UI_SURFACE_ACCELERATED_SURFACE_WIN_H_ | 144 #endif // UI_SURFACE_ACCELERATED_SURFACE_WIN_H_ |
OLD | NEW |