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

Unified Diff: chrome/browser/android/vr_shell/vr_gl_thread.h

Issue 2624633002: Remove Sync GetPose VRService call, implement VRVSyncProvider (Closed)
Patch Set: oops Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
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..0fcb7546f07323a557946e6c81e1722fd66c65bc
--- /dev/null
+++ b/chrome/browser/android/vr_shell/vr_gl_thread.h
@@ -0,0 +1,58 @@
+// 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 VrShell;
+class VrShellDelegate;
+class VrShellGl;
+
+class VrGLThread : public base::Thread {
+ public:
+ VrGLThread(
+ const base::WeakPtr<VrShell>& weak_vr_shell,
+ 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);
+
+ ~VrGLThread() override;
+ 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_;
+
+ // This state is used for initializing vr_shell_gl_.
+ base::WeakPtr<VrShell> weak_vr_shell_;
+ 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_
« no previous file with comments | « chrome/browser/android/vr_shell/non_presenting_gvr_delegate.cc ('k') | chrome/browser/android/vr_shell/vr_gl_thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698