egl/haiku: minor surface management cleanups
authorEmil Velikov <emil.l.velikov@gmail.com>
Thu, 11 Jun 2015 11:33:55 +0000 (12:33 +0100)
committerEmil Velikov <emil.l.velikov@gmail.com>
Fri, 12 Jun 2015 14:17:44 +0000 (15:17 +0100)
Drop the stub/unused function haiku_create_surface() and add some basic implementation for destroy_surface()

Cc: Alexander von Gluck IV <kallisti5@unixzen.com>
Acked-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
src/egl/drivers/haiku/egl_haiku.cpp

index 2933acc95cc68f2530f0113410a1b77e1a58ee79..154b3af7e07b015225180c2b20ffb21c44d1566f 100644 (file)
@@ -76,17 +76,6 @@ struct haiku_egl_surface
 };
 
 
-/**
- * Called via eglCreateWindowSurface(), drv->API.CreateWindowSurface().
- */
-static _EGLSurface *
-haiku_create_surface(_EGLDriver *drv, _EGLDisplay *disp, EGLint type,
-       _EGLConfig *conf, void *native_surface, const EGLint *attrib_list)
-{
-       return NULL;
-}
-
-
 /**
  * Called via eglCreateWindowSurface(), drv->API.CreateWindowSurface().
  */
@@ -147,6 +136,10 @@ haiku_create_pbuffer_surface(_EGLDriver *drv, _EGLDisplay *disp,
 static EGLBoolean
 haiku_destroy_surface(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf)
 {
+       if (_eglPutSurface(surf)) {
+               // XXX: detach haiku_egl_surface::gl from the native window and destroy it
+               free(surf);
+        }
        return EGL_TRUE;
 }