From 655e4598927728a663f4cfcd6babdf7e5ad83f77 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Thu, 13 Jan 2011 00:27:45 +0800 Subject: egl: Simplify driver matching. Add initialization options that drv->API.Initialize should support. Replace drv->Probe by TestOnly initialization option and simplify _eglMatchDriver. --- src/egl/drivers/dri2/egl_dri2.c | 4 ++++ src/egl/drivers/glx/egl_glx.c | 3 +++ 2 files changed, 7 insertions(+) (limited to 'src/egl/drivers') diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c index f6bca4abf7..2e827f4f3e 100644 --- a/src/egl/drivers/dri2/egl_dri2.c +++ b/src/egl/drivers/dri2/egl_dri2.c @@ -1472,10 +1472,14 @@ dri2_initialize(_EGLDriver *drv, _EGLDisplay *disp) { switch (disp->Platform) { case _EGL_PLATFORM_X11: + if (disp->Options.TestOnly) + return EGL_TRUE; return dri2_initialize_x11(drv, disp); #ifdef HAVE_LIBUDEV case _EGL_PLATFORM_DRM: + if (disp->Options.TestOnly) + return EGL_TRUE; return dri2_initialize_drm(drv, disp); #endif diff --git a/src/egl/drivers/glx/egl_glx.c b/src/egl/drivers/glx/egl_glx.c index 84b04f7967..aecebae40c 100644 --- a/src/egl/drivers/glx/egl_glx.c +++ b/src/egl/drivers/glx/egl_glx.c @@ -589,6 +589,9 @@ GLX_eglInitialize(_EGLDriver *drv, _EGLDisplay *disp) if (disp->Platform != _EGL_PLATFORM_X11) return EGL_FALSE; + if (disp->Options.TestOnly) + return EGL_TRUE; + GLX_dpy = CALLOC_STRUCT(GLX_egl_display); if (!GLX_dpy) return _eglError(EGL_BAD_ALLOC, "eglInitialize"); -- cgit v1.2.3