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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 } | 133 } |
134 | 134 |
135 void set_num_shader_binary_formats(int num_shader_binary_formats) { | 135 void set_num_shader_binary_formats(int num_shader_binary_formats) { |
136 num_shader_binary_formats_ = num_shader_binary_formats; | 136 num_shader_binary_formats_ = num_shader_binary_formats; |
137 } | 137 } |
138 | 138 |
139 // Gets the number of values a particular id will return when a glGet | 139 // Gets the number of values a particular id will return when a glGet |
140 // function is called. If 0 is returned the id is invalid. | 140 // function is called. If 0 is returned the id is invalid. |
141 int GLGetNumValuesReturned(int id) const; | 141 int GLGetNumValuesReturned(int id) const; |
142 | 142 |
| 143 static int ElementsPerGroup(int format, int type); |
143 // Computes the size of a single group of elements from a format and type pair | 144 // Computes the size of a single group of elements from a format and type pair |
144 static uint32_t ComputeImageGroupSize(int format, int type); | 145 static uint32_t ComputeImageGroupSize(int format, int type); |
145 | 146 |
146 // Computes the size of an image row including alignment padding | 147 // Computes the size of an image row including alignment padding |
147 static bool ComputeImagePaddedRowSize( | 148 static bool ComputeImagePaddedRowSize( |
148 int width, int format, int type, int alignment, | 149 int width, int format, int type, int alignment, |
149 uint32_t* padded_row_size); | 150 uint32_t* padded_row_size); |
150 | 151 |
151 // Computes the size of image data for TexImage2D and TexSubImage2D. | 152 // Computes the size of image data for TexImage2D and TexSubImage2D. |
152 // Optionally the unpadded and padded row sizes can be returned. | 153 // Optionally the unpadded and padded row sizes can be returned. |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 bool should_use_native_gmb_for_backbuffer; | 330 bool should_use_native_gmb_for_backbuffer; |
330 | 331 |
331 ContextType context_type; | 332 ContextType context_type; |
332 }; | 333 }; |
333 | 334 |
334 } // namespace gles2 | 335 } // namespace gles2 |
335 } // namespace gpu | 336 } // namespace gpu |
336 | 337 |
337 #endif // GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_UTILS_H_ | 338 #endif // GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_UTILS_H_ |
338 | 339 |
OLD | NEW |