From 2148b1d2f6fd3d8a67d3fbd69b67f6eb45490d84 Mon Sep 17 00:00:00 2001 From: Christopher Michael Date: Sat, 9 Jul 2011 13:48:39 +0000 Subject: [PATCH] Evas: Remove dependency on xcb-aux and add code to find the visual based on id, as we were only using one function from there. SVN revision: 61171 --- legacy/evas/m4/evas_check_engine.m4 | 8 +++---- .../engines/software_x11/evas_xcb_buffer.c | 24 +++++++++++++++++-- 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/legacy/evas/m4/evas_check_engine.m4 b/legacy/evas/m4/evas_check_engine.m4 index 25803b1bda..e884403df9 100644 --- a/legacy/evas/m4/evas_check_engine.m4 +++ b/legacy/evas/m4/evas_check_engine.m4 @@ -187,10 +187,10 @@ evas_engine_[]$1[]_cflags="" evas_engine_[]$1[]_libs="" PKG_CHECK_MODULES([XCB], - [xcb xcb-shm xcb-image >= 0.2.1 xcb-aux pixman-1], + [xcb xcb-shm xcb-image >= 0.2.1 pixman-1], [ have_dep="yes" - requirement="xcb xcb-shm xcb-image xcb-aux pixman-1" + requirement="xcb xcb-shm xcb-image pixman-1" evas_engine_[]$1[]_cflags="${XCB_CFLAGS}" evas_engine_[]$1[]_libs="${XCB_LIBS}" ],[ @@ -254,10 +254,10 @@ if test "x${have_dep}" = "xyes" ; then fi PKG_CHECK_MODULES([XCB_GL], - [x11-xcb xcb xcb-aux xcb-glx xcb-render xcb-renderutil], + [x11-xcb xcb xcb-glx xcb-render xcb-renderutil], [ have_dep="yes" - requirement="x11-xcb xcb xcb-aux xcb-glx xcb-render xcb-renderutil" + requirement="x11-xcb xcb xcb-glx xcb-render xcb-renderutil" evas_engine_[]$1[]_cflags="${XCB_GL_CFLAGS}" evas_engine_[]$1[]_libs="${XCB_GL_LIBS}" ],[ diff --git a/legacy/evas/src/modules/engines/software_x11/evas_xcb_buffer.c b/legacy/evas/src/modules/engines/software_x11/evas_xcb_buffer.c index 06f0e35fb1..c297aed380 100644 --- a/legacy/evas/src/modules/engines/software_x11/evas_xcb_buffer.c +++ b/legacy/evas/src/modules/engines/software_x11/evas_xcb_buffer.c @@ -1,11 +1,11 @@ #include "evas_common.h" #include "evas_xcb_buffer.h" -#include /* local function prototypes */ static void _xcbob_sync(xcb_connection_t *conn); static xcb_image_t *_xcbob_create_native(xcb_connection_t *conn, int w, int h, xcb_image_format_t format, uint8_t depth, void *base, uint32_t bytes, uint8_t *data); static xcb_format_t *_xcbob_find_format(const xcb_setup_t *setup, uint8_t depth); +static xcb_visualtype_t *_xcbob_find_visual_by_id(xcb_screen_t *screen, xcb_visualid_t id); void evas_software_xcb_write_mask_line(Outbuf *buf, Xcb_Output_Buffer *xcbob, DATA32 *src, int w, int y) @@ -230,7 +230,7 @@ evas_software_xcb_can_do_shm(xcb_connection_t *conn, xcb_screen_t *screen) if (conn == cached_conn) return cached_result; cached_conn = conn; - visual = xcb_aux_find_visual_by_id(screen, screen->root_visual); + visual = _xcbob_find_visual_by_id(screen, screen->root_visual); xcbob = evas_software_xcb_output_buffer_new(conn, visual, screen->root_depth, @@ -468,3 +468,23 @@ _xcbob_find_format(const xcb_setup_t *setup, uint8_t depth) return 0; } + +static xcb_visualtype_t * +_xcbob_find_visual_by_id(xcb_screen_t *screen, xcb_visualid_t id) +{ + xcb_depth_iterator_t diter; + xcb_visualtype_iterator_t viter; + + diter = xcb_screen_allowed_depths_iterator(screen); + for (; diter.rem; xcb_depth_next(&diter)) + { + viter = xcb_depth_visuals_iterator(diter.data); + for (; viter.rem; xcb_visualtype_next(&viter)) + { + if (viter.data->visual_id == id) + return viter.data; + } + } + + return 0; +}