Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_ANDROID_VR_SHELL_VR_GL_THREAD_H_ | |
| 6 #define CHROME_BROWSER_ANDROID_VR_SHELL_VR_GL_THREAD_H_ | |
| 7 | |
| 8 #include <memory> | |
| 9 | |
| 10 #include "base/macros.h" | |
| 11 #include "base/memory/weak_ptr.h" | |
| 12 #include "base/single_thread_task_runner.h" | |
| 13 #include "base/threading/thread.h" | |
| 14 #include "third_party/gvr-android-sdk/src/libraries/headers/vr/gvr/capi/include/ gvr_types.h" | |
| 15 | |
| 16 namespace vr_shell { | |
| 17 | |
| 18 class VrInputManager; | |
| 19 class VrShell; | |
| 20 class VrShellDelegate; | |
| 21 class VrShellGl; | |
| 22 | |
| 23 class VrGLThread : public base::Thread { | |
| 24 public: | |
| 25 VrGLThread( | |
| 26 const base::WeakPtr<VrShell>& weak_vr_shell, | |
| 27 const base::WeakPtr<VrInputManager>& content_input_manager, | |
| 28 const base::WeakPtr<VrInputManager>& ui_input_manager, | |
| 29 const base::WeakPtr<VrShellDelegate>& delegate_provider, | |
| 30 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner, | |
| 31 gvr_context* gvr_api, | |
| 32 bool initially_web_vr, | |
| 33 bool reprojected_rendering); | |
| 34 | |
| 35 virtual ~VrGLThread(); | |
| 36 base::WeakPtr<VrShellGl> GetVrShellGl() { return weak_vr_shell_gl_; } | |
| 37 VrShellGl* GetVrShellGlUnsafe() { return vr_shell_gl_.get(); } | |
| 38 | |
| 39 protected: | |
| 40 void Init() override; | |
| 41 void CleanUp() override; | |
| 42 | |
| 43 private: | |
| 44 // Created on GL thread. | |
| 45 std::unique_ptr<VrShellGl> vr_shell_gl_; | |
| 46 base::WeakPtr<VrShellGl> weak_vr_shell_gl_; | |
| 47 | |
| 48 base::WeakPtr<VrShell> weak_vr_shell_; | |
|
dcheng
2017/01/18 23:46:06
Nit: maybe note that this state is used for initia
mthiesse
2017/01/19 00:19:05
Done.
| |
| 49 base::WeakPtr<VrInputManager> content_input_manager_; | |
| 50 base::WeakPtr<VrInputManager> ui_input_manager_; | |
| 51 base::WeakPtr<VrShellDelegate> delegate_provider_; | |
| 52 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_; | |
| 53 gvr_context* gvr_api_; | |
| 54 bool initially_web_vr_; | |
| 55 bool reprojected_rendering_; | |
| 56 | |
| 57 DISALLOW_COPY_AND_ASSIGN(VrGLThread); | |
| 58 }; | |
| 59 | |
| 60 } // namespace vr_shell | |
| 61 | |
| 62 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_GL_THREAD_H_ | |
| OLD | NEW |