Index: gpu/command_buffer/common/gles2_cmd_utils.h |
diff --git a/gpu/command_buffer/common/gles2_cmd_utils.h b/gpu/command_buffer/common/gles2_cmd_utils.h |
index 3aa0299056a0fd83f1a4bf183e279e0af6b0d63e..1d3d556dcfed5a7c2f6d440989a06ca6666c8305 100644 |
--- a/gpu/command_buffer/common/gles2_cmd_utils.h |
+++ b/gpu/command_buffer/common/gles2_cmd_utils.h |
@@ -52,6 +52,24 @@ inline bool SafeAddInt32(int32_t a, int32_t b, int32_t* dst) { |
return checked.IsValid(); |
} |
+struct GLES2_UTILS_EXPORT PixelStoreParams { |
+ PixelStoreParams() |
+ : alignment(4), |
+ row_length(0), |
+ image_height(0), |
+ skip_pixels(0), |
+ skip_rows(0), |
+ skip_images(0) { |
+ } |
+ |
+ int32_t alignment; |
+ int32_t row_length; |
+ int32_t image_height; |
+ int32_t skip_pixels; |
+ int32_t skip_rows; |
+ int32_t skip_images; |
+}; |
+ |
// Utilties for GLES2 support. |
class GLES2_UTILS_EXPORT GLES2Util { |
public: |
@@ -109,14 +127,22 @@ class GLES2_UTILS_EXPORT GLES2Util { |
uint32_t* padded_row_size); |
// Computes the size of image data for TexImage2D and TexSubImage2D. |
- // Optionally the unpadded and padded row sizes can be returned. If height < 2 |
- // then the padded_row_size will be the same as the unpadded_row_size since |
- // padding is not necessary. |
+ // Optionally the unpadded and padded row sizes can be returned. |
static bool ComputeImageDataSizes( |
int width, int height, int depth, int format, int type, |
int unpack_alignment, uint32_t* size, uint32_t* unpadded_row_size, |
uint32_t* padded_row_size); |
+ // Similar to the above function, but taking into consideration all ES3 |
+ // pixel pack/unpack parameters. |
+ // Optionally the skipped bytes in the beginning can be returned. |
+ // Note the returned |size| includes |skip_size|. |
+ static bool ComputeImageDataSizes( |
+ int width, int height, int depth, int format, int type, |
+ const PixelStoreParams& params, |
+ uint32_t* size, uint32_t* unpadded_row_size, |
+ uint32_t* padded_row_size, uint32_t* skip_size); |
+ |
static size_t RenderbufferBytesPerPixel(int format); |
// Return the element's number of bytes. |