| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_RENDERER_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_RENDERER_H_ |
| 6 #define CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_RENDERER_H_ | 6 #define CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_RENDERER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <queue> | 9 #include <queue> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 private: | 240 private: |
| 241 GLuint model_view_proj_matrix_handle_; | 241 GLuint model_view_proj_matrix_handle_; |
| 242 GLuint scene_radius_handle_; | 242 GLuint scene_radius_handle_; |
| 243 GLuint center_color_handle_; | 243 GLuint center_color_handle_; |
| 244 GLuint edge_color_handle_; | 244 GLuint edge_color_handle_; |
| 245 GLuint opacity_handle_; | 245 GLuint opacity_handle_; |
| 246 | 246 |
| 247 DISALLOW_COPY_AND_ASSIGN(GradientQuadRenderer); | 247 DISALLOW_COPY_AND_ASSIGN(GradientQuadRenderer); |
| 248 }; | 248 }; |
| 249 | 249 |
| 250 class GradientGridRenderer : public BaseRenderer { | 250 class GradientGridRenderer : public BaseQuadRenderer { |
| 251 public: | 251 public: |
| 252 GradientGridRenderer(); | 252 GradientGridRenderer(); |
| 253 ~GradientGridRenderer() override; | 253 ~GradientGridRenderer() override; |
| 254 | 254 |
| 255 void Draw(const vr::Mat4f& view_proj_matrix, | 255 void Draw(const vr::Mat4f& view_proj_matrix, |
| 256 SkColor edge_color, | 256 SkColor edge_color, |
| 257 SkColor center_color, | 257 SkColor center_color, |
| 258 SkColor grid_color, |
| 258 int gridline_count, | 259 int gridline_count, |
| 259 float opacity); | 260 float opacity); |
| 260 | 261 |
| 261 private: | 262 private: |
| 262 void MakeGridLines(int gridline_count); | |
| 263 | |
| 264 GLuint vertex_buffer_ = 0; | |
| 265 GLuint model_view_proj_matrix_handle_; | 263 GLuint model_view_proj_matrix_handle_; |
| 266 GLuint scene_radius_handle_; | 264 GLuint scene_radius_handle_; |
| 267 GLuint center_color_handle_; | 265 GLuint center_color_handle_; |
| 268 GLuint edge_color_handle_; | 266 GLuint edge_color_handle_; |
| 267 GLuint grid_color_handle_; |
| 269 GLuint opacity_handle_; | 268 GLuint opacity_handle_; |
| 270 std::vector<Line3d> grid_lines_; | 269 GLuint lines_count_handle_; |
| 271 | 270 |
| 272 DISALLOW_COPY_AND_ASSIGN(GradientGridRenderer); | 271 DISALLOW_COPY_AND_ASSIGN(GradientGridRenderer); |
| 273 }; | 272 }; |
| 274 | 273 |
| 275 class VrShellRenderer { | 274 class VrShellRenderer { |
| 276 public: | 275 public: |
| 277 VrShellRenderer(); | 276 VrShellRenderer(); |
| 278 ~VrShellRenderer(); | 277 ~VrShellRenderer(); |
| 279 | 278 |
| 280 ExternalTexturedQuadRenderer* GetExternalTexturedQuadRenderer(); | 279 ExternalTexturedQuadRenderer* GetExternalTexturedQuadRenderer(); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 297 std::unique_ptr<ControllerRenderer> controller_renderer_; | 296 std::unique_ptr<ControllerRenderer> controller_renderer_; |
| 298 std::unique_ptr<GradientQuadRenderer> gradient_quad_renderer_; | 297 std::unique_ptr<GradientQuadRenderer> gradient_quad_renderer_; |
| 299 std::unique_ptr<GradientGridRenderer> gradient_grid_renderer_; | 298 std::unique_ptr<GradientGridRenderer> gradient_grid_renderer_; |
| 300 | 299 |
| 301 DISALLOW_COPY_AND_ASSIGN(VrShellRenderer); | 300 DISALLOW_COPY_AND_ASSIGN(VrShellRenderer); |
| 302 }; | 301 }; |
| 303 | 302 |
| 304 } // namespace vr_shell | 303 } // namespace vr_shell |
| 305 | 304 |
| 306 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_RENDERER_H_ | 305 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_RENDERER_H_ |
| OLD | NEW |