| 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 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 <vector> |
| 12 |
| 11 #include "build/build_config.h" | 13 #include "build/build_config.h" |
| 12 #include "ui/gl/gl_bindings.h" | 14 #include "ui/gl/gl_bindings.h" |
| 13 | 15 |
| 14 // Define this for extra GL error debugging (slower). | 16 // Define this for extra GL error debugging (slower). |
| 15 // #define GL_ERROR_DEBUGGING | 17 // #define GL_ERROR_DEBUGGING |
| 16 #ifdef GL_ERROR_DEBUGGING | 18 #ifdef GL_ERROR_DEBUGGING |
| 17 #define CHECK_GL_ERROR() do { \ | 19 #define CHECK_GL_ERROR() do { \ |
| 18 GLenum gl_error = glGetError(); \ | 20 GLenum gl_error = glGetError(); \ |
| 19 LOG_IF(ERROR, gl_error != GL_NO_ERROR) << "GL Error :" << gl_error; \ | 21 LOG_IF(ERROR, gl_error != GL_NO_ERROR) << "GL Error :" << gl_error; \ |
| 20 } while (0) | 22 } while (0) |
| 21 #else // GL_ERROR_DEBUGGING | 23 #else // GL_ERROR_DEBUGGING |
| 22 #define CHECK_GL_ERROR() void(0) | 24 #define CHECK_GL_ERROR() void(0) |
| 23 #endif // GL_ERROR_DEBUGGING | 25 #endif // GL_ERROR_DEBUGGING |
| 24 | 26 |
| 27 namespace gpu { |
| 28 namespace gles2 { |
| 29 |
| 30 std::vector<int> GetAllGLErrors(); |
| 31 |
| 32 } // gles2 |
| 33 } // gpu |
| 34 |
| 25 #endif // GPU_COMMAND_BUFFER_SERVICE_GL_UTILS_H_ | 35 #endif // GPU_COMMAND_BUFFER_SERVICE_GL_UTILS_H_ |
| OLD | NEW |