Chris Craik | e4aa95e | 2014-05-08 13:57:05 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2014 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | #ifndef GLUTILS_H |
| 17 | #define GLUTILS_H |
| 18 | |
John Reck | 9372ac3 | 2016-01-19 11:46:52 -0800 | [diff] [blame^] | 19 | #include <cutils/log.h> |
| 20 | |
Chris Craik | e4aa95e | 2014-05-08 13:57:05 -0700 | [diff] [blame] | 21 | namespace android { |
| 22 | namespace uirenderer { |
| 23 | |
John Reck | 9372ac3 | 2016-01-19 11:46:52 -0800 | [diff] [blame^] | 24 | #if 0 |
| 25 | #define GL_CHECKPOINT() LOG_ALWAYS_FATAL_IF(GLUtils::dumpGLErrors(),\ |
| 26 | "GL errors! %s:%d", __FILE__, __LINE__) |
| 27 | #else |
| 28 | #define GL_CHECKPOINT() |
| 29 | #endif |
| 30 | |
Chris Craik | e4aa95e | 2014-05-08 13:57:05 -0700 | [diff] [blame] | 31 | class GLUtils { |
Chris Craik | e4aa95e | 2014-05-08 13:57:05 -0700 | [diff] [blame] | 32 | public: |
| 33 | /** |
Chris Craik | 5686bae | 2015-06-23 10:33:46 -0700 | [diff] [blame] | 34 | * Print out any GL errors with ALOGE, returns true if any errors were found. |
Chris Craik | e4aa95e | 2014-05-08 13:57:05 -0700 | [diff] [blame] | 35 | */ |
Chris Craik | 5686bae | 2015-06-23 10:33:46 -0700 | [diff] [blame] | 36 | static bool dumpGLErrors(); |
Chris Craik | e4aa95e | 2014-05-08 13:57:05 -0700 | [diff] [blame] | 37 | |
| 38 | }; // class GLUtils |
| 39 | |
| 40 | } /* namespace uirenderer */ |
| 41 | } /* namespace android */ |
| 42 | |
| 43 | #endif /* GLUTILS_H */ |