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 <stdint.h> | 10 #include <stdint.h> |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 error_state->CopyRealGLErrorsToWrapper(__FILE__, __LINE__, function_name) | 52 error_state->CopyRealGLErrorsToWrapper(__FILE__, __LINE__, function_name) |
53 // Use to look at the real GL error and still pass it on to the user. | 53 // Use to look at the real GL error and still pass it on to the user. |
54 #define ERRORSTATE_PEEK_GL_ERROR(error_state, function_name) \ | 54 #define ERRORSTATE_PEEK_GL_ERROR(error_state, function_name) \ |
55 error_state->PeekGLError(__FILE__, __LINE__, function_name) | 55 error_state->PeekGLError(__FILE__, __LINE__, function_name) |
56 // Use to clear all current GL errors. FAILS if there are any. | 56 // Use to clear all current GL errors. FAILS if there are any. |
57 #define ERRORSTATE_CLEAR_REAL_GL_ERRORS(error_state, function_name) \ | 57 #define ERRORSTATE_CLEAR_REAL_GL_ERRORS(error_state, function_name) \ |
58 error_state->ClearRealGLErrors(__FILE__, __LINE__, function_name) | 58 error_state->ClearRealGLErrors(__FILE__, __LINE__, function_name) |
59 | 59 |
60 class GPU_EXPORT ErrorStateClient { | 60 class GPU_EXPORT ErrorStateClient { |
61 public: | 61 public: |
| 62 virtual void OnContextLostError() = 0; |
62 // GL_OUT_OF_MEMORY can cause side effects such as losing the context. | 63 // GL_OUT_OF_MEMORY can cause side effects such as losing the context. |
63 virtual void OnOutOfMemoryError() = 0; | 64 virtual void OnOutOfMemoryError() = 0; |
64 }; | 65 }; |
65 | 66 |
66 class GPU_EXPORT ErrorState { | 67 class GPU_EXPORT ErrorState { |
67 public: | 68 public: |
68 virtual ~ErrorState(); | 69 virtual ~ErrorState(); |
69 | 70 |
70 static ErrorState* Create(ErrorStateClient* client, Logger* logger); | 71 static ErrorState* Create(ErrorStateClient* client, Logger* logger); |
71 | 72 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 ErrorState(); | 120 ErrorState(); |
120 | 121 |
121 DISALLOW_COPY_AND_ASSIGN(ErrorState); | 122 DISALLOW_COPY_AND_ASSIGN(ErrorState); |
122 }; | 123 }; |
123 | 124 |
124 } // namespace gles2 | 125 } // namespace gles2 |
125 } // namespace gpu | 126 } // namespace gpu |
126 | 127 |
127 #endif // GPU_COMMAND_BUFFER_SERVICE_ERROR_STATE_H_ | 128 #endif // GPU_COMMAND_BUFFER_SERVICE_ERROR_STATE_H_ |
128 | 129 |
OLD | NEW |