Chromium Code Reviews| 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 |
| index 540e91b1849de9ece88ef56423b7ef1c383dbb9f..3126d75e89557925da837f44ad5ea22d92e95909 100644 |
| --- a/chrome/browser/android/vr_shell/vr_shell_renderer.h |
| +++ b/chrome/browser/android/vr_shell/vr_shell_renderer.h |
| @@ -10,6 +10,7 @@ |
| #include <vector> |
| #include "base/macros.h" |
| +#include "chrome/browser/android/vr_shell/vr_util.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" |
| @@ -30,14 +31,31 @@ class TexturedQuadRenderer { |
| ~TexturedQuadRenderer(); |
| // Draw the content rect in the texture quad. |
| - void Draw(int texture_data_handle, const gvr::Mat4f& combined_matrix); |
| + void Draw(int textureDataHandle, const gvr::Mat4f& combinedMatrix, |
| + const Rectf& copyRect); |
| private: |
| + static constexpr float kHalfHeight = 0.5f; |
|
David Trainor- moved to gerrit
2016/09/08 05:49:30
Any reason we pulled these to the h file instead o
mthiesse
2016/09/08 17:44:41
Nope, moved back.
|
| + static constexpr float kHalfWidth = 0.5f; |
| + static constexpr float kTextureQuadPosition[18] = { |
| + -kHalfWidth, kHalfHeight, 0.0f, -kHalfWidth, -kHalfHeight, 0.0f, |
| + kHalfWidth, kHalfHeight, 0.0f, -kHalfWidth, -kHalfHeight, 0.0f, |
| + kHalfWidth, -kHalfHeight, 0.0f, kHalfWidth, kHalfHeight, 0.0f}; |
| + static constexpr int kPositionDataSize = 3; |
| + // Number of vertices passed to glDrawArrays(). |
| + static constexpr int kVerticesNumber = 6; |
| + |
| + static constexpr float kTexturedQuadTextureCoordinates[12] = |
| + makeRectangularTextureBuffer(0.0f, 1.0f, 0.0f, 1.0f); |
| + |
| + static constexpr int kTextureCoordinateDataSize = 2; |
| + |
| GLuint vertex_shader_handle_; |
| GLuint fragment_shader_handle_; |
| GLuint program_handle_; |
| GLuint combined_matrix_handle_; |
| GLuint texture_uniform_handle_; |
| + GLuint copy_rect_uniform_handle_; |
| GLuint position_handle_; |
| GLuint texture_coordinate_handle_; |
| @@ -55,6 +73,7 @@ class VrShellRenderer { |
| private: |
| std::unique_ptr<TexturedQuadRenderer> textured_quad_renderer_; |
| + |
| DISALLOW_COPY_AND_ASSIGN(VrShellRenderer); |
| }; |