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