summaryrefslogtreecommitdiff
path: root/src/egl
diff options
context:
space:
mode:
authorChad Versace <chadversary@chromium.org>2017-06-22 11:00:41 -0700
committerChad Versace <chadversary@chromium.org>2017-06-22 12:35:49 -0700
commitbd789098a53518ac559eba7305876f3dcacdc863 (patch)
treeb2577e17c9cff5abbd1920720522c2e27610ac34 /src/egl
parentcd717cbe1a6c73684dffd91ac6c2e16b3edb38ed (diff)
egl/android: Declare EGLConfig attrib array inside loop (v2)
No behavioral change. Just a readability cleanup. Instead of modifying this small array on each loop iteration, we now initialize it in-place with the values it needs. v2: Rebase. Reviewed-by: Eric Engestrom <eric@engestrom.ch> (v1)
Diffstat (limited to 'src/egl')
-rw-r--r--src/egl/drivers/dri2/platform_android.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/egl/drivers/dri2/platform_android.c b/src/egl/drivers/dri2/platform_android.c
index 705f92dffa2..320ae25f46c 100644
--- a/src/egl/drivers/dri2/platform_android.c
+++ b/src/egl/drivers/dri2/platform_android.c
@@ -1034,13 +1034,6 @@ droid_add_configs_for_visuals(_EGLDriver *drv, _EGLDisplay *dpy)
{ HAL_PIXEL_FORMAT_RGB_565, { 0x0000f800, 0x000007e0, 0x0000001f, 0x00000000 } },
{ HAL_PIXEL_FORMAT_BGRA_8888, { 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000 } },
};
- EGLint config_attrs[] = {
- EGL_NATIVE_VISUAL_ID, 0,
- EGL_NATIVE_VISUAL_TYPE, 0,
- EGL_FRAMEBUFFER_TARGET_ANDROID, EGL_TRUE,
- EGL_RECORDABLE_ANDROID, EGL_TRUE,
- EGL_NONE
- };
unsigned int format_count[ARRAY_SIZE(visuals)] = { 0 };
int count = 0;
@@ -1067,8 +1060,13 @@ droid_add_configs_for_visuals(_EGLDriver *drv, _EGLDisplay *dpy)
for (int j = 0; dri2_dpy->driver_configs[j]; j++) {
const EGLint surface_type = EGL_WINDOW_BIT | EGL_PBUFFER_BIT;
- config_attrs[1] = visuals[i].format;
- config_attrs[3] = visuals[i].format;
+ const EGLint config_attrs[] = {
+ EGL_NATIVE_VISUAL_ID, visuals[i].format,
+ EGL_NATIVE_VISUAL_TYPE, visuals[i].format,
+ EGL_FRAMEBUFFER_TARGET_ANDROID, EGL_TRUE,
+ EGL_RECORDABLE_ANDROID, EGL_TRUE,
+ EGL_NONE
+ };
struct dri2_egl_config *dri2_conf =
dri2_add_config(dpy, dri2_dpy->driver_configs[j],