OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_GL_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_GL_H_ |
6 #define CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_GL_H_ | 6 #define CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_GL_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <queue> | 9 #include <queue> |
10 #include <utility> | 10 #include <utility> |
(...skipping 25 matching lines...) Expand all Loading... |
36 } | 36 } |
37 | 37 |
38 namespace gpu { | 38 namespace gpu { |
39 struct MailboxHolder; | 39 struct MailboxHolder; |
40 } | 40 } |
41 | 41 |
42 namespace vr_shell { | 42 namespace vr_shell { |
43 | 43 |
44 class FPSMeter; | 44 class FPSMeter; |
45 class MailboxToSurfaceBridge; | 45 class MailboxToSurfaceBridge; |
| 46 class SlidingAverage; |
46 class UiElement; | 47 class UiElement; |
47 class UiScene; | 48 class UiScene; |
48 class VrBrowserInterface; | 49 class VrBrowserInterface; |
49 class VrController; | 50 class VrController; |
50 class VrShell; | 51 class VrShell; |
51 class VrShellRenderer; | 52 class VrShellRenderer; |
52 | 53 |
53 struct WebVrBounds { | 54 struct WebVrBounds { |
54 WebVrBounds(const gfx::RectF& left, | 55 WebVrBounds(const gfx::RectF& left, |
55 const gfx::RectF& right, | 56 const gfx::RectF& right, |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 gfx::PointF& target_local_point, | 165 gfx::PointF& target_local_point, |
165 gfx::Point3F& target_point, | 166 gfx::Point3F& target_point, |
166 float& distance_to_plane) const; | 167 float& distance_to_plane) const; |
167 void HandleControllerInput(const gfx::Vector3dF& head_direction); | 168 void HandleControllerInput(const gfx::Vector3dF& head_direction); |
168 void HandleControllerAppButtonActivity( | 169 void HandleControllerAppButtonActivity( |
169 const gfx::Vector3dF& controller_direction); | 170 const gfx::Vector3dF& controller_direction); |
170 void SendGestureToContent(std::unique_ptr<blink::WebInputEvent> event); | 171 void SendGestureToContent(std::unique_ptr<blink::WebInputEvent> event); |
171 void CreateUiSurface(); | 172 void CreateUiSurface(); |
172 void OnContentFrameAvailable(); | 173 void OnContentFrameAvailable(); |
173 void OnWebVRFrameAvailable(); | 174 void OnWebVRFrameAvailable(); |
174 bool GetPixelEncodedFrameIndex(uint16_t* frame_index); | 175 int64_t GetPredictedFrameTimeNanos(); |
175 | 176 |
176 void OnVSync(); | 177 void OnVSync(); |
177 | 178 |
178 // VRVSyncProvider | 179 // VRVSyncProvider |
179 void GetVSync(const GetVSyncCallback& callback) override; | 180 void GetVSync(const GetVSyncCallback& callback) override; |
180 | 181 |
181 void ForceExitVr(); | 182 void ForceExitVr(); |
182 | 183 |
183 void SendVSync(base::TimeDelta time, const GetVSyncCallback& callback); | 184 void SendVSync(base::TimeDelta time, const GetVSyncCallback& callback); |
184 | 185 |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 | 267 |
267 uint8_t frame_index_ = 0; | 268 uint8_t frame_index_ = 0; |
268 // Larger than frame_index_ so it can be initialized out-of-band. | 269 // Larger than frame_index_ so it can be initialized out-of-band. |
269 uint16_t last_frame_index_ = -1; | 270 uint16_t last_frame_index_ = -1; |
270 | 271 |
271 // Attributes for gesture detection while holding app button. | 272 // Attributes for gesture detection while holding app button. |
272 gfx::Vector3dF controller_start_direction_; | 273 gfx::Vector3dF controller_start_direction_; |
273 | 274 |
274 std::unique_ptr<FPSMeter> fps_meter_; | 275 std::unique_ptr<FPSMeter> fps_meter_; |
275 | 276 |
| 277 std::unique_ptr<SlidingAverage> webvr_js_time_; |
| 278 std::unique_ptr<SlidingAverage> webvr_render_time_; |
| 279 |
276 gfx::Point3F pointer_start_; | 280 gfx::Point3F pointer_start_; |
277 | 281 |
278 base::WeakPtrFactory<VrShellGl> weak_ptr_factory_; | 282 base::WeakPtrFactory<VrShellGl> weak_ptr_factory_; |
279 | 283 |
280 DISALLOW_COPY_AND_ASSIGN(VrShellGl); | 284 DISALLOW_COPY_AND_ASSIGN(VrShellGl); |
281 }; | 285 }; |
282 | 286 |
283 } // namespace vr_shell | 287 } // namespace vr_shell |
284 | 288 |
285 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_GL_H_ | 289 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_GL_H_ |
OLD | NEW |