EGLConfig GLStateEGL::select_best_config(std::vector<EGLConfig>& configs) { int best_score(INT_MIN); EGLConfig best_config(0); /* * Go through all the configs and choose the one with the best score, * i.e., the one better matching the requested config. */ for (std::vector<EGLConfig>::const_iterator iter = configs.begin(); iter != configs.end(); iter++) { const EGLConfig config(*iter); GLVisualConfig vc; int score; get_glvisualconfig(config, vc); score = vc.match_score(requested_visual_config_); if (score > best_score) { best_score = score; best_config = config; } } return best_config; }
jint Java_org_linaro_glmark2_native_scoreConfig(JNIEnv* env, jclass clazz, jobject jvc, jobject jtarget) { static_cast<void>(clazz); GLVisualConfig vc; GLVisualConfig target; gl_visual_config_from_jobject(env, jvc, vc); gl_visual_config_from_jobject(env, jtarget, target); return vc.match_score(target); }