patrace/src/tracer/egltrace.cpp
void BinAndMeta::saveAllEGLConfigs(EGLDisplay dpy)
{
    int cfgCnt = 0;

    _eglGetConfigs(dpy, NULL, 0, &cfgCnt);
    EGLConfig* cfgArray = new(nothrow) EGLConfig[cfgCnt];
    if (cfgArray == NULL)
    {
        DBG_LOG("malloc failed\n");
        os::abort();
    }
    else
    {
        EGLint numCfgsReturned = 0;
        _eglGetConfigs(dpy, cfgArray, cfgCnt, &numCfgsReturned);
        std::lock_guard<std::recursive_mutex> guard(gTraceOut->callMutex); // changing global EGL config state
        configIdToConfigAttribsMap.clear();
        configIdToConfigAttribsMap[0] = MyEGLAttribs();     // create an all-zero attribs for EGL_CONFIG_ID=0
        for (EGLint i = 0; i < cfgCnt; i++)
        {
            EGLint cfgId;
            _eglGetConfigAttrib(dpy, cfgArray[i], EGL_CONFIG_ID, &cfgId);
            configIdToConfigAttribsMap[cfgId] = GetEGLConfigValues(dpy,cfgArray[i]);
        }
        delete[] cfgArray;
    }
}
// Save all EGL configs beforehand so we know what EGL_CONFIG_ID maps to a EGL_CONFIG
// also, make a map between EGL attribs and config id's
Save all EGL configs beforehand so we know what EGL_CONFIG_ID maps to a EGL_CONFIG
also, make a map between EGL attribs and config id's
Save all EGL configs beforehand so we know what EGL_CONFIG_ID maps to a EGL_CONFIG also make a map between EGL attribs and config id ' s
void BinAndMeta::saveAllEGLConfigs(EGLDisplay dpy)
{
    int cfgCnt = 0;
    _eglGetConfigs(dpy, NULL, 0, &cfgCnt);
    EGLConfig* cfgArray = new(nothrow) EGLConfig[cfgCnt];
    if (cfgArray == NULL)
    {
        DBG_LOG("malloc failed\n");
        os::abort();
    }
    else
    {
        EGLint numCfgsReturned = 0;
        _eglGetConfigs(dpy, cfgArray, cfgCnt, &numCfgsReturned);
        std::lock_guard<std::recursive_mutex> guard(gTraceOut->callMutex); 
        configIdToConfigAttribsMap.clear();
        configIdToConfigAttribsMap[0] = MyEGLAttribs();     
        for (EGLint i = 0; i < cfgCnt; i++)
        {
            EGLint cfgId;
            _eglGetConfigAttrib(dpy, cfgArray[i], EGL_CONFIG_ID, &cfgId);
            configIdToConfigAttribsMap[cfgId] = GetEGLConfigValues(dpy,cfgArray[i]);
        }
        delete[] cfgArray;
    }
}
void BinAndMeta :: saveAllEGLConfigs ( EGLDisplay dpy ) { int cfgCnt = 0 ; _eglGetConfigs ( dpy , NULL , 0 , & cfgCnt ) ; EGLConfig * cfgArray = new ( nothrow ) EGLConfig [ cfgCnt ] ; if ( cfgArray == NULL ) { DBG_LOG ( " \n " ) ; os :: abort ( ) ; } else { EGLint numCfgsReturned = 0 ; _eglGetConfigs ( dpy , cfgArray , cfgCnt , & numCfgsReturned ) ; std :: lock_guard < std :: recursive_mutex > guard ( gTraceOut -> callMutex ) ; configIdToConfigAttribsMap . clear ( ) ; configIdToConfigAttribsMap [ 0 ] = MyEGLAttribs ( ) ; for ( EGLint i = 0 ; i < cfgCnt ; i ++ ) { EGLint cfgId ; _eglGetConfigAttrib ( dpy , cfgArray [ i ] , EGL_CONFIG_ID , & cfgId ) ; configIdToConfigAttribsMap [ cfgId ] = GetEGLConfigValues ( dpy , cfgArray [ i ] ) ; } delete [ ] cfgArray ; } }
Save all EGL configs beforehand so we know what EGL_CONFIG_ID maps to a EGL_CONFIG
also, make a map between EGL attribs and config id's
Save all EGL configs beforehand so we know what EGL_CONFIG_ID maps to a EGL_CONFIG also make a map between EGL attribs and config id ' s
// changing global EGL config state // create an all-zero attribs for EGL_CONFIG_ID=0