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 "third_party/gvr-android-sdk/src/ndk-beta/include/vr/gvr/capi/include/g
vr.h" |
| 13 #include "third_party/gvr-android-sdk/src/ndk-beta/include/vr/gvr/capi/include/g
vr_types.h" |
| 14 #include "ui/gl/gl_bindings.h" |
| 15 #include "ui/gl/gl_export.h" |
| 16 |
| 17 namespace vr_shell { |
| 18 |
| 19 class TexturedQuadRenderer { |
| 20 public: |
| 21 TexturedQuadRenderer(); |
| 22 ~TexturedQuadRenderer(); |
| 23 |
| 24 // Draw the content rect in the texture quad. |
| 25 void Draw(int texture_data_handle, const gvr::Mat4f& combined_matrix); |
| 26 |
| 27 private: |
| 28 GLuint vertex_shader_handle_; |
| 29 GLuint fragment_shader_handle_; |
| 30 GLuint program_handle_; |
| 31 GLuint combined_matrix_handle_; |
| 32 GLuint texture_uniform_handle_; |
| 33 GLuint position_handle_; |
| 34 GLuint texture_coordinate_handle_; |
| 35 |
| 36 DISALLOW_COPY_AND_ASSIGN(TexturedQuadRenderer); |
| 37 }; |
| 38 |
| 39 class VrShellRenderer { |
| 40 public: |
| 41 VrShellRenderer(); |
| 42 ~VrShellRenderer(); |
| 43 |
| 44 TexturedQuadRenderer* GetTexturedQuadRenderer() { |
| 45 return textured_quad_renderer_.get(); |
| 46 } |
| 47 |
| 48 private: |
| 49 std::unique_ptr<TexturedQuadRenderer> textured_quad_renderer_; |
| 50 DISALLOW_COPY_AND_ASSIGN(VrShellRenderer); |
| 51 }; |
| 52 |
| 53 } // namespace vr_shell |
| 54 |
| 55 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_RENDERER_H_ |
OLD | NEW |