From: devilhorns Date: Fri, 19 Aug 2011 20:36:26 +0000 (+0000) Subject: Ecore_X(cb): Cache the visual and avoid extra lookups. X-Git-Tag: accepted/2.0/20130306.224007~156^2~128 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=aed3380e62aec250052d875515ff825bb2585e46;p=profile%2Fivi%2Fecore.git Ecore_X(cb): Cache the visual and avoid extra lookups. git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/ecore@62597 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- diff --git a/src/lib/ecore_x/xcb/ecore_xcb_window.c b/src/lib/ecore_x/xcb/ecore_xcb_window.c index f917e0e..8f0ac6b 100644 --- a/src/lib/ecore_x/xcb/ecore_xcb_window.c +++ b/src/lib/ecore_x/xcb/ecore_xcb_window.c @@ -1619,19 +1619,25 @@ static Ecore_X_Window _ecore_xcb_window_argb_internal_new(Ecore_X_Window parent, int x, int y, int w, int h, uint8_t override_redirect, uint8_t save_under) { Ecore_X_Window win = 0; - - LOGFN(__FILE__, __LINE__, __FUNCTION__); - #ifdef ECORE_XCB_RENDER uint32_t value_list[10]; - uint32_t value_mask, vis; + uint32_t value_mask; + static uint32_t vis = -1; Ecore_X_Colormap colormap; +#endif + LOGFN(__FILE__, __LINE__, __FUNCTION__); + +#ifdef ECORE_XCB_RENDER if (parent == 0) parent = ((xcb_screen_t *)_ecore_xcb_screen)->root; - vis = - _ecore_xcb_render_find_visual_id(XCB_RENDER_PICT_TYPE_DIRECT, EINA_TRUE); + if (vis < 0) + { + vis = + _ecore_xcb_render_find_visual_id(XCB_RENDER_PICT_TYPE_DIRECT, + EINA_TRUE); + } colormap = xcb_generate_id(_ecore_xcb_conn); xcb_create_colormap(_ecore_xcb_conn, XCB_COLORMAP_ALLOC_NONE,