| 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 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 uint64_t v64, uint32_t* v32_0, uint32_t* v32_1); | 236 uint64_t v64, uint32_t* v32_0, uint32_t* v32_1); |
| 237 static uint64_t MapTwoUint32ToUint64(uint32_t v32_0, uint32_t v32_1); | 237 static uint64_t MapTwoUint32ToUint64(uint32_t v32_0, uint32_t v32_1); |
| 238 | 238 |
| 239 static uint32_t MapBufferTargetToBindingEnum(uint32_t target); | 239 static uint32_t MapBufferTargetToBindingEnum(uint32_t target); |
| 240 | 240 |
| 241 static bool IsUnsignedIntegerFormat(uint32_t internal_format); | 241 static bool IsUnsignedIntegerFormat(uint32_t internal_format); |
| 242 static bool IsSignedIntegerFormat(uint32_t internal_format); | 242 static bool IsSignedIntegerFormat(uint32_t internal_format); |
| 243 static bool IsIntegerFormat(uint32_t internal_format); | 243 static bool IsIntegerFormat(uint32_t internal_format); |
| 244 static bool IsFloatFormat(uint32_t internal_format); | 244 static bool IsFloatFormat(uint32_t internal_format); |
| 245 static uint32_t ConvertToSizedFormat(uint32_t format, uint32_t type); | 245 static uint32_t ConvertToSizedFormat(uint32_t format, uint32_t type); |
| 246 static bool IsSizedColorFormat(uint32_t internal_format); |
| 246 | 247 |
| 247 static bool IsSizedColorFormat(uint32_t internal_format); | 248 // Infer color encoding from internalformat |
| 249 static int GetColorEncodingFromInternalFormat(uint32_t internalformat); |
| 250 |
| 248 static void GetColorFormatComponentSizes( | 251 static void GetColorFormatComponentSizes( |
| 249 uint32_t internal_format, uint32_t type, int* r, int* g, int* b, int* a); | 252 uint32_t internal_format, uint32_t type, int* r, int* g, int* b, int* a); |
| 250 | 253 |
| 251 // Computes the data size for certain gl commands like glUniform. | 254 // Computes the data size for certain gl commands like glUniform. |
| 252 static bool ComputeDataSize(uint32_t count, | 255 static bool ComputeDataSize(uint32_t count, |
| 253 size_t size, | 256 size_t size, |
| 254 unsigned int elements_per_unit, | 257 unsigned int elements_per_unit, |
| 255 uint32_t* dst); | 258 uint32_t* dst); |
| 256 | 259 |
| 257 #include "../common/gles2_cmd_utils_autogen.h" | 260 #include "../common/gles2_cmd_utils_autogen.h" |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 bool should_use_native_gmb_for_backbuffer; | 333 bool should_use_native_gmb_for_backbuffer; |
| 331 | 334 |
| 332 ContextType context_type; | 335 ContextType context_type; |
| 333 }; | 336 }; |
| 334 | 337 |
| 335 } // namespace gles2 | 338 } // namespace gles2 |
| 336 } // namespace gpu | 339 } // namespace gpu |
| 337 | 340 |
| 338 #endif // GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_UTILS_H_ | 341 #endif // GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_UTILS_H_ |
| 339 | 342 |
| OLD | NEW |