| 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 #if defined(UNIT_TEST) |
| 12 #include "gpu/command_buffer/service/gl_mock.h" |
| 13 #else |
| 11 #include <GL/glew.h> | 14 #include <GL/glew.h> |
| 12 #if defined(OS_WIN) | 15 #if defined(OS_WIN) |
| 13 #include <GL/wglew.h> | 16 #include <GL/wglew.h> |
| 14 #endif | 17 #endif |
| 15 #include <build/build_config.h> | 18 #include <build/build_config.h> |
| 19 #endif |
| 16 | 20 |
| 17 #define GL_GLEXT_PROTOTYPES 1 | 21 #define GL_GLEXT_PROTOTYPES 1 |
| 18 | 22 |
| 19 // Define this for extra GL error debugging (slower). | 23 // Define this for extra GL error debugging (slower). |
| 20 // #define GL_ERROR_DEBUGGING | 24 // #define GL_ERROR_DEBUGGING |
| 21 #ifdef GL_ERROR_DEBUGGING | 25 #ifdef GL_ERROR_DEBUGGING |
| 22 #define CHECK_GL_ERROR() do { \ | 26 #define CHECK_GL_ERROR() do { \ |
| 23 GLenum gl_error = glGetError(); \ | 27 GLenum gl_error = glGetError(); \ |
| 24 LOG_IF(ERROR, gl_error != GL_NO_ERROR) << "GL Error :" << gl_error; \ | 28 LOG_IF(ERROR, gl_error != GL_NO_ERROR) << "GL Error :" << gl_error; \ |
| 25 } while (0) | 29 } while (0) |
| 26 #else // GL_ERROR_DEBUGGING | 30 #else // GL_ERROR_DEBUGGING |
| 27 #define CHECK_GL_ERROR() void(0) | 31 #define CHECK_GL_ERROR() void(0) |
| 28 #endif // GL_ERROR_DEBUGGING | 32 #endif // GL_ERROR_DEBUGGING |
| 29 | 33 |
| 30 #endif // GPU_COMMAND_BUFFER_SERVICE_GL_UTILS_H_ | 34 #endif // GPU_COMMAND_BUFFER_SERVICE_GL_UTILS_H_ |
| OLD | NEW |