| 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 const std::vector<const ContentRectangle*>& elements); | 127 const std::vector<const ContentRectangle*>& elements); |
| 128 std::vector<const ContentRectangle*> GetElementsInDrawOrder( | 128 std::vector<const ContentRectangle*> GetElementsInDrawOrder( |
| 129 const gvr::Mat4f& view_matrix, | 129 const gvr::Mat4f& view_matrix, |
| 130 const std::vector<const ContentRectangle*>& elements); | 130 const std::vector<const ContentRectangle*>& elements); |
| 131 void DrawCursor(const gvr::Mat4f& render_matrix); | 131 void DrawCursor(const gvr::Mat4f& render_matrix); |
| 132 void DrawController(const gvr::Mat4f& view_proj_matrix); | 132 void DrawController(const gvr::Mat4f& view_proj_matrix); |
| 133 bool ShouldDrawWebVr(); | 133 bool ShouldDrawWebVr(); |
| 134 void DrawWebVr(); | 134 void DrawWebVr(); |
| 135 bool WebVrPoseByteIsValid(int pose_index_byte); | 135 bool WebVrPoseByteIsValid(int pose_index_byte); |
| 136 | 136 |
| 137 void UpdateController(); | 137 void UpdateController(const gvr::Vec3f& head_direction); |
| 138 void HandleControllerInput(const gvr::Vec3f& forward_vector); | 138 void HandleControllerInput(const gvr::Vec3f& head_direction); |
| 139 void HandleControllerAppButtonActivity( | 139 void HandleControllerAppButtonActivity( |
| 140 const gvr::Vec3f& controller_direction); | 140 const gvr::Vec3f& controller_direction); |
| 141 void SendEventsToTarget(InputTarget input_target, int pixel_x, int pixel_y); | 141 void SendEventsToTarget(InputTarget input_target, int pixel_x, int pixel_y); |
| 142 void SendGesture(InputTarget input_target, | 142 void SendGesture(InputTarget input_target, |
| 143 std::unique_ptr<blink::WebInputEvent> event); | 143 std::unique_ptr<blink::WebInputEvent> event); |
| 144 void CreateUiSurface(); | 144 void CreateUiSurface(); |
| 145 void OnUIFrameAvailable(); | 145 void OnUIFrameAvailable(); |
| 146 void OnContentFrameAvailable(); | 146 void OnContentFrameAvailable(); |
| 147 void OnWebVRFrameAvailable(); | 147 void OnWebVRFrameAvailable(); |
| 148 bool GetPixelEncodedFrameIndex(uint16_t* frame_index); | 148 bool GetPixelEncodedFrameIndex(uint16_t* frame_index); |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 base::WeakPtr<VrShell> weak_vr_shell_; | 234 base::WeakPtr<VrShell> weak_vr_shell_; |
| 235 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_; | 235 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_; |
| 236 | 236 |
| 237 uint8_t frame_index_ = 0; | 237 uint8_t frame_index_ = 0; |
| 238 // Larger than frame_index_ so it can be initialized out-of-band. | 238 // Larger than frame_index_ so it can be initialized out-of-band. |
| 239 uint16_t last_frame_index_ = -1; | 239 uint16_t last_frame_index_ = -1; |
| 240 | 240 |
| 241 // Attributes for gesture detection while holding app button. | 241 // Attributes for gesture detection while holding app button. |
| 242 gvr::Vec3f controller_start_direction_; | 242 gvr::Vec3f controller_start_direction_; |
| 243 | 243 |
| 244 gvr::Vec3f pointer_start_; |
| 245 |
| 244 base::WeakPtrFactory<VrShellGl> weak_ptr_factory_; | 246 base::WeakPtrFactory<VrShellGl> weak_ptr_factory_; |
| 245 | 247 |
| 246 DISALLOW_COPY_AND_ASSIGN(VrShellGl); | 248 DISALLOW_COPY_AND_ASSIGN(VrShellGl); |
| 247 }; | 249 }; |
| 248 | 250 |
| 249 } // namespace vr_shell | 251 } // namespace vr_shell |
| 250 | 252 |
| 251 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_GL_H_ | 253 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_GL_H_ |
| OLD | NEW |