| 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 | 9 |
| 10 #include "base/cancelable_callback.h" | 10 #include "base/cancelable_callback.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 class GLContext; | 29 class GLContext; |
| 30 class GLSurface; | 30 class GLSurface; |
| 31 class ScopedJavaSurface; | 31 class ScopedJavaSurface; |
| 32 class SurfaceTexture; | 32 class SurfaceTexture; |
| 33 } | 33 } |
| 34 | 34 |
| 35 namespace vr_shell { | 35 namespace vr_shell { |
| 36 | 36 |
| 37 class UiScene; | 37 class UiScene; |
| 38 class VrController; | 38 class VrController; |
| 39 class VrInputManager; | |
| 40 class VrShell; | 39 class VrShell; |
| 41 class VrShellRenderer; | 40 class VrShellRenderer; |
| 42 struct ContentRectangle; | 41 struct ContentRectangle; |
| 43 | 42 |
| 44 // This class manages all GLThread owned objects and GL rendering for VrShell. | 43 // This class manages all GLThread owned objects and GL rendering for VrShell. |
| 45 // It is not threadsafe and must only be used on the GL thread. | 44 // It is not threadsafe and must only be used on the GL thread. |
| 46 class VrShellGl { | 45 class VrShellGl { |
| 47 public: | 46 public: |
| 48 enum class InputTarget { | 47 enum class InputTarget { |
| 49 NONE = 0, | 48 NONE = 0, |
| 50 CONTENT, | 49 CONTENT, |
| 51 UI | 50 UI |
| 52 }; | 51 }; |
| 53 | 52 |
| 54 VrShellGl( | 53 VrShellGl( |
| 55 const base::WeakPtr<VrShell>& weak_vr_shell, | 54 const base::WeakPtr<VrShell>& weak_vr_shell, |
| 56 const base::WeakPtr<VrInputManager>& content_input_manager, | |
| 57 const base::WeakPtr<VrInputManager>& ui_input_manager, | |
| 58 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner, | 55 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner, |
| 59 gvr_context* gvr_api, | 56 gvr_context* gvr_api, |
| 60 bool initially_web_vr, | 57 bool initially_web_vr, |
| 61 bool reprojected_rendering); | 58 bool reprojected_rendering); |
| 62 ~VrShellGl(); | 59 ~VrShellGl(); |
| 63 | 60 |
| 64 void Initialize(); | 61 void Initialize(); |
| 65 void InitializeGl(gfx::AcceleratedWidget window); | 62 void InitializeGl(gfx::AcceleratedWidget window); |
| 66 | 63 |
| 67 void DrawFrame(); | 64 void DrawFrame(); |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 bool surfaceless_rendering_; | 165 bool surfaceless_rendering_; |
| 169 | 166 |
| 170 std::unique_ptr<VrController> controller_; | 167 std::unique_ptr<VrController> controller_; |
| 171 | 168 |
| 172 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 169 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
| 173 base::CancelableClosure draw_task_; | 170 base::CancelableClosure draw_task_; |
| 174 base::TimeTicks vsync_timebase_; | 171 base::TimeTicks vsync_timebase_; |
| 175 base::TimeDelta vsync_interval_; | 172 base::TimeDelta vsync_interval_; |
| 176 | 173 |
| 177 base::WeakPtr<VrShell> weak_vr_shell_; | 174 base::WeakPtr<VrShell> weak_vr_shell_; |
| 178 base::WeakPtr<VrInputManager> content_input_manager_; | |
| 179 base::WeakPtr<VrInputManager> ui_input_manager_; | |
| 180 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_; | 175 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_; |
| 181 | 176 |
| 182 base::WeakPtrFactory<VrShellGl> weak_ptr_factory_; | 177 base::WeakPtrFactory<VrShellGl> weak_ptr_factory_; |
| 183 | 178 |
| 184 DISALLOW_COPY_AND_ASSIGN(VrShellGl); | 179 DISALLOW_COPY_AND_ASSIGN(VrShellGl); |
| 185 }; | 180 }; |
| 186 | 181 |
| 187 } // namespace vr_shell | 182 } // namespace vr_shell |
| 188 | 183 |
| 189 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_GL_H_ | 184 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_GL_H_ |
| OLD | NEW |