Chromium Code Reviews| 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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 139 // Optionally the skipped bytes in the beginning can be returned. | 139 // Optionally the skipped bytes in the beginning can be returned. |
| 140 // Note the returned |size| does NOT include |skip_size|. | 140 // Note the returned |size| does NOT include |skip_size|. |
| 141 // TODO(zmo): merging ComputeImageDataSize and ComputeImageDataSizeES3. | 141 // TODO(zmo): merging ComputeImageDataSize and ComputeImageDataSizeES3. |
| 142 static bool ComputeImageDataSizesES3( | 142 static bool ComputeImageDataSizesES3( |
| 143 int width, int height, int depth, int format, int type, | 143 int width, int height, int depth, int format, int type, |
| 144 const PixelStoreParams& params, | 144 const PixelStoreParams& params, |
| 145 uint32_t* size, uint32_t* opt_unpadded_row_size, | 145 uint32_t* size, uint32_t* opt_unpadded_row_size, |
| 146 uint32_t* opt_padded_row_size, uint32_t* opt_skip_size, | 146 uint32_t* opt_padded_row_size, uint32_t* opt_skip_size, |
| 147 uint32_t* opt_padding); | 147 uint32_t* opt_padding); |
| 148 | 148 |
| 149 static bool IsCompressedTextureFormat(int internal_format); | |
|
Zhenyao Mo
2016/04/28 17:57:12
You don't have to redefined this function. We alr
Ken Russell (switch to Gerrit)
2016/04/29 13:10:06
Thanks for pointing this out. It's necessary to ca
| |
| 150 | |
| 149 static size_t RenderbufferBytesPerPixel(int format); | 151 static size_t RenderbufferBytesPerPixel(int format); |
| 150 | 152 |
| 151 // Return the element's number of bytes. | 153 // Return the element's number of bytes. |
| 152 // For example, GL_FLOAT_MAT3 returns sizeof(GLfloat). | 154 // For example, GL_FLOAT_MAT3 returns sizeof(GLfloat). |
| 153 static uint32_t GetElementSizeForUniformType(int type); | 155 static uint32_t GetElementSizeForUniformType(int type); |
| 154 // Return the number of elements. | 156 // Return the number of elements. |
| 155 // For example, GL_FLOAT_MAT3 returns 9. | 157 // For example, GL_FLOAT_MAT3 returns 9. |
| 156 static uint32_t GetElementCountForUniformType(int type); | 158 static uint32_t GetElementCountForUniformType(int type); |
| 157 | 159 |
| 158 static size_t GetGLTypeSizeForTextures(uint32_t type); | 160 static size_t GetGLTypeSizeForTextures(uint32_t type); |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 291 bool fail_if_major_perf_caveat; | 293 bool fail_if_major_perf_caveat; |
| 292 bool lose_context_when_out_of_memory; | 294 bool lose_context_when_out_of_memory; |
| 293 ContextType context_type; | 295 ContextType context_type; |
| 294 }; | 296 }; |
| 295 | 297 |
| 296 } // namespace gles2 | 298 } // namespace gles2 |
| 297 } // namespace gpu | 299 } // namespace gpu |
| 298 | 300 |
| 299 #endif // GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_UTILS_H_ | 301 #endif // GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_UTILS_H_ |
| 300 | 302 |
| OLD | NEW |