Virtualize SkGLContext with subclasses SkNativeGLContext and SkMesaGLContext, allow both in gm
Review URL: http://codereview.appspot.com/5307045/
git-svn-id: http://skia.googlecode.com/svn/trunk@2499 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/GrGLInterface.cpp b/src/gpu/GrGLInterface.cpp
index 70dd019..db57947 100644
--- a/src/gpu/GrGLInterface.cpp
+++ b/src/gpu/GrGLInterface.cpp
@@ -345,6 +345,8 @@
NULL == fCheckFramebufferStatus ||
NULL == fDeleteFramebuffers ||
NULL == fDeleteRenderbuffers ||
+ NULL == fFinish ||
+ NULL == fFlush ||
NULL == fFramebufferRenderbuffer ||
NULL == fFramebufferTexture2D ||
NULL == fGetFramebufferAttachmentParameteriv ||
@@ -417,6 +419,32 @@
return false;
}
}
+ if (glVer >= GR_GL_VER(1,5) ||
+ GrGLHasExtensionFromString("GL_ARB_occlusion_query", ext)) {
+ if (NULL == fGenQueries ||
+ NULL == fDeleteQueries ||
+ NULL == fBeginQuery ||
+ NULL == fEndQuery ||
+ NULL == fGetQueryiv ||
+ NULL == fGetQueryObjectiv ||
+ NULL == fGetQueryObjectuiv) {
+ return false;
+ }
+ }
+ if (glVer >= GR_GL_VER(3,3) ||
+ GrGLHasExtensionFromString("GL_ARB_timer_query", ext) ||
+ GrGLHasExtensionFromString("GL_EXT_timer_query", ext)) {
+ if (NULL == fGetQueryObjecti64v ||
+ NULL == fGetQueryObjectui64v) {
+ return false;
+ }
+ }
+ if (glVer >= GR_GL_VER(3,3) ||
+ GrGLHasExtensionFromString("GL_ARB_timer_query", ext)) {
+ if (NULL == fQueryCounter) {
+ return false;
+ }
+ }
}
// optional function on desktop before 1.3