egl/x11: store xcb_screen_t *screen instead of int screen
authorEmil Velikov <emil.velikov@collabora.com>
Mon, 21 Nov 2016 13:46:51 +0000 (13:46 +0000)
committerEmil Velikov <emil.l.velikov@gmail.com>
Tue, 22 Nov 2016 15:13:41 +0000 (15:13 +0000)
commit7c6babb22c83d0cde747ec57c5ceb3c9e037c626
treebcad910dd6a611de75d7c6e2a9ba8c0907fe216c
parentb9880d2e93a260c348b9413cb2c633365ba13b6e
egl/x11: store xcb_screen_t *screen instead of int screen

Just fetch and store it once, rather than doing the
xcb_setup_roots_iterator + get_xcb_screen dance five times.

v2: Call xcb_disconnect() on error (Eric)

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com> (v1)
src/egl/drivers/dri2/egl_dri2.h
src/egl/drivers/dri2/platform_x11.c
src/egl/drivers/dri2/platform_x11_dri3.c