| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 includes all the necessary GL headers and implements some useful | 5 // This file includes all the necessary GL headers and implements some useful |
| 6 // utilities. | 6 // utilities. |
| 7 | 7 |
| 8 #ifndef GPU_COMMAND_BUFFER_SERVICE_GL_UTILS_H_ | 8 #ifndef GPU_COMMAND_BUFFER_SERVICE_GL_UTILS_H_ |
| 9 #define GPU_COMMAND_BUFFER_SERVICE_GL_UTILS_H_ | 9 #define GPU_COMMAND_BUFFER_SERVICE_GL_UTILS_H_ |
| 10 | 10 |
| 11 #include "build/build_config.h" | 11 #include "build/build_config.h" |
| 12 #include "app/gfx/gl/gl_bindings.h" | 12 #include "app/gfx/gl/gl_bindings.h" |
| 13 | 13 |
| 14 // GLES2 defines not part of Desktop GL | 14 // GLES2 defines not part of Desktop GL |
| 15 // Shader Precision-Specified Types | 15 // Shader Precision-Specified Types |
| 16 #define GL_LOW_FLOAT 0x8DF0 | 16 #define GL_LOW_FLOAT 0x8DF0 |
| 17 #define GL_MEDIUM_FLOAT 0x8DF1 | 17 #define GL_MEDIUM_FLOAT 0x8DF1 |
| 18 #define GL_HIGH_FLOAT 0x8DF2 | 18 #define GL_HIGH_FLOAT 0x8DF2 |
| 19 #define GL_LOW_INT 0x8DF3 | 19 #define GL_LOW_INT 0x8DF3 |
| 20 #define GL_MEDIUM_INT 0x8DF4 | 20 #define GL_MEDIUM_INT 0x8DF4 |
| 21 #define GL_HIGH_INT 0x8DF5 | 21 #define GL_HIGH_INT 0x8DF5 |
| 22 #define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A | 22 #define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A |
| 23 #define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B | 23 #define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B |
| 24 #define GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD | 24 #define GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD |
| 25 #define GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB | 25 #define GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB |
| 26 #define GL_MAX_VARYING_VECTORS 0x8DFC | 26 #define GL_MAX_VARYING_VECTORS 0x8DFC |
| 27 #define GL_SHADER_BINARY_FORMATS 0x8DF8 | 27 #define GL_SHADER_BINARY_FORMATS 0x8DF8 |
| 28 #define GL_NUM_SHADER_BINARY_FORMATS 0x8DF9 | 28 #define GL_NUM_SHADER_BINARY_FORMATS 0x8DF9 |
| 29 #define GL_SHADER_COMPILER 0x8DFA | 29 #define GL_SHADER_COMPILER 0x8DFA |
| 30 #define GL_RGB565 0x8D62 |
| 30 | 31 |
| 31 #define GL_GLEXT_PROTOTYPES 1 | 32 #define GL_GLEXT_PROTOTYPES 1 |
| 32 | 33 |
| 33 // Define this for extra GL error debugging (slower). | 34 // Define this for extra GL error debugging (slower). |
| 34 // #define GL_ERROR_DEBUGGING | 35 // #define GL_ERROR_DEBUGGING |
| 35 #ifdef GL_ERROR_DEBUGGING | 36 #ifdef GL_ERROR_DEBUGGING |
| 36 #define CHECK_GL_ERROR() do { \ | 37 #define CHECK_GL_ERROR() do { \ |
| 37 GLenum gl_error = glGetError(); \ | 38 GLenum gl_error = glGetError(); \ |
| 38 LOG_IF(ERROR, gl_error != GL_NO_ERROR) << "GL Error :" << gl_error; \ | 39 LOG_IF(ERROR, gl_error != GL_NO_ERROR) << "GL Error :" << gl_error; \ |
| 39 } while (0) | 40 } while (0) |
| 40 #else // GL_ERROR_DEBUGGING | 41 #else // GL_ERROR_DEBUGGING |
| 41 #define CHECK_GL_ERROR() void(0) | 42 #define CHECK_GL_ERROR() void(0) |
| 42 #endif // GL_ERROR_DEBUGGING | 43 #endif // GL_ERROR_DEBUGGING |
| 43 | 44 |
| 44 #endif // GPU_COMMAND_BUFFER_SERVICE_GL_UTILS_H_ | 45 #endif // GPU_COMMAND_BUFFER_SERVICE_GL_UTILS_H_ |
| OLD | NEW |