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: |