typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLGetTexLevelParameterivProc)(GrGLenum target, GrGLint level, GrGLenum pname, GrGLint* params);
typedef GrGLint (GR_GL_FUNCTION_TYPE* GrGLGetUniformLocationProc)(GrGLuint program, const char* name);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLInsertEventMarkerProc)(GrGLsizei length, const char* marker);
+ typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLInvalidateBufferDataProc)(GrGLuint buffer);
+ typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLInvalidateBufferSubDataProc)(GrGLuint buffer, GrGLintptr offset, GrGLsizeiptr length);
+ typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLInvalidateFramebufferProc)(GrGLenum target, GrGLsizei numAttachments, const GrGLenum *attachments);
+ typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLInvalidateSubFramebufferProc)(GrGLenum target, GrGLsizei numAttachments, const GrGLenum *attachments, GrGLint x, GrGLint y, GrGLsizei width, GrGLsizei height);
+ typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLInvalidateTexImageProc)(GrGLuint texture, GrGLint level);
+ typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLInvalidateTexSubImageProc)(GrGLuint texture, GrGLint level, GrGLint xoffset, GrGLint yoffset, GrGLint zoffset, GrGLsizei width, GrGLsizei height, GrGLsizei depth);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLLineWidthProc)(GrGLfloat width);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLLinkProgramProc)(GrGLuint program);
typedef GrGLvoid* (GR_GL_FUNCTION_TYPE* GrGLMapBufferProc)(GrGLenum target, GrGLenum access);
GLPtr<GrGLGetTexLevelParameterivProc> fGetTexLevelParameteriv;
GLPtr<GrGLGetUniformLocationProc> fGetUniformLocation;
GLPtr<GrGLInsertEventMarkerProc> fInsertEventMarker;
+ GLPtr<GrGLInvalidateBufferDataProc> fInvalidateBufferData;
+ GLPtr<GrGLInvalidateBufferSubDataProc> fInvalidateBufferSubData;
+ GLPtr<GrGLInvalidateFramebufferProc> fInvalidateFramebuffer;
+ GLPtr<GrGLInvalidateSubFramebufferProc> fInvalidateSubFramebuffer;
+ GLPtr<GrGLInvalidateTexImageProc> fInvalidateTexImage;
+ GLPtr<GrGLInvalidateTexSubImageProc> fInvalidateTexSubImage;
GLPtr<GrGLLineWidthProc> fLineWidth;
GLPtr<GrGLLinkProgramProc> fLinkProgram;
GLPtr<GrGLLoadIdentityProc> fLoadIdentity;
RETURN_FALSE_INTERFACE
}
}
+
+#if 0 // This can be enabled once Chromium is updated to set these functions pointers.
+ if ((kGL_GrGLStandard == fStandard) || fExtensions.has("GL_ARB_invalidate_subdata")) {
+ if (NULL == fFunctions.fInvalidateBufferData ||
+ NULL == fFunctions.fInvalidateBufferSubData ||
+ NULL == fFunctions.fInvalidateFramebuffer ||
+ NULL == fFunctions.fInvalidateSubFramebuffer ||
+ NULL == fFunctions.fInvalidateTexImage ||
+ NULL == fFunctions.fInvalidateTexSubImage) {
+ RETURN_FALSE_INTERFACE;
+ }
+ } else if (glVer >= GR_GL_VER(3,0)) {
+ // ES 3.0 adds the framebuffer functions but not the others.
+ if (NULL == fFunctions.fInvalidateFramebuffer ||
+ NULL == fFunctions.fInvalidateSubFramebuffer) {
+ RETURN_FALSE_INTERFACE;
+ }
+ }
+#endif
+
return true;
}
}
}
+#if GL_ES_VERSION_3_0
+ functions->fInvalidateFramebuffer = glInvalidateFramebuffer;
+ functions->fInvalidateSubFramebuffer = glInvalidateSubFramebuffer;
+#else
+ functions->fInvalidateFramebuffer = (GrGLInvalidateFramebufferProc) eglGetProcAddress("glInvalidateFramebuffer");
+ functions->fInvalidateSubFramebuffer = (GrGLInvalidateSubFramebufferProc) eglGetProcAddress("glInvalidateSubFramebuffer");
+#endif
+ functions->fInvalidateBufferData = (GrGLInvalidateBufferDataProc) eglGetProcAddress("glInvalidateBufferData");
+ functions->fInvalidateBufferSubData = (GrGLInvalidateBufferSubDataProc) eglGetProcAddress("glInvalidateBufferSubData");
+ functions->fInvalidateTexImage = (GrGLInvalidateTexImageProc) eglGetProcAddress("glInvalidateTexImage");
+ functions->fInvalidateTexSubImage = (GrGLInvalidateTexSubImageProc) eglGetProcAddress("glInvalidateTexSubImage");
+
return interface;
}
functions->fPopGroupMarker = (GrGLPopGroupMarkerProc) eglGetProcAddress("glPopGroupMarkerEXT");
}
+ functions->fInvalidateBufferData = (GrGLInvalidateBufferDataProc) eglGetProcAddress("glInvalidateBufferData");
+ functions->fInvalidateBufferSubData = (GrGLInvalidateBufferSubDataProc) eglGetProcAddress("glInvalidateBufferSubData");
+ functions->fInvalidateFramebuffer = (GrGLInvalidateFramebufferProc) eglGetProcAddress("glInvalidateFramebuffer");
+ functions->fInvalidateSubFramebuffer = (GrGLInvalidateSubFramebufferProc) eglGetProcAddress("glInvalidateSubFramebuffer");
+ functions->fInvalidateTexImage = (GrGLInvalidateTexImageProc) eglGetProcAddress("glInvalidateTexImage");
+ functions->fInvalidateTexSubImage = (GrGLInvalidateTexSubImageProc) eglGetProcAddress("glInvalidateTexSubImage");
+
return interface;
}
GET_PROC(GetShaderInfoLog);
GET_PROC(GetShaderiv);
GET_PROC(GetString);
+ GET_PROC(GetStringi);
GET_PROC(GetUniformLocation);
GET_PROC(LineWidth);
GET_PROC(LinkProgram);
functions->fMapBuffer = (GrGLMapBufferProc) eglGetProcAddress("glMapBufferOES");
functions->fUnmapBuffer = (GrGLUnmapBufferProc) eglGetProcAddress("glUnmapBufferOES");
-#if GL_EXT_debug_marker
functions->fInsertEventMarker = (GrGLInsertEventMarkerProc) eglGetProcAddress("glInsertEventMarkerEXT");
functions->fPushGroupMarker = (GrGLInsertEventMarkerProc) eglGetProcAddress("glPushGroupMarkerEXT");
functions->fPopGroupMarker = (GrGLPopGroupMarkerProc) eglGetProcAddress("glPopGroupMarkerEXT");
+
+#if GL_ES_VERSION_3_0
+ GET_PROC(InvalidateFramebuffer);
+ GET_PROC(InvalidateSubFramebuffer);
+#else
+ functions->fInvalidateFramebuffer = (GrGLInvalidateFramebufferProc) eglGetProcAddress("glInvalidateFramebuffer");
+ functions->fInvalidateSubFramebuffer = (GrGLInvalidateSubFramebufferProc) eglGetProcAddress("glInvalidateSubFramebuffer");
#endif
+ functions->fInvalidateBufferData = (GrGLInvalidateBufferDataProc) eglGetProcAddress("glInvalidateBufferData");
+ functions->fInvalidateBufferSubData = (GrGLInvalidateBufferSubDataProc) eglGetProcAddress("glInvalidateBufferSubData");
+ functions->fInvalidateTexImage = (GrGLInvalidateTexImageProc) eglGetProcAddress("glInvalidateTexImage");
+ functions->fInvalidateTexSubImage = (GrGLInvalidateTexSubImageProc) eglGetProcAddress("glInvalidateTexSubImage");
interface->fExtensions.init(kGLES_GrGLStandard,
- interface->fFunctions.fGetString,
- interface->fFunctions.fGetStringi,
- interface->fFunctions.fGetIntegerv);
+ functions->fGetString,
+ functions->fGetStringi,
+ functions->fGetIntegerv);
return interface;
}
functions->fPopGroupMarker = glPopGroupMarkerEXT;
#endif
+#if GL_ES_VERSION_3_0 || GL_ARB_invalidate_subdata
+ functions->fInvalidateFramebuffer = glInvalidateFramebuffer;
+ functions->fInvalidateSubFramebuffer = glInvalidateSubFramebuffer;
+#endif
+
+#if GL_ARB_invalidate_subdata
+ functions->fInvalidateBufferData = glInvalidateBufferData;
+ functions->fInvalidateBufferSubData = glInvalidateBufferSubData;
+ functions->fInvalidateTexImage = glInvalidateTexImage;
+ functions->fInvalidateTexSubImage = glInvalidateTexSubImage;
+#endif
+
interface->fStandard = kGLES_GrGLStandard;
interface->fExtensions.init(kGLES_GrGLStandard, glGetString, NULL, glGetIntegerv);
GET_PROC_SUFFIX(PopGroupMarker, EXT);
}
+ if (ver >= GR_GL_VER(4,3) || extensions.has("GL_ARB_invalidate_subdata")) {
+ GET_PROC(InvalidateBufferData);
+ GET_PROC(InvalidateBufferSubData);
+ GET_PROC(InvalidateFramebuffer);
+ GET_PROC(InvalidateSubFramebuffer);
+ GET_PROC(InvalidateTexImage);
+ GET_PROC(InvalidateTexSubImage);
+ }
+
interface->fExtensions.swap(&extensions);
return interface;
}
GR_GL_GET_PROC_SUFFIX(PushGroupMarker, EXT);
}
+ if (glVer >= GR_GL_VER(4,3) || extensions.has("GL_ARB_invalidate_subdata")) {
+ GR_GL_GET_PROC(InvalidateBufferData);
+ GR_GL_GET_PROC(InvalidateBufferSubData);
+ GR_GL_GET_PROC(InvalidateFramebuffer);
+ GR_GL_GET_PROC(InvalidateSubFramebuffer);
+ GR_GL_GET_PROC(InvalidateTexImage);
+ GR_GL_GET_PROC(InvalidateTexSubImage);
+ }
+
interface->fStandard = kGL_GrGLStandard;
interface->fExtensions.swap(&extensions);
GR_GL_GET_PROC_SUFFIX(PopGroupMarker, EXT);
}
+ if (glVer >= GR_GL_VER(4,3) || extensions.has("GL_ARB_invalidate_subdata")) {
+ GR_GL_GET_PROC(InvalidateBufferData);
+ GR_GL_GET_PROC(InvalidateBufferSubData);
+ GR_GL_GET_PROC(InvalidateFramebuffer);
+ GR_GL_GET_PROC(InvalidateSubFramebuffer);
+ GR_GL_GET_PROC(InvalidateTexImage);
+ GR_GL_GET_PROC(InvalidateTexSubImage);
+ }
+
interface->fStandard = kGL_GrGLStandard;
interface->fExtensions.swap(&extensions);
WGL_SET_PROC_SUFFIX(PopGroupMarker, EXT);
}
+ if (glVer >= GR_GL_VER(4,3) || extensions.has("GL_ARB_invalidate_subdata")) {
+ WGL_SET_PROC(InvalidateBufferData);
+ WGL_SET_PROC(InvalidateBufferSubData);
+ WGL_SET_PROC(InvalidateFramebuffer);
+ WGL_SET_PROC(InvalidateSubFramebuffer);
+ WGL_SET_PROC(InvalidateTexImage);
+ WGL_SET_PROC(InvalidateTexSubImage);
+ }
+
interface->fStandard = kGL_GrGLStandard;
interface->fExtensions.swap(&extensions);