diff options
author | Chris Craik <ccraik@google.com> | 2015-06-23 10:33:46 -0700 |
---|---|---|
committer | Chris Craik <ccraik@google.com> | 2015-06-23 10:34:54 -0700 |
commit | 5686bae28926dae6e4b4d380d75d18e77335c9d3 (patch) | |
tree | feb4517efea1d59851ed0e93007695fa643ddade /libs/hwui/utils | |
parent | bcca4ac4fb4fa66f2e4196437998c08e4dbed1d3 (diff) | |
download | frameworks_base-5686bae28926dae6e4b4d380d75d18e77335c9d3.zip frameworks_base-5686bae28926dae6e4b4d380d75d18e77335c9d3.tar.gz frameworks_base-5686bae28926dae6e4b4d380d75d18e77335c9d3.tar.bz2 |
Dump GL errors and crash on failure to allocate texture for layer
bug:22029728
Change-Id: Ib6f778975225b36567b12e30967955640ec185b3
Diffstat (limited to 'libs/hwui/utils')
-rw-r--r-- | libs/hwui/utils/GLUtils.cpp | 7 | ||||
-rw-r--r-- | libs/hwui/utils/GLUtils.h | 5 |
2 files changed, 6 insertions, 6 deletions
diff --git a/libs/hwui/utils/GLUtils.cpp b/libs/hwui/utils/GLUtils.cpp index 9b298ca..55104de 100644 --- a/libs/hwui/utils/GLUtils.cpp +++ b/libs/hwui/utils/GLUtils.cpp @@ -14,8 +14,6 @@ * limitations under the License. */ -#define LOG_TAG "OpenGLRenderer" - #include <GLES2/gl2.h> #include <GLES2/gl2ext.h> @@ -26,9 +24,11 @@ namespace android { namespace uirenderer { -void GLUtils::dumpGLErrors() { +bool GLUtils::dumpGLErrors() { + bool errorObserved = false; GLenum status = GL_NO_ERROR; while ((status = glGetError()) != GL_NO_ERROR) { + errorObserved = true; switch (status) { case GL_INVALID_ENUM: ALOGE("GL error: GL_INVALID_ENUM"); @@ -46,6 +46,7 @@ void GLUtils::dumpGLErrors() { ALOGE("GL error: 0x%x", status); } } + return errorObserved; } }; // namespace uirenderer diff --git a/libs/hwui/utils/GLUtils.h b/libs/hwui/utils/GLUtils.h index 890e374..7020461 100644 --- a/libs/hwui/utils/GLUtils.h +++ b/libs/hwui/utils/GLUtils.h @@ -20,12 +20,11 @@ namespace android { namespace uirenderer { class GLUtils { -private: public: /** - * Print out any GL errors with ALOGE + * Print out any GL errors with ALOGE, returns true if any errors were found. */ - static void dumpGLErrors(); + static bool dumpGLErrors(); }; // class GLUtils |