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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 void DrawCursor(const vr::Mat4f& render_matrix); | 127 void DrawCursor(const vr::Mat4f& render_matrix); |
128 void DrawController(const vr::Mat4f& view_proj_matrix); | 128 void DrawController(const vr::Mat4f& view_proj_matrix); |
129 bool ShouldDrawWebVr(); | 129 bool ShouldDrawWebVr(); |
130 void DrawWebVr(); | 130 void DrawWebVr(); |
131 bool WebVrPoseByteIsValid(int pose_index_byte); | 131 bool WebVrPoseByteIsValid(int pose_index_byte); |
132 | 132 |
133 void UpdateController(); | 133 void UpdateController(); |
134 void HandleControllerInput(const gfx::Vector3dF& forward_vector); | 134 void HandleControllerInput(const gfx::Vector3dF& forward_vector); |
135 void HandleControllerAppButtonActivity( | 135 void HandleControllerAppButtonActivity( |
136 const gfx::Vector3dF& controller_direction); | 136 const gfx::Vector3dF& controller_direction); |
137 void SendEventsToTarget(InputTarget input_target, int pixel_x, int pixel_y); | 137 void SendInputToContent(InputTarget input_target, int pixel_x, int pixel_y); |
138 void SendGesture(InputTarget input_target, | 138 void SendInputToUiElements(UiElement* target_element); |
139 std::unique_ptr<blink::WebInputEvent> event); | 139 void SendGestureToContent(std::unique_ptr<blink::WebInputEvent> event); |
140 void CreateUiSurface(); | 140 void CreateUiSurface(); |
141 void OnContentFrameAvailable(); | 141 void OnContentFrameAvailable(); |
142 void OnWebVRFrameAvailable(); | 142 void OnWebVRFrameAvailable(); |
143 bool GetPixelEncodedFrameIndex(uint16_t* frame_index); | 143 bool GetPixelEncodedFrameIndex(uint16_t* frame_index); |
144 | 144 |
145 void OnVSync(); | 145 void OnVSync(); |
146 | 146 |
147 // VRVSyncProvider | 147 // VRVSyncProvider |
148 void GetVSync(const GetVSyncCallback& callback) override; | 148 void GetVSync(const GetVSyncCallback& callback) override; |
149 | 149 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 // Intended render_size_primary_ for use by VrShell, so that it | 183 // Intended render_size_primary_ for use by VrShell, so that it |
184 // can be restored after exiting WebVR mode. | 184 // can be restored after exiting WebVR mode. |
185 gfx::Size render_size_vrshell_; | 185 gfx::Size render_size_vrshell_; |
186 | 186 |
187 std::unique_ptr<VrShellRenderer> vr_shell_renderer_; | 187 std::unique_ptr<VrShellRenderer> vr_shell_renderer_; |
188 | 188 |
189 bool touch_pending_ = false; | 189 bool touch_pending_ = false; |
190 vr::Quatf controller_quat_; | 190 vr::Quatf controller_quat_; |
191 | 191 |
192 gfx::Point3F target_point_; | 192 gfx::Point3F target_point_; |
193 const UiElement* target_element_ = nullptr; | 193 |
| 194 // Input targeting for non-content elements. |
| 195 UiElement* target_element_ = nullptr; |
| 196 UiElement* previous_target_element_ = nullptr; |
| 197 UiElement* click_target_element_ = nullptr; |
| 198 |
| 199 // Input targeting for the content element. |
194 InputTarget current_input_target_ = InputTarget::NONE; | 200 InputTarget current_input_target_ = InputTarget::NONE; |
195 InputTarget current_scroll_target_ = InputTarget::NONE; | 201 InputTarget current_scroll_target_ = InputTarget::NONE; |
196 InputTarget current_fling_target_ = InputTarget::NONE; | 202 InputTarget current_fling_target_ = InputTarget::NONE; |
| 203 |
197 int content_tex_css_width_ = 0; | 204 int content_tex_css_width_ = 0; |
198 int content_tex_css_height_ = 0; | 205 int content_tex_css_height_ = 0; |
199 gfx::Size content_tex_physical_size_ = {0, 0}; | 206 gfx::Size content_tex_physical_size_ = {0, 0}; |
200 gfx::Size webvr_surface_size_ = {0, 0}; | 207 gfx::Size webvr_surface_size_ = {0, 0}; |
201 | 208 |
202 std::vector<vr::Mat4f> webvr_head_pose_; | 209 std::vector<vr::Mat4f> webvr_head_pose_; |
203 bool web_vr_mode_; | 210 bool web_vr_mode_; |
204 bool ready_to_draw_ = false; | 211 bool ready_to_draw_ = false; |
205 bool surfaceless_rendering_; | 212 bool surfaceless_rendering_; |
206 | 213 |
(...skipping 26 matching lines...) Expand all Loading... |
233 std::unique_ptr<FPSMeter> fps_meter_; | 240 std::unique_ptr<FPSMeter> fps_meter_; |
234 | 241 |
235 base::WeakPtrFactory<VrShellGl> weak_ptr_factory_; | 242 base::WeakPtrFactory<VrShellGl> weak_ptr_factory_; |
236 | 243 |
237 DISALLOW_COPY_AND_ASSIGN(VrShellGl); | 244 DISALLOW_COPY_AND_ASSIGN(VrShellGl); |
238 }; | 245 }; |
239 | 246 |
240 } // namespace vr_shell | 247 } // namespace vr_shell |
241 | 248 |
242 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_GL_H_ | 249 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_GL_H_ |
OLD | NEW |