Make GL calls go through macro (and therefore trigger callback function if present)
Review URL: http://codereview.appspot.com/4986043/
git-svn-id: http://skia.googlecode.com/svn/trunk@2223 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/gpu/src/GrGLInterface.cpp b/gpu/src/GrGLInterface.cpp
index 9bee806..38770f1 100644
--- a/gpu/src/GrGLInterface.cpp
+++ b/gpu/src/GrGLInterface.cpp
@@ -103,22 +103,21 @@
}
bool has_gl_extension(const GrGLInterface* gl, const char* ext) {
- const char* glstr = reinterpret_cast<const char*>(
- gl->fGetString(GR_GL_EXTENSIONS));
-
- return has_gl_extension_from_string(ext, glstr);
+ const GrGLubyte* glstr;
+ GR_GL_CALL_RET(gl, glstr, GetString(GR_GL_EXTENSIONS));
+ return has_gl_extension_from_string(ext, (const char*) glstr);
}
void gl_version(const GrGLInterface* gl, int* major, int* minor) {
- const char* v = reinterpret_cast<const char*>(
- gl->fGetString(GR_GL_VERSION));
- gl_version_from_string(major, minor, v);
+ const GrGLubyte* v;
+ GR_GL_CALL_RET(gl, v, GetString(GR_GL_VERSION));
+ gl_version_from_string(major, minor, (const char*) v);
}
float gl_version_as_float(const GrGLInterface* gl) {
- const char* v = reinterpret_cast<const char*>(
- gl->fGetString(GR_GL_VERSION));
- return gl_version_as_float_from_string(v);
+ const GrGLubyte* v;
+ GR_GL_CALL_RET(gl, v, GetString(GR_GL_VERSION));
+ return gl_version_as_float_from_string((const char*)v);
}
GrGLInterface::GrGLInterface() {