summaryrefslogtreecommitdiffstats
path: root/src/egl
diff options
context:
space:
mode:
authorEric Engestrom <[email protected]>2016-10-10 17:33:17 +0100
committerEmil Velikov <[email protected]>2016-10-11 14:04:26 +0100
commit0a606a400fe382a9bc726beef269b47f4485d85f (patch)
tree723ba74b2658b07182ad602ed0fdd52c1dff18e7 /src/egl
parentb9e639589d2e06f3a7ecfebd811cacb9655fab5a (diff)
egl: add eglSwapBuffersWithDamageKHR
EGL_KHR_swap_buffers_with_damage is actually already supported, as it is technically nothing but a rename of EGL_EXT_swap_buffers_with_damage. To that effect, both extension are advertised depending on the same condition, and the new entrypoint simply redirects to the previous one. Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
Diffstat (limited to 'src/egl')
-rw-r--r--src/egl/main/eglapi.c32
1 files changed, 26 insertions, 6 deletions
diff --git a/src/egl/main/eglapi.c b/src/egl/main/eglapi.c
index 18071d78046..4568b8b9d74 100644
--- a/src/egl/main/eglapi.c
+++ b/src/egl/main/eglapi.c
@@ -494,6 +494,8 @@ _eglCreateExtensionsString(_EGLDisplay *dpy)
_EGL_CHECK_EXTENSION(KHR_no_config_context);
_EGL_CHECK_EXTENSION(KHR_reusable_sync);
_EGL_CHECK_EXTENSION(KHR_surfaceless_context);
+ if (dpy->Extensions.EXT_swap_buffers_with_damage)
+ _eglAppendExtension(&exts, "EGL_KHR_swap_buffers_with_damage");
_EGL_CHECK_EXTENSION(KHR_wait_sync);
if (dpy->Extensions.KHR_no_config_context)
@@ -1150,17 +1152,14 @@ eglSwapBuffers(EGLDisplay dpy, EGLSurface surface)
}
-static EGLBoolean EGLAPIENTRY
-eglSwapBuffersWithDamageEXT(EGLDisplay dpy, EGLSurface surface,
- EGLint *rects, EGLint n_rects)
+static EGLBoolean
+eglSwapBuffersWithDamageCommon(_EGLDisplay *disp, _EGLSurface *surf,
+ EGLint *rects, EGLint n_rects)
{
_EGLContext *ctx = _eglGetCurrentContext();
- _EGLDisplay *disp = _eglLockDisplay(dpy);
- _EGLSurface *surf = _eglLookupSurface(surface, disp);
_EGLDriver *drv;
EGLBoolean ret;
- _EGL_FUNC_START(disp, EGL_OBJECT_SURFACE_KHR, surf, EGL_FALSE);
_EGL_CHECK_SURFACE(disp, surf, EGL_FALSE, drv);
/* surface must be bound to current context in EGL 1.4 */
@@ -1176,6 +1175,26 @@ eglSwapBuffersWithDamageEXT(EGLDisplay dpy, EGLSurface surface,
RETURN_EGL_EVAL(disp, ret);
}
+static EGLBoolean EGLAPIENTRY
+eglSwapBuffersWithDamageEXT(EGLDisplay dpy, EGLSurface surface,
+ EGLint *rects, EGLint n_rects)
+{
+ _EGLDisplay *disp = _eglLockDisplay(dpy);
+ _EGLSurface *surf = _eglLookupSurface(surface, disp);
+ _EGL_FUNC_START(disp, EGL_OBJECT_SURFACE_KHR, surf, EGL_FALSE);
+ return eglSwapBuffersWithDamageCommon(disp, surf, rects, n_rects);
+}
+
+static EGLBoolean EGLAPIENTRY
+eglSwapBuffersWithDamageKHR(EGLDisplay dpy, EGLSurface surface,
+ EGLint *rects, EGLint n_rects)
+{
+ _EGLDisplay *disp = _eglLockDisplay(dpy);
+ _EGLSurface *surf = _eglLookupSurface(surface, disp);
+ _EGL_FUNC_START(disp, EGL_OBJECT_SURFACE_KHR, surf, EGL_FALSE);
+ return eglSwapBuffersWithDamageCommon(disp, surf, rects, n_rects);
+}
+
EGLBoolean EGLAPIENTRY
eglCopyBuffers(EGLDisplay dpy, EGLSurface surface, EGLNativePixmapType target)
{
@@ -2262,6 +2281,7 @@ eglGetProcAddress(const char *procname)
{ "eglCreateWaylandBufferFromImageWL", (_EGLProc) eglCreateWaylandBufferFromImageWL },
{ "eglPostSubBufferNV", (_EGLProc) eglPostSubBufferNV },
{ "eglSwapBuffersWithDamageEXT", (_EGLProc) eglSwapBuffersWithDamageEXT },
+ { "eglSwapBuffersWithDamageKHR", (_EGLProc) eglSwapBuffersWithDamageKHR },
{ "eglGetPlatformDisplayEXT", (_EGLProc) eglGetPlatformDisplayEXT },
{ "eglCreatePlatformWindowSurfaceEXT", (_EGLProc) eglCreatePlatformWindowSurfaceEXT },
{ "eglCreatePlatformPixmapSurfaceEXT", (_EGLProc) eglCreatePlatformPixmapSurfaceEXT },