| 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 30f4e2b720bac6940909673e1e91474deb35641c..c0a5cd5ec714ce808cf9e5682a055775d5f7eb79 100644
|
| --- a/gpu/command_buffer/common/gles2_cmd_utils.cc
|
| +++ b/gpu/command_buffer/common/gles2_cmd_utils.cc
|
| @@ -542,40 +542,11 @@ bool GLES2Util::ComputeImageDataSizes(
|
| int width, int height, int depth, int format, int type,
|
| int alignment, uint32* size, uint32* opt_unpadded_row_size,
|
| uint32* opt_padded_row_size) {
|
| - DCHECK(width >= 0 && height >= 0 && depth >= 0);
|
| -
|
| - uint32 bytes_per_group = ComputeImageGroupSize(format, type);
|
| -
|
| - uint32 unpadded_row_size;
|
| - uint32 padded_row_size;
|
| - if (!ComputeImageRowSizeHelper(width, bytes_per_group, alignment,
|
| - &unpadded_row_size, &padded_row_size)) {
|
| - return false;
|
| - }
|
| - uint32 num_of_rows;
|
| - if (!SafeMultiplyUint32(height, depth, &num_of_rows)) {
|
| - return false;
|
| - }
|
| - if (num_of_rows > 0) {
|
| - uint32 size_of_all_but_last_row;
|
| - if (!SafeMultiplyUint32((num_of_rows - 1), padded_row_size,
|
| - &size_of_all_but_last_row)) {
|
| - return false;
|
| - }
|
| - if (!SafeAddUint32(size_of_all_but_last_row, unpadded_row_size, size)) {
|
| - return false;
|
| - }
|
| - } else {
|
| - *size = 0;
|
| - }
|
| - if (opt_padded_row_size) {
|
| - *opt_padded_row_size = padded_row_size;
|
| - }
|
| - if (opt_unpadded_row_size) {
|
| - *opt_unpadded_row_size = unpadded_row_size;
|
| - }
|
| -
|
| - return true;
|
| + PixelStoreParams params;
|
| + params.alignment = alignment;
|
| + return ComputeImageDataSizesES3(
|
| + width, height, depth, format, type, params,
|
| + size, opt_unpadded_row_size, opt_padded_row_size, nullptr);
|
| }
|
|
|
| bool GLES2Util::ComputeImageDataSizesES3(
|
|
|