void EglDisplay::addMissingConfigs(void) { m_configs.sort(compareEglConfigsPtrs); EGLConfig match; EglConfig dummy(5, 6, 5, 0, // RGB_565 EGL_DONT_CARE, EGL_DONT_CARE, 16, // Depth EGL_DONT_CARE, EGL_DONT_CARE, EGL_DONT_CARE, EGL_DONT_CARE, EGL_DONT_CARE, EGL_DONT_CARE, EGL_DONT_CARE, EGL_DONT_CARE, EGL_DONT_CARE, EGL_DONT_CARE, EGL_DONT_CARE, EGL_DONT_CARE, EGL_DONT_CARE, EGL_DONT_CARE, EGL_DONT_CARE, NULL); if(!doChooseConfigs(dummy, &match, 1)) { return; } const EglConfig* config = (EglConfig*)match; int bSize; config->getConfAttrib(EGL_BUFFER_SIZE,&bSize); if(bSize == 16) { return; } int max_config_id = 0; for(ConfigsList::iterator it = m_configs.begin(); it != m_configs.end() ;it++) { EGLint id; (*it)->getConfAttrib(EGL_CONFIG_ID, &id); if(id > max_config_id) max_config_id = id; } EglConfig* newConfig = new EglConfig(*config,max_config_id+1,5,6,5,0); m_configs.push_back(newConfig); }
int EglDisplay::chooseConfigs(const EglConfig& dummy,EGLConfig* configs,int config_size) { android::Mutex::Autolock mutex(m_lock); return doChooseConfigs(dummy, configs, config_size); }