OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_RENDERER_H_ |
| 6 #define CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_RENDERER_H_ |
| 7 |
| 8 #include <memory> |
| 9 #include <string> |
| 10 #include <vector> |
| 11 |
| 12 #include "base/macros.h" |
| 13 #include "third_party/gvr-android-sdk/src/ndk-beta/include/vr/gvr/capi/include/g
vr.h" |
| 14 #include "third_party/gvr-android-sdk/src/ndk-beta/include/vr/gvr/capi/include/g
vr_types.h" |
| 15 |
| 16 namespace vr_shell { |
| 17 |
| 18 typedef unsigned int GLuint; |
| 19 |
| 20 enum ShaderID { |
| 21 SHADER_UNRECOGNIZED = 0, |
| 22 TEXTURE_QUAD_VERTEX_SHADER, |
| 23 TEXTURE_QUAD_FRAGMENT_SHADER, |
| 24 SHADER_ID_MAX |
| 25 }; |
| 26 |
| 27 class TexturedQuadRenderer { |
| 28 public: |
| 29 TexturedQuadRenderer(); |
| 30 ~TexturedQuadRenderer(); |
| 31 |
| 32 // Draw the content rect in the texture quad. |
| 33 void Draw(int texture_data_handle, const gvr::Mat4f& combined_matrix); |
| 34 |
| 35 private: |
| 36 GLuint vertex_shader_handle_; |
| 37 GLuint fragment_shader_handle_; |
| 38 GLuint program_handle_; |
| 39 GLuint combined_matrix_handle_; |
| 40 GLuint texture_uniform_handle_; |
| 41 GLuint position_handle_; |
| 42 GLuint texture_coordinate_handle_; |
| 43 |
| 44 DISALLOW_COPY_AND_ASSIGN(TexturedQuadRenderer); |
| 45 }; |
| 46 |
| 47 class VrShellRenderer { |
| 48 public: |
| 49 VrShellRenderer(); |
| 50 ~VrShellRenderer(); |
| 51 |
| 52 TexturedQuadRenderer* GetTexturedQuadRenderer() { |
| 53 return textured_quad_renderer_.get(); |
| 54 } |
| 55 |
| 56 private: |
| 57 std::unique_ptr<TexturedQuadRenderer> textured_quad_renderer_; |
| 58 DISALLOW_COPY_AND_ASSIGN(VrShellRenderer); |
| 59 }; |
| 60 |
| 61 } // namespace vr_shell |
| 62 |
| 63 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_RENDERER_H_ |
OLD | NEW |