Chromium Code Reviews| 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 b6533a29cdd18dce7bb8224bcc0582128ad7748b..aa048c08782ddddb557e1fdedf8b4759c9b0f42d 100644 |
| --- a/gpu/command_buffer/common/gles2_cmd_utils.cc |
| +++ b/gpu/command_buffer/common/gles2_cmd_utils.cc |
| @@ -1210,6 +1210,39 @@ bool GLES2Util::IsIntegerFormat(uint32_t internal_format) { |
| IsSignedIntegerFormat(internal_format)); |
| } |
| +// static |
| +bool GLES2Util::IsFloatFormat(uint32_t internal_format) { |
| + switch (internal_format) { |
| + case GL_R16F: |
| + case GL_R32F: |
| + case GL_RG16F: |
| + case GL_RG32F: |
| + case GL_R11F_G11F_B10F: |
| + case GL_RGB16F: |
| + case GL_RGB32F: |
| + case GL_RGBA16F: |
| + case GL_RGBA32F: |
| + case GL_DEPTH_COMPONENT32F: |
| + case GL_DEPTH32F_STENCIL8: |
|
Zhenyao Mo
2015/10/13 01:19:31
I think you only need to include color formats.
qiankun
2015/10/13 14:28:01
Done.
|
| + return true; |
| + default: |
| + return false; |
| + } |
| +} |
| + |
| +// static |
| +bool GLES2Util::IsSRGBFormat(uint32_t internal_format) { |
| + switch (internal_format) { |
| + case GL_SRGB8: |
| + case GL_SRGB8_ALPHA8: |
| + case GL_COMPRESSED_SRGB8_ETC2: |
| + case GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC: |
| + case GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2: |
|
Zhenyao Mo
2015/10/13 01:19:32
I don't think you need to include compressed forma
qiankun
2015/10/13 14:28:01
Done.
|
| + return true; |
| + default: |
| + return false; |
| + } |
| +} |
| namespace { |