From da4898adecbb09ffe5cdef1b48e8e09e243d7f3e Mon Sep 17 00:00:00 2001 From: Shuang He Date: Wed, 14 Jul 2010 09:48:41 +0800 Subject: [PATCH] egl: eglGetConfigs should return num of available configs when parameter configs = NULL According to egl 1.4 spec, "if eglGetConfigs is called with configs = NULL, then no configurations are returned, but the total number of configurations available will be returned in num_config" --- src/egl/main/eglconfig.c | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/egl/main/eglconfig.c b/src/egl/main/eglconfig.c index a9af320..69ed2a2 100644 --- a/src/egl/main/eglconfig.c +++ b/src/egl/main/eglconfig.c @@ -821,8 +821,11 @@ _eglGetConfigs(_EGLDriver *drv, _EGLDisplay *disp, EGLConfig *configs, if (!num_config) return _eglError(EGL_BAD_PARAMETER, "eglGetConfigs"); - *num_config = _eglFlattenArray(disp->Configs, (void *) configs, - sizeof(configs[0]), config_size, _eglFlattenConfig); + if (!configs) + *num_config = disp->Configs->Size; + else + *num_config = _eglFlattenArray(disp->Configs, (void *) configs, + sizeof(configs[0]), config_size, _eglFlattenConfig); return EGL_TRUE; } -- 1.6.0.6