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

Unified Diff: gpu/command_buffer/common/gles2_cmd_utils.cc

Issue 413953002: Reuse GLES2Util code instead of defining new function in TextureManager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gpu/command_buffer/common/gles2_cmd_utils.h ('k') | gpu/command_buffer/service/texture_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/common/gles2_cmd_utils.cc
diff --git a/gpu/command_buffer/common/gles2_cmd_utils.cc b/gpu/command_buffer/common/gles2_cmd_utils.cc
index 8381586482b441b32cd7fe3f1bb8cd9284840419..37d10447e3d38ef9d2ce492caf7d2aeb98ef8e2d 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:
« no previous file with comments | « gpu/command_buffer/common/gles2_cmd_utils.h ('k') | gpu/command_buffer/service/texture_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698