| 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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 void InitializeRenderer(); | 113 void InitializeRenderer(); |
| 114 void DrawFrame(int16_t frame_index); | 114 void DrawFrame(int16_t frame_index); |
| 115 void DrawWorldElements(const vr::Mat4f& head_pose); | 115 void DrawWorldElements(const vr::Mat4f& head_pose); |
| 116 void DrawHeadLockedElements(); | 116 void DrawHeadLockedElements(); |
| 117 void DrawUiView(const vr::Mat4f& head_pose, | 117 void DrawUiView(const vr::Mat4f& head_pose, |
| 118 const std::vector<const UiElement*>& elements, | 118 const std::vector<const UiElement*>& elements, |
| 119 const gfx::Size& render_size, | 119 const gfx::Size& render_size, |
| 120 int viewport_offset, | 120 int viewport_offset, |
| 121 bool draw_cursor); | 121 bool draw_cursor); |
| 122 void DrawElements(const vr::Mat4f& view_proj_matrix, | 122 void DrawElements(const vr::Mat4f& view_proj_matrix, |
| 123 const std::vector<const UiElement*>& elements); | 123 const std::vector<const UiElement*>& elements, |
| 124 bool draw_cursor); |
| 125 void DrawElement(const vr::Mat4f& view_proj_matrix, const UiElement& element); |
| 124 std::vector<const UiElement*> GetElementsInDrawOrder( | 126 std::vector<const UiElement*> GetElementsInDrawOrder( |
| 125 const vr::Mat4f& view_matrix, | 127 const vr::Mat4f& view_matrix, |
| 126 const std::vector<const UiElement*>& elements); | 128 const std::vector<const UiElement*>& elements); |
| 127 void DrawCursor(const vr::Mat4f& render_matrix); | 129 void DrawReticle(const vr::Mat4f& view_proj_matrix); |
| 130 void DrawLaser(const vr::Mat4f& view_proj_matrix); |
| 128 void DrawController(const vr::Mat4f& view_proj_matrix); | 131 void DrawController(const vr::Mat4f& view_proj_matrix); |
| 129 bool ShouldDrawWebVr(); | 132 bool ShouldDrawWebVr(); |
| 130 void DrawWebVr(); | 133 void DrawWebVr(); |
| 131 bool WebVrPoseByteIsValid(int pose_index_byte); | 134 bool WebVrPoseByteIsValid(int pose_index_byte); |
| 132 | 135 |
| 133 void UpdateController(const gfx::Vector3dF& head_direction); | 136 void UpdateController(const gfx::Vector3dF& head_direction); |
| 134 void HandleWebVrCompatibilityClick(); | 137 void HandleWebVrCompatibilityClick(); |
| 135 void SendFlingCancel(GestureList& gesture_list); | 138 void SendFlingCancel(GestureList& gesture_list); |
| 136 void SendScrollEnd(GestureList& gesture_list); | 139 void SendScrollEnd(GestureList& gesture_list); |
| 137 bool SendScrollBegin(UiElement* target, GestureList& gesture_list); | 140 bool SendScrollBegin(UiElement* target, GestureList& gesture_list); |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 | 214 |
| 212 std::unique_ptr<VrShellRenderer> vr_shell_renderer_; | 215 std::unique_ptr<VrShellRenderer> vr_shell_renderer_; |
| 213 | 216 |
| 214 bool touch_pending_ = false; | 217 bool touch_pending_ = false; |
| 215 vr::Quatf controller_quat_; | 218 vr::Quatf controller_quat_; |
| 216 | 219 |
| 217 gfx::Point3F target_point_; | 220 gfx::Point3F target_point_; |
| 218 | 221 |
| 219 // TODO(mthiesse): We need to handle elements being removed, and update this | 222 // TODO(mthiesse): We need to handle elements being removed, and update this |
| 220 // state appropriately. | 223 // state appropriately. |
| 221 UiElement* cursor_render_target_ = nullptr; | 224 UiElement* reticle_render_target_ = nullptr; |
| 222 UiElement* hover_target_ = nullptr; | 225 UiElement* hover_target_ = nullptr; |
| 223 // TODO(mthiesse): We shouldn't have a fling target. Elements should fling | 226 // TODO(mthiesse): We shouldn't have a fling target. Elements should fling |
| 224 // independently and we should only cancel flings on the relevant element | 227 // independently and we should only cancel flings on the relevant element |
| 225 // when we do cancel flings. | 228 // when we do cancel flings. |
| 226 UiElement* fling_target_ = nullptr; | 229 UiElement* fling_target_ = nullptr; |
| 227 UiElement* input_locked_element_ = nullptr; | 230 UiElement* input_locked_element_ = nullptr; |
| 228 bool in_scroll_ = false; | 231 bool in_scroll_ = false; |
| 229 bool in_click_ = false; | 232 bool in_click_ = false; |
| 230 | 233 |
| 231 int content_tex_css_width_ = 0; | 234 int content_tex_css_width_ = 0; |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 gfx::Point3F pointer_start_; | 271 gfx::Point3F pointer_start_; |
| 269 | 272 |
| 270 base::WeakPtrFactory<VrShellGl> weak_ptr_factory_; | 273 base::WeakPtrFactory<VrShellGl> weak_ptr_factory_; |
| 271 | 274 |
| 272 DISALLOW_COPY_AND_ASSIGN(VrShellGl); | 275 DISALLOW_COPY_AND_ASSIGN(VrShellGl); |
| 273 }; | 276 }; |
| 274 | 277 |
| 275 } // namespace vr_shell | 278 } // namespace vr_shell |
| 276 | 279 |
| 277 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_GL_H_ | 280 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_GL_H_ |
| OLD | NEW |