diff options
author | Rob Herring <[email protected]> | 2016-02-02 14:23:10 -0600 |
---|---|---|
committer | Emil Velikov <[email protected]> | 2016-02-18 17:47:33 +0000 |
commit | ba06ea1a37fd6f4807a70e12fa2581a027d6358d (patch) | |
tree | 588092ae05bcbd7572446c7a1754897d85411874 | |
parent | e35c5af337524011c3d4f37ca3dbfca28d33ccad (diff) |
egl: android: clean-up config attribute setting
Pass the additional config attributes to dri2_add_config to set them
instead of open coding them. This is in preparation to add more attributes.
Signed-off-by: Rob Herring <[email protected]>
Reviewed-by: Emil Velikov <[email protected]>
-rw-r--r-- | src/egl/drivers/dri2/platform_android.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/egl/drivers/dri2/platform_android.c b/src/egl/drivers/dri2/platform_android.c index b622b00105f..7d546650272 100644 --- a/src/egl/drivers/dri2/platform_android.c +++ b/src/egl/drivers/dri2/platform_android.c @@ -534,12 +534,20 @@ droid_add_configs_for_visuals(_EGLDriver *drv, _EGLDisplay *dpy) { HAL_PIXEL_FORMAT_BGRA_8888, { 0xff0000, 0xff00, 0xff, 0xff000000 } }, { 0, { 0, 0, 0, 0 } } }; + EGLint config_attrs[] = { + EGL_NATIVE_VISUAL_ID, 0, + EGL_NATIVE_VISUAL_TYPE, 0, + EGL_NONE + }; int count, i, j; count = 0; for (i = 0; visuals[i].format; i++) { int format_count = 0; + config_attrs[1] = visuals[i].format; + config_attrs[3] = visuals[i].format; + for (j = 0; dri2_dpy->driver_configs[j]; j++) { const EGLint surface_type = EGL_WINDOW_BIT | EGL_PBUFFER_BIT; struct dri2_egl_config *dri2_conf; @@ -553,10 +561,8 @@ droid_add_configs_for_visuals(_EGLDriver *drv, _EGLDisplay *dpy) continue; dri2_conf = dri2_add_config(dpy, dri2_dpy->driver_configs[j], - count + 1, surface_type, NULL, visuals[i].rgba_masks); + count + 1, surface_type, config_attrs, visuals[i].rgba_masks); if (dri2_conf) { - dri2_conf->base.NativeVisualID = visuals[i].format; - dri2_conf->base.NativeVisualType = visuals[i].format; count++; format_count++; } |