From e8ba2812e6995d1ec95c972a1b48ac29a99531dd Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Wed, 5 May 2010 17:37:19 +0800 Subject: [PATCH] egl: Add _eglSearchPathForEach. The function can be used by a driver to check each search path of EGL. --- src/egl/main/egldriver.c | 15 +++++++++++++++ src/egl/main/egldriver.h | 5 +++++ 2 files changed, 20 insertions(+) diff --git a/src/egl/main/egldriver.c b/src/egl/main/egldriver.c index 6384242b093..052e6110bfb 100644 --- a/src/egl/main/egldriver.c +++ b/src/egl/main/egldriver.c @@ -652,6 +652,21 @@ _eglInitDriverFallbacks(_EGLDriver *drv) } +/** + * Invoke a callback function on each EGL search path. + * + * The first argument of the callback function is the name of the search path. + * The second argument is the length of the name. + */ +void +_eglSearchPathForEach(EGLBoolean (*callback)(const char *, size_t, void *), + void *callback_data) +{ + const char *search_path = _eglGetSearchPath(); + _eglPreloadForEach(search_path, callback, callback_data); +} + + /** * Set the probe cache at the given key. * diff --git a/src/egl/main/egldriver.h b/src/egl/main/egldriver.h index 55686681dcb..28b79562f80 100644 --- a/src/egl/main/egldriver.h +++ b/src/egl/main/egldriver.h @@ -88,6 +88,11 @@ PUBLIC void _eglInitDriverFallbacks(_EGLDriver *drv); +PUBLIC void +_eglSearchPathForEach(EGLBoolean (*callback)(const char *, size_t, void *), + void *callback_data); + + PUBLIC void _eglSetProbeCache(EGLint key, const void *val); -- 2.30.2