Chromium Code Reviews| Index: chrome/browser/android/vr_shell/vr_gl_thread.h |
| diff --git a/chrome/browser/android/vr_shell/vr_gl_thread.h b/chrome/browser/android/vr_shell/vr_gl_thread.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..b300813f02e9b3963b207825c86cdb5482cf147e |
| --- /dev/null |
| +++ b/chrome/browser/android/vr_shell/vr_gl_thread.h |
| @@ -0,0 +1,62 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROME_BROWSER_ANDROID_VR_SHELL_VR_GL_THREAD_H_ |
| +#define CHROME_BROWSER_ANDROID_VR_SHELL_VR_GL_THREAD_H_ |
| + |
| +#include <memory> |
| + |
| +#include "base/macros.h" |
| +#include "base/memory/weak_ptr.h" |
| +#include "base/single_thread_task_runner.h" |
| +#include "base/threading/thread.h" |
| +#include "third_party/gvr-android-sdk/src/libraries/headers/vr/gvr/capi/include/gvr_types.h" |
| + |
| +namespace vr_shell { |
| + |
| +class VrInputManager; |
| +class VrShell; |
| +class VrShellDelegate; |
| +class VrShellGl; |
| + |
| +class VrGLThread : public base::Thread { |
| + public: |
| + VrGLThread( |
| + const base::WeakPtr<VrShell>& weak_vr_shell, |
| + const base::WeakPtr<VrInputManager>& content_input_manager, |
| + const base::WeakPtr<VrInputManager>& ui_input_manager, |
| + const base::WeakPtr<VrShellDelegate>& delegate_provider, |
| + scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner, |
| + gvr_context* gvr_api, |
| + bool initially_web_vr, |
| + bool reprojected_rendering); |
| + |
| + virtual ~VrGLThread(); |
| + base::WeakPtr<VrShellGl> GetVrShellGl() { return weak_vr_shell_gl_; } |
| + VrShellGl* GetVrShellGlUnsafe() { return vr_shell_gl_.get(); } |
| + |
| + protected: |
| + void Init() override; |
| + void CleanUp() override; |
| + |
| + private: |
| + // Created on GL thread. |
| + std::unique_ptr<VrShellGl> vr_shell_gl_; |
| + base::WeakPtr<VrShellGl> weak_vr_shell_gl_; |
| + |
| + 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.
|
| + base::WeakPtr<VrInputManager> content_input_manager_; |
| + base::WeakPtr<VrInputManager> ui_input_manager_; |
| + base::WeakPtr<VrShellDelegate> delegate_provider_; |
| + scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_; |
| + gvr_context* gvr_api_; |
| + bool initially_web_vr_; |
| + bool reprojected_rendering_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(VrGLThread); |
| +}; |
| + |
| +} // namespace vr_shell |
| + |
| +#endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_GL_THREAD_H_ |