aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/gl
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpu/gl')
-rw-r--r--src/gpu/gl/GrGLInterface.cpp20
-rw-r--r--src/gpu/gl/android/GrGLCreateNativeInterface_android.cpp19
-rw-r--r--src/gpu/gl/angle/GrGLCreateANGLEInterface.cpp19
-rw-r--r--src/gpu/gl/iOS/GrGLCreateNativeInterface_iOS.cpp12
-rw-r--r--src/gpu/gl/mac/GrGLCreateNativeInterface_mac.cpp9
-rw-r--r--src/gpu/gl/mesa/GrGLCreateMesaInterface.cpp9
-rw-r--r--src/gpu/gl/unix/GrGLCreateNativeInterface_unix.cpp9
-rw-r--r--src/gpu/gl/win/GrGLCreateNativeInterface_win.cpp9
8 files changed, 102 insertions, 4 deletions
diff --git a/src/gpu/gl/GrGLInterface.cpp b/src/gpu/gl/GrGLInterface.cpp
index f40821f3da..c5ab39ac7b 100644
--- a/src/gpu/gl/GrGLInterface.cpp
+++ b/src/gpu/gl/GrGLInterface.cpp
@@ -486,5 +486,25 @@ bool GrGLInterface::validate() const {
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;
}
diff --git a/src/gpu/gl/android/GrGLCreateNativeInterface_android.cpp b/src/gpu/gl/android/GrGLCreateNativeInterface_android.cpp
index 984d318a21..aa5b224306 100644
--- a/src/gpu/gl/android/GrGLCreateNativeInterface_android.cpp
+++ b/src/gpu/gl/android/GrGLCreateNativeInterface_android.cpp
@@ -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;
}
@@ -403,6 +415,13 @@ static GrGLInterface* create_desktop_interface(GrGLVersion version,
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;
}
diff --git a/src/gpu/gl/angle/GrGLCreateANGLEInterface.cpp b/src/gpu/gl/angle/GrGLCreateANGLEInterface.cpp
index 681eab468c..a316ff1c11 100644
--- a/src/gpu/gl/angle/GrGLCreateANGLEInterface.cpp
+++ b/src/gpu/gl/angle/GrGLCreateANGLEInterface.cpp
@@ -88,6 +88,7 @@ const GrGLInterface* GrGLCreateANGLEInterface() {
GET_PROC(GetShaderInfoLog);
GET_PROC(GetShaderiv);
GET_PROC(GetString);
+ GET_PROC(GetStringi);
GET_PROC(GetUniformLocation);
GET_PROC(LineWidth);
GET_PROC(LinkProgram);
@@ -153,15 +154,25 @@ const GrGLInterface* GrGLCreateANGLEInterface() {
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;
}
diff --git a/src/gpu/gl/iOS/GrGLCreateNativeInterface_iOS.cpp b/src/gpu/gl/iOS/GrGLCreateNativeInterface_iOS.cpp
index decc23498c..553831d6ef 100644
--- a/src/gpu/gl/iOS/GrGLCreateNativeInterface_iOS.cpp
+++ b/src/gpu/gl/iOS/GrGLCreateNativeInterface_iOS.cpp
@@ -150,6 +150,18 @@ const GrGLInterface* GrGLCreateNativeInterface() {
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);
diff --git a/src/gpu/gl/mac/GrGLCreateNativeInterface_mac.cpp b/src/gpu/gl/mac/GrGLCreateNativeInterface_mac.cpp
index 3a6e07a64b..04898d1110 100644
--- a/src/gpu/gl/mac/GrGLCreateNativeInterface_mac.cpp
+++ b/src/gpu/gl/mac/GrGLCreateNativeInterface_mac.cpp
@@ -242,6 +242,15 @@ const GrGLInterface* GrGLCreateNativeInterface() {
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;
}
diff --git a/src/gpu/gl/mesa/GrGLCreateMesaInterface.cpp b/src/gpu/gl/mesa/GrGLCreateMesaInterface.cpp
index 9cde81ce63..fd8be26fe9 100644
--- a/src/gpu/gl/mesa/GrGLCreateMesaInterface.cpp
+++ b/src/gpu/gl/mesa/GrGLCreateMesaInterface.cpp
@@ -224,6 +224,15 @@ const GrGLInterface* GrGLCreateMesaInterface() {
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);
diff --git a/src/gpu/gl/unix/GrGLCreateNativeInterface_unix.cpp b/src/gpu/gl/unix/GrGLCreateNativeInterface_unix.cpp
index e46309b448..93807637fb 100644
--- a/src/gpu/gl/unix/GrGLCreateNativeInterface_unix.cpp
+++ b/src/gpu/gl/unix/GrGLCreateNativeInterface_unix.cpp
@@ -278,6 +278,15 @@ const GrGLInterface* GrGLCreateNativeInterface() {
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);
diff --git a/src/gpu/gl/win/GrGLCreateNativeInterface_win.cpp b/src/gpu/gl/win/GrGLCreateNativeInterface_win.cpp
index adc90a4bed..9a237825e9 100644
--- a/src/gpu/gl/win/GrGLCreateNativeInterface_win.cpp
+++ b/src/gpu/gl/win/GrGLCreateNativeInterface_win.cpp
@@ -305,6 +305,15 @@ const GrGLInterface* GrGLCreateNativeInterface() {
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);