Add GL_ARB_invalidate_subdata functions to GrGLInterface.
BUG=skia:1541 R=egdaniel@google.com Review URL: https://codereview.chromium.org/217503003 git-svn-id: http://skia.googlecode.com/svn/trunk@14004 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
parent
58d69d8460
commit
a34bb60c4e
@ -141,6 +141,12 @@ extern "C" {
|
|||||||
typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLGetTexLevelParameterivProc)(GrGLenum target, GrGLint level, GrGLenum pname, GrGLint* params);
|
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 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* 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* GrGLLineWidthProc)(GrGLfloat width);
|
||||||
typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLLinkProgramProc)(GrGLuint program);
|
typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLLinkProgramProc)(GrGLuint program);
|
||||||
typedef GrGLvoid* (GR_GL_FUNCTION_TYPE* GrGLMapBufferProc)(GrGLenum target, GrGLenum access);
|
typedef GrGLvoid* (GR_GL_FUNCTION_TYPE* GrGLMapBufferProc)(GrGLenum target, GrGLenum access);
|
||||||
|
@ -222,6 +222,12 @@ public:
|
|||||||
GLPtr<GrGLGetTexLevelParameterivProc> fGetTexLevelParameteriv;
|
GLPtr<GrGLGetTexLevelParameterivProc> fGetTexLevelParameteriv;
|
||||||
GLPtr<GrGLGetUniformLocationProc> fGetUniformLocation;
|
GLPtr<GrGLGetUniformLocationProc> fGetUniformLocation;
|
||||||
GLPtr<GrGLInsertEventMarkerProc> fInsertEventMarker;
|
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<GrGLLineWidthProc> fLineWidth;
|
||||||
GLPtr<GrGLLinkProgramProc> fLinkProgram;
|
GLPtr<GrGLLinkProgramProc> fLinkProgram;
|
||||||
GLPtr<GrGLLoadIdentityProc> fLoadIdentity;
|
GLPtr<GrGLLoadIdentityProc> fLoadIdentity;
|
||||||
|
@ -486,5 +486,25 @@ bool GrGLInterface::validate() const {
|
|||||||
RETURN_FALSE_INTERFACE
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -203,6 +203,18 @@ static GrGLInterface* create_es_interface(GrGLVersion version,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#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;
|
return interface;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -403,6 +415,13 @@ static GrGLInterface* create_desktop_interface(GrGLVersion version,
|
|||||||
functions->fPopGroupMarker = (GrGLPopGroupMarkerProc) eglGetProcAddress("glPopGroupMarkerEXT");
|
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;
|
return interface;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -88,6 +88,7 @@ const GrGLInterface* GrGLCreateANGLEInterface() {
|
|||||||
GET_PROC(GetShaderInfoLog);
|
GET_PROC(GetShaderInfoLog);
|
||||||
GET_PROC(GetShaderiv);
|
GET_PROC(GetShaderiv);
|
||||||
GET_PROC(GetString);
|
GET_PROC(GetString);
|
||||||
|
GET_PROC(GetStringi);
|
||||||
GET_PROC(GetUniformLocation);
|
GET_PROC(GetUniformLocation);
|
||||||
GET_PROC(LineWidth);
|
GET_PROC(LineWidth);
|
||||||
GET_PROC(LinkProgram);
|
GET_PROC(LinkProgram);
|
||||||
@ -153,15 +154,25 @@ const GrGLInterface* GrGLCreateANGLEInterface() {
|
|||||||
functions->fMapBuffer = (GrGLMapBufferProc) eglGetProcAddress("glMapBufferOES");
|
functions->fMapBuffer = (GrGLMapBufferProc) eglGetProcAddress("glMapBufferOES");
|
||||||
functions->fUnmapBuffer = (GrGLUnmapBufferProc) eglGetProcAddress("glUnmapBufferOES");
|
functions->fUnmapBuffer = (GrGLUnmapBufferProc) eglGetProcAddress("glUnmapBufferOES");
|
||||||
|
|
||||||
#if GL_EXT_debug_marker
|
|
||||||
functions->fInsertEventMarker = (GrGLInsertEventMarkerProc) eglGetProcAddress("glInsertEventMarkerEXT");
|
functions->fInsertEventMarker = (GrGLInsertEventMarkerProc) eglGetProcAddress("glInsertEventMarkerEXT");
|
||||||
functions->fPushGroupMarker = (GrGLInsertEventMarkerProc) eglGetProcAddress("glPushGroupMarkerEXT");
|
functions->fPushGroupMarker = (GrGLInsertEventMarkerProc) eglGetProcAddress("glPushGroupMarkerEXT");
|
||||||
functions->fPopGroupMarker = (GrGLPopGroupMarkerProc) eglGetProcAddress("glPopGroupMarkerEXT");
|
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
|
#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->fExtensions.init(kGLES_GrGLStandard,
|
||||||
interface->fFunctions.fGetString,
|
functions->fGetString,
|
||||||
interface->fFunctions.fGetStringi,
|
functions->fGetStringi,
|
||||||
interface->fFunctions.fGetIntegerv);
|
functions->fGetIntegerv);
|
||||||
return interface;
|
return interface;
|
||||||
}
|
}
|
||||||
|
@ -150,6 +150,18 @@ const GrGLInterface* GrGLCreateNativeInterface() {
|
|||||||
functions->fPopGroupMarker = glPopGroupMarkerEXT;
|
functions->fPopGroupMarker = glPopGroupMarkerEXT;
|
||||||
#endif
|
#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->fStandard = kGLES_GrGLStandard;
|
||||||
interface->fExtensions.init(kGLES_GrGLStandard, glGetString, NULL, glGetIntegerv);
|
interface->fExtensions.init(kGLES_GrGLStandard, glGetString, NULL, glGetIntegerv);
|
||||||
|
|
||||||
|
@ -242,6 +242,15 @@ const GrGLInterface* GrGLCreateNativeInterface() {
|
|||||||
GET_PROC_SUFFIX(PopGroupMarker, EXT);
|
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);
|
interface->fExtensions.swap(&extensions);
|
||||||
return interface;
|
return interface;
|
||||||
}
|
}
|
||||||
|
@ -224,6 +224,15 @@ const GrGLInterface* GrGLCreateMesaInterface() {
|
|||||||
GR_GL_GET_PROC_SUFFIX(PushGroupMarker, EXT);
|
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->fStandard = kGL_GrGLStandard;
|
||||||
interface->fExtensions.swap(&extensions);
|
interface->fExtensions.swap(&extensions);
|
||||||
|
|
||||||
|
@ -278,6 +278,15 @@ const GrGLInterface* GrGLCreateNativeInterface() {
|
|||||||
GR_GL_GET_PROC_SUFFIX(PopGroupMarker, EXT);
|
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->fStandard = kGL_GrGLStandard;
|
||||||
interface->fExtensions.swap(&extensions);
|
interface->fExtensions.swap(&extensions);
|
||||||
|
|
||||||
|
@ -305,6 +305,15 @@ const GrGLInterface* GrGLCreateNativeInterface() {
|
|||||||
WGL_SET_PROC_SUFFIX(PopGroupMarker, EXT);
|
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->fStandard = kGL_GrGLStandard;
|
||||||
interface->fExtensions.swap(&extensions);
|
interface->fExtensions.swap(&extensions);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user