| 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 }; | 61 }; |
| 62 | 62 |
| 63 // This class manages all GLThread owned objects and GL rendering for VrShell. | 63 // This class manages all GLThread owned objects and GL rendering for VrShell. |
| 64 // It is not threadsafe and must only be used on the GL thread. | 64 // It is not threadsafe and must only be used on the GL thread. |
| 65 class VrShellGl : public device::mojom::VRVSyncProvider { | 65 class VrShellGl : public device::mojom::VRVSyncProvider { |
| 66 public: | 66 public: |
| 67 VrShellGl(VrBrowserInterface* browser, | 67 VrShellGl(VrBrowserInterface* browser, |
| 68 gvr_context* gvr_api, | 68 gvr_context* gvr_api, |
| 69 bool initially_web_vr, | 69 bool initially_web_vr, |
| 70 bool reprojected_rendering, | 70 bool reprojected_rendering, |
| 71 bool daydream_support, |
| 71 UiScene* scene); | 72 UiScene* scene); |
| 72 ~VrShellGl() override; | 73 ~VrShellGl() override; |
| 73 | 74 |
| 74 void Initialize(); | 75 void Initialize(); |
| 75 void InitializeGl(gfx::AcceleratedWidget window); | 76 void InitializeGl(gfx::AcceleratedWidget window); |
| 76 | 77 |
| 77 void OnTriggerEvent(); | 78 void OnTriggerEvent(); |
| 78 void OnPause(); | 79 void OnPause(); |
| 79 void OnResume(); | 80 void OnResume(); |
| 80 | 81 |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 | 234 |
| 234 int content_tex_css_width_ = 0; | 235 int content_tex_css_width_ = 0; |
| 235 int content_tex_css_height_ = 0; | 236 int content_tex_css_height_ = 0; |
| 236 gfx::Size content_tex_physical_size_ = {0, 0}; | 237 gfx::Size content_tex_physical_size_ = {0, 0}; |
| 237 gfx::Size webvr_surface_size_ = {0, 0}; | 238 gfx::Size webvr_surface_size_ = {0, 0}; |
| 238 | 239 |
| 239 std::vector<vr::Mat4f> webvr_head_pose_; | 240 std::vector<vr::Mat4f> webvr_head_pose_; |
| 240 bool web_vr_mode_; | 241 bool web_vr_mode_; |
| 241 bool ready_to_draw_ = false; | 242 bool ready_to_draw_ = false; |
| 242 bool surfaceless_rendering_; | 243 bool surfaceless_rendering_; |
| 244 bool daydream_support_; |
| 243 | 245 |
| 244 std::unique_ptr<VrController> controller_; | 246 std::unique_ptr<VrController> controller_; |
| 245 | 247 |
| 246 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 248 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
| 247 base::CancelableClosure vsync_task_; | 249 base::CancelableClosure vsync_task_; |
| 248 base::TimeTicks vsync_timebase_; | 250 base::TimeTicks vsync_timebase_; |
| 249 base::TimeDelta vsync_interval_; | 251 base::TimeDelta vsync_interval_; |
| 250 | 252 |
| 251 base::TimeDelta pending_time_; | 253 base::TimeDelta pending_time_; |
| 252 bool pending_vsync_ = false; | 254 bool pending_vsync_ = false; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 271 gfx::Point3F pointer_start_; | 273 gfx::Point3F pointer_start_; |
| 272 | 274 |
| 273 base::WeakPtrFactory<VrShellGl> weak_ptr_factory_; | 275 base::WeakPtrFactory<VrShellGl> weak_ptr_factory_; |
| 274 | 276 |
| 275 DISALLOW_COPY_AND_ASSIGN(VrShellGl); | 277 DISALLOW_COPY_AND_ASSIGN(VrShellGl); |
| 276 }; | 278 }; |
| 277 | 279 |
| 278 } // namespace vr_shell | 280 } // namespace vr_shell |
| 279 | 281 |
| 280 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_GL_H_ | 282 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_GL_H_ |
| OLD | NEW |