| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 contains the ErrorState class. | 5 // This file contains the ErrorState class. |
| 6 | 6 |
| 7 #ifndef GPU_COMMAND_BUFFER_SERVICE_ERROR_STATE_H_ | 7 #ifndef GPU_COMMAND_BUFFER_SERVICE_ERROR_STATE_H_ |
| 8 #define GPU_COMMAND_BUFFER_SERVICE_ERROR_STATE_H_ | 8 #define GPU_COMMAND_BUFFER_SERVICE_ERROR_STATE_H_ |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 // you can see if that call generates an error. | 48 // you can see if that call generates an error. |
| 49 #define ERRORSTATE_COPY_REAL_GL_ERRORS_TO_WRAPPER(error_state, function_name) \ | 49 #define ERRORSTATE_COPY_REAL_GL_ERRORS_TO_WRAPPER(error_state, function_name) \ |
| 50 error_state->CopyRealGLErrorsToWrapper(__FILE__, __LINE__, function_name) | 50 error_state->CopyRealGLErrorsToWrapper(__FILE__, __LINE__, function_name) |
| 51 // Use to look at the real GL error and still pass it on to the user. | 51 // Use to look at the real GL error and still pass it on to the user. |
| 52 #define ERRORSTATE_PEEK_GL_ERROR(error_state, function_name) \ | 52 #define ERRORSTATE_PEEK_GL_ERROR(error_state, function_name) \ |
| 53 error_state->PeekGLError(__FILE__, __LINE__, function_name) | 53 error_state->PeekGLError(__FILE__, __LINE__, function_name) |
| 54 // Use to clear all current GL errors. FAILS if there are any. | 54 // Use to clear all current GL errors. FAILS if there are any. |
| 55 #define ERRORSTATE_CLEAR_REAL_GL_ERRORS(error_state, function_name) \ | 55 #define ERRORSTATE_CLEAR_REAL_GL_ERRORS(error_state, function_name) \ |
| 56 error_state->ClearRealGLErrors(__FILE__, __LINE__, function_name) | 56 error_state->ClearRealGLErrors(__FILE__, __LINE__, function_name) |
| 57 | 57 |
| 58 class GPU_EXPORT ErrorStateClient { | |
| 59 public: | |
| 60 // GL_OUT_OF_MEMORY can cause side effects such as losing the context. | |
| 61 virtual void OnOutOfMemoryError() = 0; | |
| 62 }; | |
| 63 | 58 |
| 64 class GPU_EXPORT ErrorState { | 59 class GPU_EXPORT ErrorState { |
| 65 public: | 60 public: |
| 66 virtual ~ErrorState(); | 61 virtual ~ErrorState(); |
| 67 | 62 |
| 68 static ErrorState* Create(ErrorStateClient* client, Logger* logger); | 63 static ErrorState* Create(Logger* logger); |
| 69 | 64 |
| 70 virtual uint32 GetGLError() = 0; | 65 virtual uint32 GetGLError() = 0; |
| 71 | 66 |
| 72 virtual void SetGLError( | 67 virtual void SetGLError( |
| 73 const char* filename, | 68 const char* filename, |
| 74 int line, | 69 int line, |
| 75 unsigned int error, | 70 unsigned int error, |
| 76 const char* function_name, | 71 const char* function_name, |
| 77 const char* msg) = 0; | 72 const char* msg) = 0; |
| 78 virtual void SetGLErrorInvalidEnum( | 73 virtual void SetGLErrorInvalidEnum( |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 ErrorState(); | 112 ErrorState(); |
| 118 | 113 |
| 119 DISALLOW_COPY_AND_ASSIGN(ErrorState); | 114 DISALLOW_COPY_AND_ASSIGN(ErrorState); |
| 120 }; | 115 }; |
| 121 | 116 |
| 122 } // namespace gles2 | 117 } // namespace gles2 |
| 123 } // namespace gpu | 118 } // namespace gpu |
| 124 | 119 |
| 125 #endif // GPU_COMMAND_BUFFER_SERVICE_ERROR_STATE_H_ | 120 #endif // GPU_COMMAND_BUFFER_SERVICE_ERROR_STATE_H_ |
| 126 | 121 |
| OLD | NEW |