| 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 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 | 236 |
| 236 int content_tex_css_width_ = 0; | 237 int content_tex_css_width_ = 0; |
| 237 int content_tex_css_height_ = 0; | 238 int content_tex_css_height_ = 0; |
| 238 gfx::Size content_tex_physical_size_ = {0, 0}; | 239 gfx::Size content_tex_physical_size_ = {0, 0}; |
| 239 gfx::Size webvr_surface_size_ = {0, 0}; | 240 gfx::Size webvr_surface_size_ = {0, 0}; |
| 240 | 241 |
| 241 std::vector<vr::Mat4f> webvr_head_pose_; | 242 std::vector<vr::Mat4f> webvr_head_pose_; |
| 242 bool web_vr_mode_; | 243 bool web_vr_mode_; |
| 243 bool ready_to_draw_ = false; | 244 bool ready_to_draw_ = false; |
| 244 bool surfaceless_rendering_; | 245 bool surfaceless_rendering_; |
| 246 bool daydream_support_; |
| 245 | 247 |
| 246 std::unique_ptr<VrController> controller_; | 248 std::unique_ptr<VrController> controller_; |
| 247 | 249 |
| 248 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 250 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
| 249 base::CancelableClosure vsync_task_; | 251 base::CancelableClosure vsync_task_; |
| 250 base::TimeTicks vsync_timebase_; | 252 base::TimeTicks vsync_timebase_; |
| 251 base::TimeDelta vsync_interval_; | 253 base::TimeDelta vsync_interval_; |
| 252 | 254 |
| 253 base::TimeDelta pending_time_; | 255 base::TimeDelta pending_time_; |
| 254 bool pending_vsync_ = false; | 256 bool pending_vsync_ = false; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 273 gfx::Point3F pointer_start_; | 275 gfx::Point3F pointer_start_; |
| 274 | 276 |
| 275 base::WeakPtrFactory<VrShellGl> weak_ptr_factory_; | 277 base::WeakPtrFactory<VrShellGl> weak_ptr_factory_; |
| 276 | 278 |
| 277 DISALLOW_COPY_AND_ASSIGN(VrShellGl); | 279 DISALLOW_COPY_AND_ASSIGN(VrShellGl); |
| 278 }; | 280 }; |
| 279 | 281 |
| 280 } // namespace vr_shell | 282 } // namespace vr_shell |
| 281 | 283 |
| 282 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_GL_H_ | 284 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_GL_H_ |
| OLD | NEW |