OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // This file is here so other GLES2 related files can have a common set of | 5 // This file is here so other GLES2 related files can have a common set of |
6 // includes where appropriate. | 6 // includes where appropriate. |
7 | 7 |
8 #ifndef GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_UTILS_H_ | 8 #ifndef GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_UTILS_H_ |
9 #define GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_UTILS_H_ | 9 #define GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_UTILS_H_ |
10 | 10 |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 uint32_t* padded_row_size); | 122 uint32_t* padded_row_size); |
123 | 123 |
124 // Computes the size of image data for TexImage2D and TexSubImage2D. | 124 // Computes the size of image data for TexImage2D and TexSubImage2D. |
125 // Optionally the unpadded and padded row sizes can be returned. If height < 2 | 125 // Optionally the unpadded and padded row sizes can be returned. If height < 2 |
126 // then the padded_row_size will be the same as the unpadded_row_size since | 126 // then the padded_row_size will be the same as the unpadded_row_size since |
127 // padding is not necessary. | 127 // padding is not necessary. |
128 static bool ComputeImageDataSizes( | 128 static bool ComputeImageDataSizes( |
129 int width, int height, int format, int type, int unpack_alignment, | 129 int width, int height, int format, int type, int unpack_alignment, |
130 uint32_t* size, uint32_t* unpadded_row_size, uint32_t* padded_row_size); | 130 uint32_t* size, uint32_t* unpadded_row_size, uint32_t* padded_row_size); |
131 | 131 |
| 132 // Computes the size of image data for supported compressed formats. |
| 133 static bool ComputeCompressedImageSize(int width, |
| 134 int height, |
| 135 int format, |
| 136 int* ret_size); |
| 137 |
| 138 static bool IsValidCompressedImageSize(int level, |
| 139 int width, |
| 140 int height, |
| 141 int format); |
| 142 |
132 static size_t RenderbufferBytesPerPixel(int format); | 143 static size_t RenderbufferBytesPerPixel(int format); |
133 | 144 |
134 static uint32_t GetGLDataTypeSizeForUniforms(int type); | 145 static uint32_t GetGLDataTypeSizeForUniforms(int type); |
135 | 146 |
136 static size_t GetGLTypeSizeForTexturesAndBuffers(uint32_t type); | 147 static size_t GetGLTypeSizeForTexturesAndBuffers(uint32_t type); |
137 | 148 |
138 static uint32_t GLErrorToErrorBit(uint32_t gl_error); | 149 static uint32_t GLErrorToErrorBit(uint32_t gl_error); |
139 | 150 |
140 static uint32_t GLErrorBitToGLError(uint32_t error_bit); | 151 static uint32_t GLErrorBitToGLError(uint32_t error_bit); |
141 | 152 |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 bool bind_generates_resource; | 226 bool bind_generates_resource; |
216 bool fail_if_major_perf_caveat; | 227 bool fail_if_major_perf_caveat; |
217 bool lose_context_when_out_of_memory; | 228 bool lose_context_when_out_of_memory; |
218 }; | 229 }; |
219 | 230 |
220 } // namespace gles2 | 231 } // namespace gles2 |
221 } // namespace gpu | 232 } // namespace gpu |
222 | 233 |
223 #endif // GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_UTILS_H_ | 234 #endif // GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_UTILS_H_ |
224 | 235 |
OLD | NEW |