aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/gl
diff options
context:
space:
mode:
authorGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-02-07 19:45:46 +0000
committerGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-02-07 19:45:46 +0000
commitfe1b536bb7af523995549b64ad19de6685e11411 (patch)
treed2ea589d7b1d92bd8ad6bc36447c4ee523f445b0 /src/gpu/gl
parentefbe8e9bedda21a3e061ebf3d96431a0f250a654 (diff)
Enhance GL error checking for non-Ganesh GL calls
Diffstat (limited to 'src/gpu/gl')
-rw-r--r--src/gpu/gl/SkGLContext.cpp21
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) {