// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // This file includes all the necessary GL headers and implements some useful // utilities. #ifndef GPU_COMMAND_BUFFER_SERVICE_GL_UTILS_H_ #define GPU_COMMAND_BUFFER_SERVICE_GL_UTILS_H_ #include "build/build_config.h" #include "app/gfx/gl/gl_bindings.h" // GLES2 defines not part of Desktop GL // Shader Precision-Specified Types #define GL_LOW_FLOAT 0x8DF0 #define GL_MEDIUM_FLOAT 0x8DF1 #define GL_HIGH_FLOAT 0x8DF2 #define GL_LOW_INT 0x8DF3 #define GL_MEDIUM_INT 0x8DF4 #define GL_HIGH_INT 0x8DF5 #define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A #define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B #define GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD #define GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB #define GL_MAX_VARYING_VECTORS 0x8DFC #define GL_SHADER_BINARY_FORMATS 0x8DF8 #define GL_NUM_SHADER_BINARY_FORMATS 0x8DF9 #define GL_SHADER_COMPILER 0x8DFA #define GL_RGB565 0x8D62 #define GL_GLEXT_PROTOTYPES 1 // Define this for extra GL error debugging (slower). // #define GL_ERROR_DEBUGGING #ifdef GL_ERROR_DEBUGGING #define CHECK_GL_ERROR() do { \ GLenum gl_error = glGetError(); \ LOG_IF(ERROR, gl_error != GL_NO_ERROR) << "GL Error :" << gl_error; \ } while (0) #else // GL_ERROR_DEBUGGING #define CHECK_GL_ERROR() void(0) #endif // GL_ERROR_DEBUGGING #endif // GPU_COMMAND_BUFFER_SERVICE_GL_UTILS_H_