diff options
Diffstat (limited to 'src/egl/drivers')
-rw-r--r-- | src/egl/drivers/dri2/egl_dri2.c | 13 | ||||
-rw-r--r-- | src/egl/drivers/haiku/egl_haiku.cpp | 15 |
2 files changed, 22 insertions, 6 deletions
diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c index 0750dc19469..d7a88b29844 100644 --- a/src/egl/drivers/dri2/egl_dri2.c +++ b/src/egl/drivers/dri2/egl_dri2.c @@ -3191,11 +3191,16 @@ dri2_interop_export_object(_EGLDisplay *dpy, _EGLContext *ctx, /** * This is the main entrypoint into the driver, called by libEGL. - * Gets an _EGLDriver object and init its dispatch table. + * Create a new _EGLDriver object and init its dispatch table. */ -void -_eglInitDriver(_EGLDriver *dri2_drv) +_EGLDriver * +_eglBuiltInDriver(void) { + _EGLDriver *dri2_drv = calloc(1, sizeof *dri2_drv); + if (!dri2_drv) + return NULL; + + _eglInitDriverFallbacks(dri2_drv); dri2_drv->API.Initialize = dri2_initialize; dri2_drv->API.Terminate = dri2_terminate; dri2_drv->API.CreateContext = dri2_create_context; @@ -3246,4 +3251,6 @@ _eglInitDriver(_EGLDriver *dri2_drv) dri2_drv->API.DupNativeFenceFDANDROID = dri2_dup_native_fence_fd; dri2_drv->Name = "DRI2"; + + return dri2_drv; } diff --git a/src/egl/drivers/haiku/egl_haiku.cpp b/src/egl/drivers/haiku/egl_haiku.cpp index 590e43f00fb..237cebf056e 100644 --- a/src/egl/drivers/haiku/egl_haiku.cpp +++ b/src/egl/drivers/haiku/egl_haiku.cpp @@ -305,14 +305,21 @@ haiku_swap_buffers(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surf) /** * This is the main entrypoint into the driver, called by libEGL. - * Gets an _EGLDriver object and init its dispatch table. + * Create a new _EGLDriver object and init its dispatch table. */ extern "C" -void -_eglInitDriver(_EGLDriver *driver) +_EGLDriver* +_eglBuiltInDriver(void) { CALLED(); + _EGLDriver* driver = calloc(1, sizeof(*driver)); + if (!driver) { + _eglError(EGL_BAD_ALLOC, "_eglBuiltInDriverHaiku"); + return NULL; + } + + _eglInitDriverFallbacks(driver); driver->API.Initialize = init_haiku; driver->API.Terminate = haiku_terminate; driver->API.CreateContext = haiku_create_context; @@ -328,4 +335,6 @@ _eglInitDriver(_EGLDriver *driver) driver->Name = "Haiku"; TRACE("API Calls defined\n"); + + return driver; } |