Enlightenment CVS committal Author : doursse Project : e17 Module : libs/evas
Dir : e17/libs/evas/src/modules/engines/software_xcb Modified Files: Evas_Engine_Software_Xcb.h evas_engine.c evas_engine.h evas_outbuf.c evas_xcb_buffer.c Log Message: pass the default screen to the info, as it is not stored by XCB itself. Speed up a bit evas_software_xcb_x_can_do_shm =================================================================== RCS file: /cvs/e/e17/libs/evas/src/modules/engines/software_xcb/Evas_Engine_Software_Xcb.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -3 -r1.5 -r1.6 --- Evas_Engine_Software_Xcb.h 1 Oct 2006 18:26:24 -0000 1.5 +++ Evas_Engine_Software_Xcb.h 27 Feb 2007 16:08:41 -0000 1.6 @@ -14,6 +14,7 @@ /* engine specific data & parameters it needs to set up */ struct { xcb_connection_t *conn; + xcb_screen_t *screen; xcb_drawable_t drawable; xcb_drawable_t mask; xcb_visualtype_t *visual; @@ -38,6 +39,7 @@ Evas_Performance *(*performance_test) (Evas *e, xcb_connection_t *conn, + xcb_screen_t *screen, xcb_visualtype_t *vis, xcb_colormap_t cmap, xcb_drawable_t draw, @@ -47,6 +49,7 @@ char * (*performance_key_get) (Evas_Performance *perf); Evas_Performance *(*performance_new) (Evas *e, xcb_connection_t *conn, + xcb_screen_t *screen, xcb_visualtype_t *vis, xcb_colormap_t cmap, xcb_drawable_t draw, =================================================================== RCS file: /cvs/e/e17/libs/evas/src/modules/engines/software_xcb/evas_engine.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -3 -r1.16 -r1.17 --- evas_engine.c 13 Nov 2006 23:23:44 -0000 1.16 +++ evas_engine.c 27 Feb 2007 16:08:41 -0000 1.17 @@ -20,12 +20,12 @@ }; /* prototypes we will use here */ -static void *_output_setup(int w, int h, int rot, xcb_connection_t *conn, xcb_drawable_t draw, xcb_visualtype_t *vis, xcb_colormap_t cmap, int depth, int debug, int grayscale, int max_colors, xcb_drawable_t mask, int shape_dither, int destination_alpha); +static void *_output_setup(int w, int h, int rot, xcb_connection_t *conn, xcb_screen_t *screen, xcb_drawable_t draw, xcb_visualtype_t *vis, xcb_colormap_t cmap, int depth, int debug, int grayscale, int max_colors, xcb_drawable_t mask, int shape_dither, int destination_alpha); static xcb_visualtype_t *_best_visual_get(xcb_connection_t *conn, int screen); static xcb_colormap_t _best_colormap_get(xcb_connection_t *conn, int screen); static int _best_depth_get(xcb_connection_t *conn, int screen); -static Evas_Performance *_output_perf_new(Evas *e, xcb_connection_t *conn, xcb_visualtype_t *vis, xcb_colormap_t cmap, xcb_drawable_t draw, int depth); -static Evas_Performance *_output_perf_test(Evas *e, xcb_connection_t *conn, xcb_visualtype_t *vis, xcb_colormap_t cmap, xcb_drawable_t draw, int depth); +static Evas_Performance *_output_perf_new(Evas *e, xcb_connection_t *conn, xcb_screen_t *screen, xcb_visualtype_t *vis, xcb_colormap_t cmap, xcb_drawable_t draw, int depth); +static Evas_Performance *_output_perf_test(Evas *e, xcb_connection_t *conn, xcb_screen_t *screen, xcb_visualtype_t *vis, xcb_colormap_t cmap, xcb_drawable_t draw, int depth); static char *_output_perf_data(Evas_Performance *perf); static char *_output_perf_key(Evas_Performance *perf); static void _output_perf_free(Evas_Performance *perf); @@ -50,6 +50,7 @@ int h, int rot, xcb_connection_t *conn, + xcb_screen_t *screen, xcb_drawable_t draw, xcb_visualtype_t *vis, xcb_colormap_t cmap, @@ -85,10 +86,11 @@ evas_software_xcb_outbuf_init(); /* get any stored performance metrics from device (xserver) */ - perf = evas_software_xcb_outbuf_perf_restore_x(conn, draw, vis, cmap, depth); + perf = evas_software_xcb_outbuf_perf_restore_x(conn, screen, draw, vis, cmap, depth); re->ob = evas_software_xcb_outbuf_setup_x(w, h, rot, OUTBUF_DEPTH_INHERIT, conn, + screen, draw, vis, cmap, @@ -184,16 +186,16 @@ } static Evas_Performance * -_output_perf_new(Evas *e, xcb_connection_t *conn, xcb_visualtype_t *vis, xcb_colormap_t cmap, xcb_drawable_t draw, int depth) +_output_perf_new(Evas *e, xcb_connection_t *conn, xcb_screen_t *screen, xcb_visualtype_t *vis, xcb_colormap_t cmap, xcb_drawable_t draw, int depth) { - return evas_software_xcb_outbuf_perf_x(conn, draw, vis, cmap, depth); + return evas_software_xcb_outbuf_perf_x(conn, screen, draw, vis, cmap, depth); e = NULL; } static Evas_Performance * -_output_perf_test(Evas *e, xcb_connection_t *conn, xcb_visualtype_t *vis, xcb_colormap_t cmap, xcb_drawable_t draw, int depth) +_output_perf_test(Evas *e, xcb_connection_t *conn, xcb_screen_t *screen, xcb_visualtype_t *vis, xcb_colormap_t cmap, xcb_drawable_t draw, int depth) { - return evas_software_xcb_outbuf_perf_x(conn, draw, vis, cmap, depth); + return evas_software_xcb_outbuf_perf_x(conn, screen, draw, vis, cmap, depth); e = NULL; } @@ -275,6 +277,7 @@ e->output.h, info->info.rotation, info->info.conn, + info->info.screen, info->info.drawable, info->info.visual, info->info.colormap, @@ -294,11 +297,12 @@ info->info.rotation, OUTBUF_DEPTH_INHERIT, info->info.conn, + info->info.screen, info->info.drawable, info->info.visual, info->info.colormap, info->info.depth, - evas_software_xcb_outbuf_perf_restore_x(info->info.conn, info->info.drawable, info->info.visual, info->info.colormap, info->info.depth), + evas_software_xcb_outbuf_perf_restore_x(info->info.conn, info->info.screen, info->info.drawable, info->info.visual, info->info.colormap, info->info.depth), info->info.alloc_grayscale, info->info.alloc_colors_max, info->info.mask, =================================================================== RCS file: /cvs/e/e17/libs/evas/src/modules/engines/software_xcb/evas_engine.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -3 -r1.7 -r1.8 --- evas_engine.h 10 Oct 2006 19:32:36 -0000 1.7 +++ evas_engine.h 27 Feb 2007 16:08:41 -0000 1.8 @@ -37,6 +37,7 @@ Convert_Pal *pal; struct { xcb_connection_t *conn; + xcb_screen_t *screen; xcb_drawable_t win; xcb_drawable_t mask; xcb_visualtype_t *vis; @@ -117,7 +118,8 @@ DATA32 *src, int w, int y); -int evas_software_xcb_x_can_do_shm (xcb_connection_t *c); +int evas_software_xcb_x_can_do_shm (xcb_connection_t *c, + xcb_screen_t *screen); Xcb_Output_Buffer *evas_software_xcb_x_output_buffer_new (xcb_connection_t *c, int depth, int w, @@ -158,6 +160,7 @@ int rot, Outbuf_Depth depth, xcb_connection_t *conn, + xcb_screen_t *screen, xcb_drawable_t draw, xcb_visualtype_t *vis, xcb_colormap_t cmap, @@ -173,6 +176,7 @@ void evas_software_xcb_outbuf_perf_deserialize_x (Outbuf_Perf *perf, const char *data); Outbuf_Perf *evas_software_xcb_outbuf_perf_new_x (xcb_connection_t *conn, + xcb_screen_t *screen, xcb_drawable_t draw, xcb_visualtype_t *vis, xcb_colormap_t cmap, @@ -181,12 +185,14 @@ char *evas_software_xcb_outbuf_perf_serialize_info_x (Outbuf_Perf *perf); void evas_software_xcb_outbuf_perf_store_x (Outbuf_Perf *perf); Outbuf_Perf *evas_software_xcb_outbuf_perf_restore_x (xcb_connection_t *conn, + xcb_screen_t *screen, xcb_drawable_t draw, xcb_visualtype_t *vis, xcb_colormap_t cmap, int x_depth); void evas_software_xcb_outbuf_perf_free (Outbuf_Perf *perf); Outbuf_Perf *evas_software_xcb_outbuf_perf_x (xcb_connection_t *conn, + xcb_screen_t *screen, xcb_drawable_t draw, xcb_visualtype_t *vis, xcb_colormap_t cmap, =================================================================== RCS file: /cvs/e/e17/libs/evas/src/modules/engines/software_xcb/evas_outbuf.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -3 -r1.14 -r1.15 --- evas_outbuf.c 27 Feb 2007 15:17:18 -0000 1.14 +++ evas_outbuf.c 27 Feb 2007 16:08:41 -0000 1.15 @@ -40,6 +40,7 @@ int rot, Outbuf_Depth depth, xcb_connection_t *conn, + xcb_screen_t *screen, xcb_drawable_t draw, xcb_visualtype_t *vis, xcb_colormap_t cmap, @@ -63,6 +64,7 @@ buf->rot = rot; buf->priv.x.conn = conn; + buf->priv.x.screen = screen; buf->priv.x.vis = vis; buf->priv.x.cmap = cmap; buf->priv.x.depth = x_depth; @@ -74,7 +76,7 @@ Gfx_Func_Convert conv_func; Xcb_Output_Buffer *xcbob; - buf->priv.x.shm = evas_software_xcb_x_can_do_shm(buf->priv.x.conn); + buf->priv.x.shm = evas_software_xcb_x_can_do_shm(buf->priv.x.conn, buf->priv.x.screen); xcbob = evas_software_xcb_x_output_buffer_new(buf->priv.x.conn, buf->priv.x.depth, 1, 1, @@ -765,6 +767,7 @@ Outbuf_Perf * evas_software_xcb_outbuf_perf_new_x(xcb_connection_t *conn, + xcb_screen_t *screen, xcb_drawable_t draw, xcb_visualtype_t *vis, xcb_colormap_t cmap, @@ -785,8 +788,7 @@ perf->min_shm_image_pixel_count = 200 * 200; /* default hard-coded */ #if 0 - /* FIXME: should use the default screen */ - root = xcb_setup_roots_iterator ((xcb_setup_t *)xcb_get_setup (conn)).data->root; + root = screen->root; if (draw) { xcb_get_geometry_reply_t *geom; @@ -812,7 +814,7 @@ } perf->x.root = root; - perf->x.display = strdup (":0"); /* FIXME: strdup(DisplayString(disp)); in XCB ? */ + perf->x.display = strdup (":0"); /* FIXME: there's no way to get the display value with XCB */ perf->x.vendor = strdup(xcb_setup_vendor((xcb_setup_t *)xcb_get_setup(conn))); perf->x.version = (int)((xcb_setup_t *)xcb_get_setup(conn))->protocol_major_version; perf->x.revision = (int)((xcb_setup_t *)xcb_get_setup(conn))->protocol_minor_version; @@ -964,6 +966,7 @@ Outbuf_Perf * evas_software_xcb_outbuf_perf_restore_x(xcb_connection_t *conn, + xcb_screen_t *screen, xcb_drawable_t draw, xcb_visualtype_t *vis, xcb_colormap_t cmap, @@ -979,7 +982,7 @@ #endif Outbuf_Perf *perf; - perf = evas_software_xcb_outbuf_perf_new_x(conn, draw, vis, cmap, x_depth); + perf = evas_software_xcb_outbuf_perf_new_x(conn, screen, draw, vis, cmap, x_depth); return perf; #if 0 @@ -1040,6 +1043,7 @@ Outbuf_Perf * evas_software_xcb_outbuf_perf_x(xcb_connection_t *conn, + xcb_screen_t *screen, xcb_drawable_t draw, xcb_visualtype_t *vis, xcb_colormap_t cmap, @@ -1054,7 +1058,7 @@ int w, h; int do_shm = 0; - perf = evas_software_xcb_outbuf_perf_new_x(conn, draw, vis, cmap, x_depth); + perf = evas_software_xcb_outbuf_perf_new_x(conn, screen, draw, vis, cmap, x_depth); mask = XCB_CW_BACK_PIXMAP | XCB_CW_BORDER_PIXEL | XCB_CW_BIT_GRAVITY | XCB_CW_BACKING_STORE | @@ -1087,7 +1091,7 @@ xcb_configure_window (conn, win, mask, value2); xcb_map_window (conn, win); - do_shm = evas_software_xcb_x_can_do_shm(conn); + do_shm = evas_software_xcb_x_can_do_shm(conn, screen); /* set it to something ridiculous to start */ perf->min_shm_image_pixel_count = w * w; =================================================================== RCS file: /cvs/e/e17/libs/evas/src/modules/engines/software_xcb/evas_xcb_buffer.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -3 -r1.10 -r1.11 --- evas_xcb_buffer.c 27 Feb 2007 15:17:18 -0000 1.10 +++ evas_xcb_buffer.c 27 Feb 2007 16:08:41 -0000 1.11 @@ -60,31 +60,21 @@ } int -evas_software_xcb_x_can_do_shm(xcb_connection_t *c) +evas_software_xcb_x_can_do_shm(xcb_connection_t *c, + xcb_screen_t *screen) { static xcb_connection_t *cached_c = NULL; static int cached_result = 0; - xcb_get_geometry_reply_t *geom; - xcb_drawable_t drawable; - int depth; if (c == cached_c) return cached_result; cached_c = c; - /* FIXME: get the corect screen */ - drawable = xcb_setup_roots_iterator (xcb_get_setup(c)).data->root; - geom = xcb_get_geometry_reply (c, xcb_get_geometry_unchecked(c, drawable), 0); - if(!geom) - return 0; - - depth = geom->depth; - free (geom); if (xcb_get_extension_data(c, &xcb_shm_id)) { Xcb_Output_Buffer *xcbob; xcbob = evas_software_xcb_x_output_buffer_new(c, - depth, + screen->root_depth, 16, 16, 2, ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs