aboutsummaryrefslogtreecommitdiffhomepage
path: root/gpu/src/GrGLInterface.cpp
diff options
context:
space:
mode:
authorGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-09-01 13:28:16 +0000
committerGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-09-01 13:28:16 +0000
commit56bfc5acc210987838744eece7383bc2f6b34915 (patch)
tree780b4bfb9c5d9c884416380448df017fe435cdd2 /gpu/src/GrGLInterface.cpp
parent9399cac0a14775f09735b2a59b83e65c462a728c (diff)
Add optional per-gl-func client callback.
Review URL: http://codereview.appspot.com/4964055/ git-svn-id: http://skia.googlecode.com/svn/trunk@2207 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'gpu/src/GrGLInterface.cpp')
-rw-r--r--gpu/src/GrGLInterface.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/gpu/src/GrGLInterface.cpp b/gpu/src/GrGLInterface.cpp
index ec00f16dc4..9bee8062e8 100644
--- a/gpu/src/GrGLInterface.cpp
+++ b/gpu/src/GrGLInterface.cpp
@@ -13,6 +13,12 @@
#include <stdio.h>
+#if GR_GL_PER_GL_FUNC_CALLBACK
+namespace {
+void GrGLDefaultInterfaceCallback(const GrGLInterface*) {}
+}
+#endif
+
static SkAutoTUnref<const GrGLInterface> gDefaultGLInterface;
void gl_version_from_string(int* major, int* minor,
@@ -26,7 +32,7 @@ void gl_version_from_string(int* major, int* minor,
int n = sscanf(versionString, "%d.%d", major, minor);
if (2 == n) {
- return;
+ return;
}
char profile[2];
@@ -234,6 +240,11 @@ GrGLInterface::GrGLInterface() {
fMapBuffer = NULL;
fUnmapBuffer = NULL;
fBindFragDataLocationIndexed = NULL;
+
+#if GR_GL_PER_GL_FUNC_CALLBACK
+ fCallback = GrGLDefaultInterfaceCallback;
+ fCallbackData = 0;
+#endif
}