[Mesa-dev] [PATCH 08/10] egl/haiku: minor surface management cleanups

Emil Velikov emil.l.velikov at gmail.com
Thu Jun 11 05:15:13 PDT 2015


Drop the stub/unused function haiku_create_surface() and add some basic implementation for destroy_surface()

Cc: Alexander von Gluck IV <kallisti5 at unixzen.com>
Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
---
 src/egl/drivers/haiku/egl_haiku.cpp | 15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)

diff --git a/src/egl/drivers/haiku/egl_haiku.cpp b/src/egl/drivers/haiku/egl_haiku.cpp
index 2933acc..154b3af 100644
--- a/src/egl/drivers/haiku/egl_haiku.cpp
+++ b/src/egl/drivers/haiku/egl_haiku.cpp
@@ -80,17 +80,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().
- */
-static _EGLSurface *
 haiku_create_window_surface(_EGLDriver *drv, _EGLDisplay *disp,
 	_EGLConfig *conf, void *native_window, const EGLint *attrib_list)
 {
@@ -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;
 }
 
-- 
2.4.2



More information about the mesa-dev mailing list