Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(114)

Side by Side Diff: chrome/browser/android/vr_shell/vr_gl_thread.h

Issue 2861003003: VR: Enable browsing for CCT and make ui_scene_manager aware of whether we're in CCT. (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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"
11 #include "base/memory/weak_ptr.h" 11 #include "base/memory/weak_ptr.h"
12 #include "base/single_thread_task_runner.h" 12 #include "base/single_thread_task_runner.h"
13 #include "base/threading/thread.h" 13 #include "base/threading/thread.h"
14 #include "third_party/gvr-android-sdk/src/libraries/headers/vr/gvr/capi/include/ gvr_types.h" 14 #include "third_party/gvr-android-sdk/src/libraries/headers/vr/gvr/capi/include/ gvr_types.h"
15 15
16 namespace vr_shell { 16 namespace vr_shell {
17 17
18 class UiScene; 18 class UiScene;
19 class UiSceneManager; 19 class UiSceneManager;
20 class VrShell; 20 class VrShell;
21 class VrShellGl; 21 class VrShellGl;
22 22
23 class VrGLThread : public base::Thread { 23 class VrGLThread : public base::Thread {
24 public: 24 public:
25 VrGLThread( 25 VrGLThread(
26 const base::WeakPtr<VrShell>& weak_vr_shell, 26 const base::WeakPtr<VrShell>& weak_vr_shell,
27 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner, 27 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner,
28 gvr_context* gvr_api, 28 gvr_context* gvr_api,
29 bool initially_web_vr, 29 bool initially_web_vr,
30 bool in_cct,
30 bool reprojected_rendering); 31 bool reprojected_rendering);
31 32
32 ~VrGLThread() override; 33 ~VrGLThread() override;
33 base::WeakPtr<VrShellGl> GetVrShellGl() { return weak_vr_shell_gl_; } 34 base::WeakPtr<VrShellGl> GetVrShellGl() { return weak_vr_shell_gl_; }
34 base::WeakPtr<UiSceneManager> GetSceneManager() { 35 base::WeakPtr<UiSceneManager> GetSceneManager() {
35 return weak_scene_manager_; 36 return weak_scene_manager_;
36 } 37 }
37 38
38 protected: 39 protected:
39 void Init() override; 40 void Init() override;
40 void CleanUp() override; 41 void CleanUp() override;
41 42
42 private: 43 private:
43 // Created on GL thread. 44 // Created on GL thread.
44 std::unique_ptr<UiScene> scene_; 45 std::unique_ptr<UiScene> scene_;
45 std::unique_ptr<UiSceneManager> scene_manager_; 46 std::unique_ptr<UiSceneManager> scene_manager_;
46 base::WeakPtr<UiSceneManager> weak_scene_manager_; 47 base::WeakPtr<UiSceneManager> weak_scene_manager_;
47 std::unique_ptr<VrShellGl> vr_shell_gl_; 48 std::unique_ptr<VrShellGl> vr_shell_gl_;
48 base::WeakPtr<VrShellGl> weak_vr_shell_gl_; 49 base::WeakPtr<VrShellGl> weak_vr_shell_gl_;
49 50
50 // This state is used for initializing vr_shell_gl_. 51 // This state is used for initializing vr_shell_gl_.
51 base::WeakPtr<VrShell> weak_vr_shell_; 52 base::WeakPtr<VrShell> weak_vr_shell_;
52 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_; 53 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_;
53 gvr_context* gvr_api_; 54 gvr_context* gvr_api_;
54 bool initially_web_vr_; 55 bool initially_web_vr_;
56 bool in_cct_;
55 bool reprojected_rendering_; 57 bool reprojected_rendering_;
56 58
57 DISALLOW_COPY_AND_ASSIGN(VrGLThread); 59 DISALLOW_COPY_AND_ASSIGN(VrGLThread);
58 }; 60 };
59 61
60 } // namespace vr_shell 62 } // namespace vr_shell
61 63
62 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_GL_THREAD_H_ 64 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_GL_THREAD_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698