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 | 10 |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 void SetWebVrMode(bool enabled); | 73 void SetWebVrMode(bool enabled); |
74 void ContentBoundsChanged(int width, int height); | 74 void ContentBoundsChanged(int width, int height); |
75 void ContentPhysicalBoundsChanged(int width, int height); | 75 void ContentPhysicalBoundsChanged(int width, int height); |
76 void UIBoundsChanged(int width, int height); | 76 void UIBoundsChanged(int width, int height); |
77 void UIPhysicalBoundsChanged(int width, int height); | 77 void UIPhysicalBoundsChanged(int width, int height); |
78 base::WeakPtr<VrShellGl> GetWeakPtr(); | 78 base::WeakPtr<VrShellGl> GetWeakPtr(); |
79 | 79 |
80 void UpdateWebVRTextureBounds(int16_t frame_index, | 80 void UpdateWebVRTextureBounds(int16_t frame_index, |
81 const gvr::Rectf& left_bounds, | 81 const gvr::Rectf& left_bounds, |
82 const gvr::Rectf& right_bounds); | 82 const gvr::Rectf& right_bounds); |
83 gvr::GvrApi* gvr_api(); | |
84 void SetGvrPoseForWebVr(const gvr::Mat4f& pose, uint32_t pose_num); | 83 void SetGvrPoseForWebVr(const gvr::Mat4f& pose, uint32_t pose_num); |
85 gvr::Sizei GetWebVRCompositorSurfaceSize(); | 84 gvr::Sizei GetWebVRCompositorSurfaceSize(); |
86 | 85 |
87 void UpdateScene(std::unique_ptr<base::ListValue> commands); | 86 void UpdateScene(std::unique_ptr<base::ListValue> commands); |
88 | 87 |
89 void UpdateVSyncInterval(long timebase_nanos, double interval_seconds); | 88 void UpdateVSyncInterval(long timebase_nanos, double interval_seconds); |
90 | 89 |
91 void OnRequest(device::mojom::VRVSyncProviderRequest request); | 90 void OnRequest(device::mojom::VRVSyncProviderRequest request); |
| 91 void ResetPose(); |
| 92 void CreateVRDisplayInfo( |
| 93 const base::Callback<void(device::mojom::VRDisplayInfoPtr)>& callback, |
| 94 uint32_t device_id); |
92 | 95 |
93 private: | 96 private: |
94 void GvrInit(gvr_context* gvr_api); | 97 void GvrInit(gvr_context* gvr_api); |
95 void InitializeRenderer(); | 98 void InitializeRenderer(); |
96 void DrawFrame(); | 99 void DrawFrame(); |
97 void DrawVrShell(const gvr::Mat4f& head_pose, gvr::Frame &frame); | 100 void DrawVrShell(const gvr::Mat4f& head_pose, gvr::Frame &frame); |
98 void DrawUiView(const gvr::Mat4f* head_pose, | 101 void DrawUiView(const gvr::Mat4f* head_pose, |
99 const std::vector<const ContentRectangle*>& elements, | 102 const std::vector<const ContentRectangle*>& elements, |
100 const gvr::Sizei& render_size, int viewport_offset); | 103 const gvr::Sizei& render_size, int viewport_offset); |
101 void DrawElements(const gvr::Mat4f& render_matrix, | 104 void DrawElements(const gvr::Mat4f& render_matrix, |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 uint16_t last_frame_index_ = -1; | 200 uint16_t last_frame_index_ = -1; |
198 | 201 |
199 base::WeakPtrFactory<VrShellGl> weak_ptr_factory_; | 202 base::WeakPtrFactory<VrShellGl> weak_ptr_factory_; |
200 | 203 |
201 DISALLOW_COPY_AND_ASSIGN(VrShellGl); | 204 DISALLOW_COPY_AND_ASSIGN(VrShellGl); |
202 }; | 205 }; |
203 | 206 |
204 } // namespace vr_shell | 207 } // namespace vr_shell |
205 | 208 |
206 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_GL_H_ | 209 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_GL_H_ |
OLD | NEW |