summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFredrik Höglund <fredrik@kde.org>2011-12-14 21:24:09 +0100
committerChia-I Wu <olv@lunarg.com>2011-12-20 17:04:46 +0800
commit7d46b45c5bd7d1ab3e32a2722ca65061ca80dc34 (patch)
tree0b93d727b5eb9e34f0a115abf51ee965488e528e
parentf63e129d5fef73b0710d294ddc19440d9d388836 (diff)
egl: add EGL_NV_post_sub_buffer
v2: Handle EGL_POST_SUB_BUFFER_SUPPORTED_NV in _eglParseSurfaceAttribList() Signed-off-by: Fredrik Höglund <fredrik@kde.org> [olv: remove #ifdef checks]
-rw-r--r--src/egl/main/eglapi.c21
-rw-r--r--src/egl/main/eglapi.h4
-rw-r--r--src/egl/main/egldisplay.h2
-rw-r--r--src/egl/main/eglmisc.c2
-rw-r--r--src/egl/main/eglsurface.c17
-rw-r--r--src/egl/main/eglsurface.h2
6 files changed, 48 insertions, 0 deletions
diff --git a/src/egl/main/eglapi.c b/src/egl/main/eglapi.c
index daec43da2a..b27aac1674 100644
--- a/src/egl/main/eglapi.c
+++ b/src/egl/main/eglapi.c
@@ -941,6 +941,7 @@ eglGetProcAddress(const char *procname)
{ "eglBindWaylandDisplayWL", (_EGLProc) eglBindWaylandDisplayWL },
{ "eglUnbindWaylandDisplayWL", (_EGLProc) eglUnbindWaylandDisplayWL },
#endif
+ { "eglPostSubBufferNV", (_EGLProc) eglPostSubBufferNV },
{ NULL, NULL }
};
EGLint i;
@@ -1540,3 +1541,23 @@ eglUnbindWaylandDisplayWL(EGLDisplay dpy, struct wl_display *display)
RETURN_EGL_EVAL(disp, ret);
}
#endif
+
+
+EGLBoolean EGLAPIENTRY
+eglPostSubBufferNV(EGLDisplay dpy, EGLSurface surface,
+ EGLint x, EGLint y, EGLint width, EGLint height)
+{
+ _EGLDisplay *disp = _eglLockDisplay(dpy);
+ _EGLSurface *surf = _eglLookupSurface(surface, disp);
+ _EGLDriver *drv;
+ EGLBoolean ret;
+
+ _EGL_CHECK_SURFACE(disp, surf, EGL_FALSE, drv);
+
+ if (!disp->Extensions.NV_post_sub_buffer)
+ RETURN_EGL_EVAL(disp, EGL_FALSE);
+
+ ret = drv->API.PostSubBufferNV(drv, disp, surf, x, y, width, height);
+
+ RETURN_EGL_EVAL(disp, ret);
+}
diff --git a/src/egl/main/eglapi.h b/src/egl/main/eglapi.h
index 8b62c125e8..14085cb4d8 100644
--- a/src/egl/main/eglapi.h
+++ b/src/egl/main/eglapi.h
@@ -125,6 +125,8 @@ typedef EGLBoolean (*BindWaylandDisplayWL_t)(_EGLDriver *drv, _EGLDisplay *disp,
typedef EGLBoolean (*UnbindWaylandDisplayWL_t)(_EGLDriver *drv, _EGLDisplay *disp, struct wl_display *display);
#endif
+typedef EGLBoolean (*PostSubBufferNV_t)(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surface, EGLint x, EGLint y, EGLint width, EGLint height);
+
/**
* The API dispatcher jumps through these functions
*/
@@ -198,6 +200,8 @@ struct _egl_api
BindWaylandDisplayWL_t BindWaylandDisplayWL;
UnbindWaylandDisplayWL_t UnbindWaylandDisplayWL;
#endif
+
+ PostSubBufferNV_t PostSubBufferNV;
};
#endif /* EGLAPI_INCLUDED */
diff --git a/src/egl/main/egldisplay.h b/src/egl/main/egldisplay.h
index 17c76af7e2..905c7a4f02 100644
--- a/src/egl/main/egldisplay.h
+++ b/src/egl/main/egldisplay.h
@@ -111,6 +111,8 @@ struct _egl_extensions
EGLBoolean NOK_texture_from_pixmap;
EGLBoolean ANDROID_image_native_buffer;
+
+ EGLBoolean NV_post_sub_buffer;
};
diff --git a/src/egl/main/eglmisc.c b/src/egl/main/eglmisc.c
index b478e79190..9d534f0a5b 100644
--- a/src/egl/main/eglmisc.c
+++ b/src/egl/main/eglmisc.c
@@ -115,6 +115,8 @@ _eglUpdateExtensionsString(_EGLDisplay *dpy)
_EGL_CHECK_EXTENSION(NOK_texture_from_pixmap);
_EGL_CHECK_EXTENSION(ANDROID_image_native_buffer);
+
+ _EGL_CHECK_EXTENSION(NV_post_sub_buffer);
#undef _EGL_CHECK_EXTENSION
}
diff --git a/src/egl/main/eglsurface.c b/src/egl/main/eglsurface.c
index 3564ecd01b..52d85ef8b7 100644
--- a/src/egl/main/eglsurface.c
+++ b/src/egl/main/eglsurface.c
@@ -170,6 +170,18 @@ _eglParseSurfaceAttribList(_EGLSurface *surf, const EGLint *attrib_list)
}
surf->RenderBuffer = val;
break;
+ case EGL_POST_SUB_BUFFER_SUPPORTED_NV:
+ if (!dpy->Extensions.NV_post_sub_buffer ||
+ type != EGL_WINDOW_BIT) {
+ err = EGL_BAD_ATTRIBUTE;
+ break;
+ }
+ if (val != EGL_TRUE && val != EGL_FALSE) {
+ err = EGL_BAD_PARAMETER;
+ break;
+ }
+ surf->PostSubBufferSupportedNV = val;
+ break;
/* pbuffer surface attributes */
case EGL_WIDTH:
if (type != EGL_PBUFFER_BIT) {
@@ -323,6 +335,8 @@ _eglInitSurface(_EGLSurface *surf, _EGLDisplay *dpy, EGLint type,
surf->VerticalResolution = EGL_UNKNOWN;
surf->AspectRatio = EGL_UNKNOWN;
+ surf->PostSubBufferSupportedNV = EGL_FALSE;
+
/* the default swap interval is 1 */
_eglClampSwapInterval(surf, 1);
@@ -392,6 +406,9 @@ _eglQuerySurface(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surface,
case EGL_VG_COLORSPACE:
*value = surface->VGColorspace;
break;
+ case EGL_POST_SUB_BUFFER_SUPPORTED_NV:
+ *value = surface->PostSubBufferSupportedNV;
+ break;
default:
_eglError(EGL_BAD_ATTRIBUTE, "eglQuerySurface");
return EGL_FALSE;
diff --git a/src/egl/main/eglsurface.h b/src/egl/main/eglsurface.h
index 0541ff4e2f..7d91363c1b 100644
--- a/src/egl/main/eglsurface.h
+++ b/src/egl/main/eglsurface.h
@@ -73,6 +73,8 @@ struct _egl_surface
/* True if the surface is bound to an OpenGL ES texture */
EGLBoolean BoundToTexture;
+
+ EGLBoolean PostSubBufferSupportedNV;
};