| 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 74ccfecf44df16dff15e0dc92924df4e132eb9a5..7d97aeb6c505b25dbf8e8dabd96b828852296661 100644
|
| --- a/gpu/command_buffer/common/gles2_cmd_utils.cc
|
| +++ b/gpu/command_buffer/common/gles2_cmd_utils.cc
|
| @@ -483,8 +483,39 @@ int GLES2Util::GLGetNumValuesReturned(int id) const {
|
|
|
| namespace {
|
|
|
| +// Return the number of bytes per element, based on the element type.
|
| +int BytesPerElement(int type) {
|
| + switch (type) {
|
| + case GL_FLOAT_32_UNSIGNED_INT_24_8_REV:
|
| + return 8;
|
| + case GL_FLOAT:
|
| + case GL_UNSIGNED_INT_24_8_OES:
|
| + case GL_UNSIGNED_INT:
|
| + case GL_INT:
|
| + case GL_UNSIGNED_INT_2_10_10_10_REV:
|
| + case GL_UNSIGNED_INT_10F_11F_11F_REV:
|
| + case GL_UNSIGNED_INT_5_9_9_9_REV:
|
| + return 4;
|
| + case GL_HALF_FLOAT:
|
| + case GL_HALF_FLOAT_OES:
|
| + case GL_UNSIGNED_SHORT:
|
| + case GL_SHORT:
|
| + case GL_UNSIGNED_SHORT_5_6_5:
|
| + case GL_UNSIGNED_SHORT_4_4_4_4:
|
| + case GL_UNSIGNED_SHORT_5_5_5_1:
|
| + return 2;
|
| + case GL_UNSIGNED_BYTE:
|
| + case GL_BYTE:
|
| + return 1;
|
| + default:
|
| + return 0;
|
| + }
|
| +}
|
| +
|
| +} // anonymous namespace
|
| +
|
| // Return the number of elements per group of a specified format.
|
| -int ElementsPerGroup(int format, int type) {
|
| +int GLES2Util::ElementsPerGroup(int format, int type) {
|
| switch (type) {
|
| case GL_UNSIGNED_SHORT_5_6_5:
|
| case GL_UNSIGNED_SHORT_4_4_4_4:
|
| @@ -529,37 +560,6 @@ int ElementsPerGroup(int format, int type) {
|
| }
|
| }
|
|
|
| -// Return the number of bytes per element, based on the element type.
|
| -int BytesPerElement(int type) {
|
| - switch (type) {
|
| - case GL_FLOAT_32_UNSIGNED_INT_24_8_REV:
|
| - return 8;
|
| - case GL_FLOAT:
|
| - case GL_UNSIGNED_INT_24_8_OES:
|
| - case GL_UNSIGNED_INT:
|
| - case GL_INT:
|
| - case GL_UNSIGNED_INT_2_10_10_10_REV:
|
| - case GL_UNSIGNED_INT_10F_11F_11F_REV:
|
| - case GL_UNSIGNED_INT_5_9_9_9_REV:
|
| - return 4;
|
| - case GL_HALF_FLOAT:
|
| - case GL_HALF_FLOAT_OES:
|
| - case GL_UNSIGNED_SHORT:
|
| - case GL_SHORT:
|
| - case GL_UNSIGNED_SHORT_5_6_5:
|
| - case GL_UNSIGNED_SHORT_4_4_4_4:
|
| - case GL_UNSIGNED_SHORT_5_5_5_1:
|
| - return 2;
|
| - case GL_UNSIGNED_BYTE:
|
| - case GL_BYTE:
|
| - return 1;
|
| - default:
|
| - return 0;
|
| - }
|
| -}
|
| -
|
| -} // anonymous namespace
|
| -
|
| uint32_t GLES2Util::ComputeImageGroupSize(int format, int type) {
|
| int bytes_per_element = BytesPerElement(type);
|
| DCHECK_GE(8, bytes_per_element);
|
|
|