diff options
author | heejin.r.chung@samsung.com <heejin.r.chung@samsung.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-24 14:00:03 +0000 |
---|---|---|
committer | heejin.r.chung@samsung.com <heejin.r.chung@samsung.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-24 14:00:03 +0000 |
commit | 07d142dc88376a666eca5fe04f6477fc74c64eee (patch) | |
tree | cc61327bd7f7591535cfb532d44759c3e12a62b7 /gpu/command_buffer/common/gles2_cmd_utils.cc | |
parent | c0e80b2e6f7a32df03446c86c4e45d78bf1ce668 (diff) | |
download | chromium_src-07d142dc88376a666eca5fe04f6477fc74c64eee.zip chromium_src-07d142dc88376a666eca5fe04f6477fc74c64eee.tar.gz chromium_src-07d142dc88376a666eca5fe04f6477fc74c64eee.tar.bz2 |
Reuse GLESUtil code instead of defining new function in TextureManager
Use GLES2Util::IndexToGLFaceTarget instead of redefining in TextureManager
and move GLTargetToFaceIndex to GLES2Util for possible future use.
BUG=None
Review URL: https://codereview.chromium.org/413953002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@285239 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu/command_buffer/common/gles2_cmd_utils.cc')
-rw-r--r-- | gpu/command_buffer/common/gles2_cmd_utils.cc | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/gpu/command_buffer/common/gles2_cmd_utils.cc b/gpu/command_buffer/common/gles2_cmd_utils.cc index 8381586..37d1044 100644 --- a/gpu/command_buffer/common/gles2_cmd_utils.cc +++ b/gpu/command_buffer/common/gles2_cmd_utils.cc @@ -594,6 +594,30 @@ uint32 GLES2Util::IndexToGLFaceTarget(int index) { return faces[index]; } +size_t GLES2Util::GLTargetToFaceIndex(uint32 target) { + switch (target) { + case GL_TEXTURE_2D: + case GL_TEXTURE_EXTERNAL_OES: + case GL_TEXTURE_RECTANGLE_ARB: + return 0; + case GL_TEXTURE_CUBE_MAP_POSITIVE_X: + return 0; + case GL_TEXTURE_CUBE_MAP_NEGATIVE_X: + return 1; + case GL_TEXTURE_CUBE_MAP_POSITIVE_Y: + return 2; + case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: + return 3; + case GL_TEXTURE_CUBE_MAP_POSITIVE_Z: + return 4; + case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: + return 5; + default: + NOTREACHED(); + return 0; + } +} + uint32 GLES2Util::GetPreferredGLReadPixelsFormat(uint32 internal_format) { switch (internal_format) { case GL_RGB16F_EXT: |