diff options
author | Daniel Czarnowski <[email protected]> | 2016-02-15 09:31:09 +0200 |
---|---|---|
committer | Emil Velikov <[email protected]> | 2016-02-19 18:23:19 +0000 |
commit | e6f1a44d1407f3318d86ca1bcbc26c3479632e63 (patch) | |
tree | b7c80e5088b2e75651cfcc52f5f3d6e72ae75e62 /src/egl/drivers/dri2 | |
parent | d1e1563bb63f08cdfec1b40b105bec7f343bc0b8 (diff) |
egl_dri2: set correct error code if swapbuffers fails
A return value of '-1' means that there was error during swap with a
window drawable, in this case we set error as EGL_BAD_NATIVE_WINDOW.
v2: coding style cleanup, better commit message
Signed-off-by: Matt Roper <[email protected]>
Cc: "11.0 11.1" <[email protected]
Reviewed-by: Emil Velikov <[email protected]>
Diffstat (limited to 'src/egl/drivers/dri2')
-rw-r--r-- | src/egl/drivers/dri2/platform_x11.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/egl/drivers/dri2/platform_x11.c b/src/egl/drivers/dri2/platform_x11.c index 931ee511f15..420f567651c 100644 --- a/src/egl/drivers/dri2/platform_x11.c +++ b/src/egl/drivers/dri2/platform_x11.c @@ -872,7 +872,12 @@ dri2_x11_swap_buffers(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw) struct dri2_egl_surface *dri2_surf = dri2_egl_surface(draw); if (dri2_dpy->dri2) { - return dri2_x11_swap_buffers_msc(drv, disp, draw, 0, 0, 0) != -1; + if (dri2_x11_swap_buffers_msc(drv, disp, draw, 0, 0, 0) != -1) { + return EGL_TRUE; + } + /* Swap failed with a window drawable. */ + _eglError(EGL_BAD_NATIVE_WINDOW, __FUNCTION__); + return EGL_FALSE; } else { assert(dri2_dpy->swrast); |