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

Side by Side Diff: chrome/browser/android/vr_shell/vr_gl_util.h

Issue 2814443004: Refactor VR math off of GVR types, onto gfx types where possible. (Closed)
Patch Set: Fix tests Created 3 years, 8 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 unified diff | Download patch
OLDNEW
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_GL_UTIL_H_ 5 #ifndef CHROME_BROWSER_ANDROID_VR_SHELL_VR_GL_UTIL_H_
6 #define CHROME_BROWSER_ANDROID_VR_SHELL_VR_GL_UTIL_H_ 6 #define CHROME_BROWSER_ANDROID_VR_SHELL_VR_GL_UTIL_H_
7 7
8 #include <array> 8 #include <array>
9 #include <string> 9 #include <string>
10 10
11 #include "third_party/gvr-android-sdk/src/libraries/headers/vr/gvr/capi/include/ gvr_types.h" 11 #include "device/vr/vr_types.h"
12 #include "ui/gl/gl_bindings.h" 12 #include "ui/gl/gl_bindings.h"
13 13
14 namespace vr_shell { 14 namespace vr_shell {
15 15
16 std::array<float, 16> MatrixToGLArray(const gvr::Mat4f& matrix); 16 std::array<float, 16> MatrixToGLArray(const vr::Mat4f& matrix);
17 17
18 gvr::Rectf ModulateRect(const gvr::Rectf& rect, float width, float height); 18 gfx::Rect CalculatePixelSpaceRect(const gfx::Size& texture_size,
19 19 const gfx::RectF& texture_rect);
20 gvr::Recti CalculatePixelSpaceRect(const gvr::Sizei& texture_size,
21 const gvr::Rectf& texture_rect);
22 20
23 // Compile a shader. 21 // Compile a shader.
24 GLuint CompileShader(GLenum shader_type, 22 GLuint CompileShader(GLenum shader_type,
25 const GLchar* shader_source, 23 const GLchar* shader_source,
26 std::string& error); 24 std::string& error);
27 25
28 // Compile and link a program. 26 // Compile and link a program.
29 GLuint CreateAndLinkProgram(GLuint vertex_shader_handle, 27 GLuint CreateAndLinkProgram(GLuint vertex_shader_handle,
30 GLuint fragment_shader_handle, 28 GLuint fragment_shader_handle,
31 std::string& error); 29 std::string& error);
32 30
33 } // namespace vr_shell 31 } // namespace vr_shell
34 32
35 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_GL_UTIL_H_ 33 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_GL_UTIL_H_
OLDNEW
« no previous file with comments | « chrome/browser/android/vr_shell/vr_controller.cc ('k') | chrome/browser/android/vr_shell/vr_gl_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698