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_GL_THREAD_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_VR_SHELL_VR_GL_THREAD_H_ |
6 #define CHROME_BROWSER_ANDROID_VR_SHELL_VR_GL_THREAD_H_ | 6 #define CHROME_BROWSER_ANDROID_VR_SHELL_VR_GL_THREAD_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 const base::WeakPtr<VrInputManager>& content_input_manager, | 27 const base::WeakPtr<VrInputManager>& content_input_manager, |
28 const base::WeakPtr<VrInputManager>& ui_input_manager, | 28 const base::WeakPtr<VrInputManager>& ui_input_manager, |
29 const base::WeakPtr<VrShellDelegate>& delegate_provider, | 29 const base::WeakPtr<VrShellDelegate>& delegate_provider, |
30 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner, | 30 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner, |
31 gvr_context* gvr_api, | 31 gvr_context* gvr_api, |
32 bool initially_web_vr, | 32 bool initially_web_vr, |
33 bool reprojected_rendering); | 33 bool reprojected_rendering); |
34 | 34 |
35 ~VrGLThread() override; | 35 ~VrGLThread() override; |
36 base::WeakPtr<VrShellGl> GetVrShellGl() { return weak_vr_shell_gl_; } | 36 base::WeakPtr<VrShellGl> GetVrShellGl() { return weak_vr_shell_gl_; } |
37 VrShellGl* GetVrShellGlUnsafe() { return vr_shell_gl_.get(); } | |
38 | 37 |
39 protected: | 38 protected: |
40 void Init() override; | 39 void Init() override; |
41 void CleanUp() override; | 40 void CleanUp() override; |
42 | 41 |
43 private: | 42 private: |
44 // Created on GL thread. | 43 // Created on GL thread. |
45 std::unique_ptr<VrShellGl> vr_shell_gl_; | 44 std::unique_ptr<VrShellGl> vr_shell_gl_; |
46 base::WeakPtr<VrShellGl> weak_vr_shell_gl_; | 45 base::WeakPtr<VrShellGl> weak_vr_shell_gl_; |
47 | 46 |
48 // This state is used for initializing vr_shell_gl_. | 47 // This state is used for initializing vr_shell_gl_. |
49 base::WeakPtr<VrShell> weak_vr_shell_; | 48 base::WeakPtr<VrShell> weak_vr_shell_; |
50 base::WeakPtr<VrInputManager> content_input_manager_; | 49 base::WeakPtr<VrInputManager> content_input_manager_; |
51 base::WeakPtr<VrInputManager> ui_input_manager_; | 50 base::WeakPtr<VrInputManager> ui_input_manager_; |
52 base::WeakPtr<VrShellDelegate> delegate_provider_; | 51 base::WeakPtr<VrShellDelegate> delegate_provider_; |
53 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_; | 52 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_; |
54 gvr_context* gvr_api_; | 53 gvr_context* gvr_api_; |
55 bool initially_web_vr_; | 54 bool initially_web_vr_; |
56 bool reprojected_rendering_; | 55 bool reprojected_rendering_; |
57 | 56 |
58 DISALLOW_COPY_AND_ASSIGN(VrGLThread); | 57 DISALLOW_COPY_AND_ASSIGN(VrGLThread); |
59 }; | 58 }; |
60 | 59 |
61 } // namespace vr_shell | 60 } // namespace vr_shell |
62 | 61 |
63 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_GL_THREAD_H_ | 62 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_GL_THREAD_H_ |
OLD | NEW |