From f2aa361f3b58a91780c9358b3f8716f6434074c7 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Sun, 4 Jul 2010 15:55:12 +0800 Subject: egl: Rework driver loading. Driver loading is now splitted into two stages. In the first stage, an _EGLModule is created for each driver: user driver, default drivers, and all files in the search directories that start with "egl_". Modules are not loaded at this stage. In the second stage, each module is loaded to initialize a display. The process stops at the first module that can initialize the display. If eglGetProcAddress is called before eglInitialize, the same code path will be taken to find the first module that supports EGL_DEFAULT_DISPLAY. Because we do not want to initialize the display, drv->Probe is used instead in this case. --- src/egl/main/eglarray.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/egl/main/eglarray.c') diff --git a/src/egl/main/eglarray.c b/src/egl/main/eglarray.c index 41550bb4be..781d07fc1c 100644 --- a/src/egl/main/eglarray.c +++ b/src/egl/main/eglarray.c @@ -83,6 +83,22 @@ _eglAppendArray(_EGLArray *array, void *elem) } +/** + * Erase an element from an array. + */ +void +_eglEraseArray(_EGLArray *array, EGLint i, void (*free_cb)(void *)) +{ + if (free_cb) + free_cb(array->Elements[i]); + if (i < array->Size - 1) { + memmove(&array->Elements[i], &array->Elements[i + 1], + (array->Size - i - 1) * sizeof(array->Elements[0])); + } + array->Size--; +} + + /** * Find in an array for the given element. */ -- cgit v1.2.3