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

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: 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
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..5eed5f8fe435cc78a0a469cfa8b9ff4187a9a967
--- /dev/null
+++ b/chrome/browser/android/vr_shell/vr_shell_renderer.h
@@ -0,0 +1,55 @@
+// 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 "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"
+#include "ui/gl/gl_bindings.h"
+#include "ui/gl/gl_export.h"
+
+namespace vr_shell {
+
+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_

Powered by Google App Engine
This is Rietveld 408576698