| 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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 uint32_t device_id); | 109 uint32_t device_id); |
| 110 void SubmitWebVRFrame(int16_t frame_index, const gpu::MailboxHolder& mailbox); | 110 void SubmitWebVRFrame(int16_t frame_index, const gpu::MailboxHolder& mailbox); |
| 111 void SetSubmitClient( | 111 void SetSubmitClient( |
| 112 device::mojom::VRSubmitFrameClientPtrInfo submit_client_info); | 112 device::mojom::VRSubmitFrameClientPtrInfo submit_client_info); |
| 113 | 113 |
| 114 private: | 114 private: |
| 115 void GvrInit(gvr_context* gvr_api); | 115 void GvrInit(gvr_context* gvr_api); |
| 116 void InitializeRenderer(); | 116 void InitializeRenderer(); |
| 117 void DrawFrame(int16_t frame_index); | 117 void DrawFrame(int16_t frame_index); |
| 118 void DrawVrShellAndUnbind(const gvr::Mat4f& head_pose, gvr::Frame& frame); | 118 void DrawVrShellAndUnbind(const gvr::Mat4f& head_pose, gvr::Frame& frame); |
| 119 void DrawUiView(const gvr::Mat4f* head_pose, | 119 void DrawUiView(const gvr::Mat4f& head_pose, |
| 120 const std::vector<const ContentRectangle*>& elements, | 120 const std::vector<const ContentRectangle*>& elements, |
| 121 const gvr::Sizei& render_size, | 121 const gvr::Sizei& render_size, |
| 122 int viewport_offset); | 122 int viewport_offset, |
| 123 bool draw_cursor); |
| 123 void DrawElements(const gvr::Mat4f& view_proj_matrix, | 124 void DrawElements(const gvr::Mat4f& view_proj_matrix, |
| 124 const gvr::Mat4f& view_matrix, | |
| 125 const std::vector<const ContentRectangle*>& elements); | 125 const std::vector<const ContentRectangle*>& elements); |
| 126 std::vector<const ContentRectangle*> GetElementsInDrawOrder( | 126 std::vector<const ContentRectangle*> GetElementsInDrawOrder( |
| 127 const gvr::Mat4f& view_matrix, | 127 const gvr::Mat4f& view_matrix, |
| 128 const std::vector<const ContentRectangle*>& elements); | 128 const std::vector<const ContentRectangle*>& elements); |
| 129 void DrawCursor(const gvr::Mat4f& render_matrix); | 129 void DrawCursor(const gvr::Mat4f& render_matrix); |
| 130 bool ShouldDrawWebVr(); |
| 130 void DrawWebVr(); | 131 void DrawWebVr(); |
| 131 bool WebVrPoseByteIsValid(int pose_index_byte); | 132 bool WebVrPoseByteIsValid(int pose_index_byte); |
| 132 | 133 |
| 133 void UpdateController(const gvr::Vec3f& forward_vector); | 134 void UpdateController(const gvr::Vec3f& forward_vector); |
| 134 void SendEventsToTarget(InputTarget input_target, int pixel_x, int pixel_y); | 135 void SendEventsToTarget(InputTarget input_target, int pixel_x, int pixel_y); |
| 135 void SendGesture(InputTarget input_target, | 136 void SendGesture(InputTarget input_target, |
| 136 std::unique_ptr<blink::WebInputEvent> event); | 137 std::unique_ptr<blink::WebInputEvent> event); |
| 137 void CreateUiSurface(); | 138 void CreateUiSurface(); |
| 138 void OnUIFrameAvailable(); | 139 void OnUIFrameAvailable(); |
| 139 void OnContentFrameAvailable(); | 140 void OnContentFrameAvailable(); |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 uint16_t last_frame_index_ = -1; | 234 uint16_t last_frame_index_ = -1; |
| 234 | 235 |
| 235 base::WeakPtrFactory<VrShellGl> weak_ptr_factory_; | 236 base::WeakPtrFactory<VrShellGl> weak_ptr_factory_; |
| 236 | 237 |
| 237 DISALLOW_COPY_AND_ASSIGN(VrShellGl); | 238 DISALLOW_COPY_AND_ASSIGN(VrShellGl); |
| 238 }; | 239 }; |
| 239 | 240 |
| 240 } // namespace vr_shell | 241 } // namespace vr_shell |
| 241 | 242 |
| 242 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_GL_H_ | 243 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_GL_H_ |
| OLD | NEW |