diff options
author | 2013-02-07 19:45:46 +0000 | |
---|---|---|
committer | 2013-02-07 19:45:46 +0000 | |
commit | fe1b536bb7af523995549b64ad19de6685e11411 (patch) | |
tree | d2ea589d7b1d92bd8ad6bc36447c4ee523f445b0 /src/gpu/gl | |
parent | efbe8e9bedda21a3e061ebf3d96431a0f250a654 (diff) |
Enhance GL error checking for non-Ganesh GL calls
https://codereview.appspot.com/7312057/
git-svn-id: http://skia.googlecode.com/svn/trunk@7647 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/gpu/gl')
-rw-r--r-- | src/gpu/gl/SkGLContext.cpp | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/src/gpu/gl/SkGLContext.cpp b/src/gpu/gl/SkGLContext.cpp index c5069b2db8..59ac31daff 100644 --- a/src/gpu/gl/SkGLContext.cpp +++ b/src/gpu/gl/SkGLContext.cpp @@ -40,18 +40,19 @@ bool SkGLContext::init(int width, int height) { fGL = this->createGLContext(); if (fGL) { - fExtensionString = - reinterpret_cast<const char*>(SK_GL(*this, - GetString(GR_GL_EXTENSIONS))); - const char* versionStr = - reinterpret_cast<const char*>(SK_GL(*this, - GetString(GR_GL_VERSION))); + const GrGLubyte* temp; + + SK_GL_RET(*this, temp, GetString(GR_GL_EXTENSIONS)); + fExtensionString = reinterpret_cast<const char*>(temp); + + SK_GL_RET(*this, temp, GetString(GR_GL_VERSION)); + const char* versionStr = reinterpret_cast<const char*>(temp); GrGLVersion version = GrGLGetVersionFromString(versionStr); // clear any existing GL erorrs GrGLenum error; do { - error = SK_GL(*this, GetError()); + SK_GL_RET(*this, error, GetError()); } while (GR_GL_NO_ERROR != error); GrGLBinding bindingInUse = GrGLGetBindingInUse(this->gl()); @@ -118,9 +119,9 @@ bool SkGLContext::init(int width, int height) { SK_GL(*this, ClearStencil(0)); SK_GL(*this, Clear(GR_GL_STENCIL_BUFFER_BIT)); - error = SK_GL(*this, GetError()); - GrGLenum status = - SK_GL(*this, CheckFramebufferStatus(GR_GL_FRAMEBUFFER)); + SK_GL_RET(*this, error, GetError()); + GrGLenum status; + SK_GL_RET(*this, status, CheckFramebufferStatus(GR_GL_FRAMEBUFFER)); if (GR_GL_FRAMEBUFFER_COMPLETE != status || GR_GL_NO_ERROR != error) { |