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

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

Issue 2252103002: Introduce ChromeVR to Chrome on Android (behind a build flag) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add comment as suggested by Daniel Created 4 years, 4 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
« no previous file with comments | « chrome/browser/android/vr_shell/vr_shell.cc ('k') | chrome/browser/android/vr_shell/vr_shell_renderer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/vr_shell/vr_shell_renderer.h
diff --git a/chrome/browser/android/vr_shell/vr_shell_renderer.h b/chrome/browser/android/vr_shell/vr_shell_renderer.h
new file mode 100644
index 0000000000000000000000000000000000000000..540e91b1849de9ece88ef56423b7ef1c383dbb9f
--- /dev/null
+++ b/chrome/browser/android/vr_shell/vr_shell_renderer.h
@@ -0,0 +1,63 @@
+// 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_SHELL_RENDERER_H_
+#define CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_RENDERER_H_
+
+#include <memory>
+#include <string>
+#include <vector>
+
+#include "base/macros.h"
+#include "third_party/gvr-android-sdk/src/ndk-beta/include/vr/gvr/capi/include/gvr.h"
+#include "third_party/gvr-android-sdk/src/ndk-beta/include/vr/gvr/capi/include/gvr_types.h"
+
+namespace vr_shell {
+
+typedef unsigned int GLuint;
+
+enum ShaderID {
+ SHADER_UNRECOGNIZED = 0,
+ TEXTURE_QUAD_VERTEX_SHADER,
+ TEXTURE_QUAD_FRAGMENT_SHADER,
+ SHADER_ID_MAX
+};
+
+class TexturedQuadRenderer {
+ public:
+ TexturedQuadRenderer();
+ ~TexturedQuadRenderer();
+
+ // Draw the content rect in the texture quad.
+ void Draw(int texture_data_handle, const gvr::Mat4f& combined_matrix);
+
+ private:
+ GLuint vertex_shader_handle_;
+ GLuint fragment_shader_handle_;
+ GLuint program_handle_;
+ GLuint combined_matrix_handle_;
+ GLuint texture_uniform_handle_;
+ GLuint position_handle_;
+ GLuint texture_coordinate_handle_;
+
+ DISALLOW_COPY_AND_ASSIGN(TexturedQuadRenderer);
+};
+
+class VrShellRenderer {
+ public:
+ VrShellRenderer();
+ ~VrShellRenderer();
+
+ TexturedQuadRenderer* GetTexturedQuadRenderer() {
+ return textured_quad_renderer_.get();
+ }
+
+ private:
+ std::unique_ptr<TexturedQuadRenderer> textured_quad_renderer_;
+ DISALLOW_COPY_AND_ASSIGN(VrShellRenderer);
+};
+
+} // namespace vr_shell
+
+#endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_RENDERER_H_
« no previous file with comments | « chrome/browser/android/vr_shell/vr_shell.cc ('k') | chrome/browser/android/vr_shell/vr_shell_renderer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698