Loading libs/hwui/LayerRenderer.cpp +4 −5 Original line number Diff line number Diff line Loading @@ -14,15 +14,13 @@ * limitations under the License. */ #define LOG_TAG "OpenGLRenderer" #define ATRACE_TAG ATRACE_TAG_VIEW #include "LayerCache.h" #include "LayerRenderer.h" #include "Matrix.h" #include "Properties.h" #include "Rect.h" #include "renderstate/RenderState.h" #include "utils/GLUtils.h" #include "utils/TraceUtils.h" #include <ui/Rect.h> Loading Loading @@ -238,8 +236,9 @@ Layer* LayerRenderer::createRenderLayer(RenderState& renderState, uint32_t width layer->allocateTexture(); // This should only happen if we run out of memory if (glGetError() != GL_NO_ERROR) { ALOGE("Could not allocate texture for layer (fbo=%d %dx%d)", fbo, width, height); if (CC_UNLIKELY(GLUtils::dumpGLErrors())) { LOG_ALWAYS_FATAL("Could not allocate texture for layer (fbo=%d %dx%d)", fbo, width, height); renderState.bindFramebuffer(previousFbo); layer->decStrong(nullptr); return nullptr; Loading libs/hwui/utils/GLUtils.cpp +4 −3 Original line number Diff line number Diff line Loading @@ -14,8 +14,6 @@ * limitations under the License. */ #define LOG_TAG "OpenGLRenderer" #include <GLES2/gl2.h> #include <GLES2/gl2ext.h> Loading @@ -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"); Loading @@ -46,6 +46,7 @@ void GLUtils::dumpGLErrors() { ALOGE("GL error: 0x%x", status); } } return errorObserved; } }; // namespace uirenderer Loading libs/hwui/utils/GLUtils.h +2 −3 Original line number Diff line number Diff line Loading @@ -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 Loading Loading
libs/hwui/LayerRenderer.cpp +4 −5 Original line number Diff line number Diff line Loading @@ -14,15 +14,13 @@ * limitations under the License. */ #define LOG_TAG "OpenGLRenderer" #define ATRACE_TAG ATRACE_TAG_VIEW #include "LayerCache.h" #include "LayerRenderer.h" #include "Matrix.h" #include "Properties.h" #include "Rect.h" #include "renderstate/RenderState.h" #include "utils/GLUtils.h" #include "utils/TraceUtils.h" #include <ui/Rect.h> Loading Loading @@ -238,8 +236,9 @@ Layer* LayerRenderer::createRenderLayer(RenderState& renderState, uint32_t width layer->allocateTexture(); // This should only happen if we run out of memory if (glGetError() != GL_NO_ERROR) { ALOGE("Could not allocate texture for layer (fbo=%d %dx%d)", fbo, width, height); if (CC_UNLIKELY(GLUtils::dumpGLErrors())) { LOG_ALWAYS_FATAL("Could not allocate texture for layer (fbo=%d %dx%d)", fbo, width, height); renderState.bindFramebuffer(previousFbo); layer->decStrong(nullptr); return nullptr; Loading
libs/hwui/utils/GLUtils.cpp +4 −3 Original line number Diff line number Diff line Loading @@ -14,8 +14,6 @@ * limitations under the License. */ #define LOG_TAG "OpenGLRenderer" #include <GLES2/gl2.h> #include <GLES2/gl2ext.h> Loading @@ -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"); Loading @@ -46,6 +46,7 @@ void GLUtils::dumpGLErrors() { ALOGE("GL error: 0x%x", status); } } return errorObserved; } }; // namespace uirenderer Loading
libs/hwui/utils/GLUtils.h +2 −3 Original line number Diff line number Diff line Loading @@ -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 Loading