From: Emil Velikov <emil.veli...@collabora.com> The indirection is meant to be used by the core EGL implementation in main. Not in the drivers themselves.
Move the dri2_destroy_surface definition to avoid forward declaration of the static function. Signed-off-by: Emil Velikov <emil.veli...@collabora.com> --- XXX: Aren't we forgetting to Unlink the surface/ctx ? XXX: How about sync/image ? We seems to be leaking those on eglTerminate, since we don't iterate and Unlink/API.Destroy over them in _eglReleaseDisplayResources. --- src/egl/drivers/dri2/egl_dri2.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c index e120eaa..89d2966 100644 --- a/src/egl/drivers/dri2/egl_dri2.c +++ b/src/egl/drivers/dri2/egl_dri2.c @@ -1226,6 +1226,17 @@ dri2_destroy_context(_EGLDriver *drv, _EGLDisplay *disp, _EGLContext *ctx) return EGL_TRUE; } +static EGLBoolean +dri2_destroy_surface(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surf) +{ + struct dri2_egl_display *dri2_dpy = dri2_egl_display(dpy); + + if (!_eglPutSurface(surf)) + return EGL_TRUE; + + return dri2_dpy->vtbl->destroy_surface(drv, dpy, surf); +} + /** * Called via eglMakeCurrent(), drv->API.MakeCurrent(). */ @@ -1269,15 +1280,15 @@ dri2_make_current(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *dsurf, if (unbind || dri2_dpy->core->bindContext(cctx, ddraw, rdraw)) { if (old_dsurf) - drv->API.DestroySurface(drv, disp, old_dsurf); + dri2_destroy_surface(drv, disp, old_dsurf); if (old_rsurf) - drv->API.DestroySurface(drv, disp, old_rsurf); + dri2_destroy_surface(drv, disp, old_rsurf); if (!unbind) dri2_dpy->ref_count++; if (old_ctx) { EGLDisplay old_disp = _eglGetDisplayHandle(old_ctx->Resource.Display); - drv->API.DestroyContext(drv, disp, old_ctx); + dri2_destroy_context(drv, disp, old_ctx); dri2_display_release(old_disp); } @@ -1353,17 +1364,6 @@ dri2_create_pbuffer_surface(_EGLDriver *drv, _EGLDisplay *dpy, } static EGLBoolean -dri2_destroy_surface(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surf) -{ - struct dri2_egl_display *dri2_dpy = dri2_egl_display(dpy); - - if (!_eglPutSurface(surf)) - return EGL_TRUE; - - return dri2_dpy->vtbl->destroy_surface(drv, dpy, surf); -} - -static EGLBoolean dri2_swap_interval(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surf, EGLint interval) { -- 2.9.0 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev