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 evas_xcb_color.c Log Message: argb target for software xcb engine supported =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/evas/src/modules/engines/software_xcb/Evas_Engine_Software_Xcb.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- Evas_Engine_Software_Xcb.h 2 Mar 2006 09:16:46 -0000 1.1 +++ Evas_Engine_Software_Xcb.h 10 Mar 2006 07:44:23 -0000 1.2 @@ -24,6 +24,7 @@ int alloc_grayscale : 1; int debug : 1; int shape_dither : 1; + int destination_alpha : 1; int alloc_colors_max; } info; =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/evas/src/modules/engines/software_xcb/evas_engine.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -3 -r1.7 -r1.8 --- evas_engine.c 3 Mar 2006 07:36:46 -0000 1.7 +++ evas_engine.c 10 Mar 2006 07:44:23 -0000 1.8 @@ -20,7 +20,7 @@ }; /* prototypes we will use here */ -static void *_output_setup(int w, int h, int rot, XCBConnection *conn, XCBDRAWABLE draw, XCBVISUALTYPE *vis, XCBCOLORMAP cmap, int depth, int debug, int grayscale, int max_colors, XCBDRAWABLE mask, int shape_dither); +static void *_output_setup(int w, int h, int rot, XCBConnection *conn, XCBDRAWABLE draw, XCBVISUALTYPE *vis, XCBCOLORMAP cmap, int depth, int debug, int grayscale, int max_colors, XCBDRAWABLE mask, int shape_dither, int destination_alpha); static XCBVISUALTYPE *_best_visual_get(XCBConnection *conn, int screen); static XCBCOLORMAP _best_colormap_get(XCBConnection *conn, int screen); static int _best_depth_get(XCBConnection *conn, int screen); @@ -58,7 +58,8 @@ int grayscale, int max_colors, XCBDRAWABLE mask, - int shape_dither) + int shape_dither, + int destination_alpha) { Render_Engine *re; Outbuf_Perf *perf; @@ -95,7 +96,9 @@ perf, grayscale, max_colors, - mask, shape_dither); + mask, + shape_dither, + destination_alpha); if (!re->ob) { evas_software_xcb_outbuf_perf_free(perf); @@ -278,7 +281,30 @@ info->info.alloc_grayscale, info->info.alloc_colors_max, info->info.mask, - info->info.shape_dither); + info->info.shape_dither, + info->info.destination_alpha); + else + { + re = e->engine.data.output; + evas_software_xcb_outbuf_free(re->ob); + re->ob = evas_software_xcb_outbuf_setup_x(e->output.w, + e->output.h, + info->info.rotation, + OUTBUF_DEPTH_INHERIT, + 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.drawable, info->info.visual, info->info.colormap, info->info.depth), + info->info.alloc_grayscale, + info->info.alloc_colors_max, + info->info.mask, + info->info.shape_dither, + info->info.destination_alpha); + evas_software_xcb_outbuf_debug_set(re->ob, info->info.debug); + } + if (!e->engine.data.output) return; if (!e->engine.data.context) e->engine.data.context = =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/evas/src/modules/engines/software_xcb/evas_engine.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- evas_engine.h 14 Jan 2006 12:13:38 -0000 1.1 +++ evas_engine.h 10 Mar 2006 07:44:23 -0000 1.2 @@ -57,6 +57,7 @@ Evas_List *pending_writes; int mask_dither : 1; + int destination_alpha : 1; int debug : 1; } priv; @@ -162,7 +163,8 @@ int grayscale, int max_colors, XCBDRAWABLE mask, - int shape_dither); + int shape_dither, + int destination_alpha); char *evas_software_xcb_outbuf_perf_serialize_x (Outbuf_Perf *perf); void evas_software_xcb_outbuf_perf_deserialize_x (Outbuf_Perf *perf, =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/evas/src/modules/engines/software_xcb/evas_outbuf.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- evas_outbuf.c 14 Jan 2006 12:13:38 -0000 1.1 +++ evas_outbuf.c 10 Mar 2006 07:44:23 -0000 1.2 @@ -48,7 +48,8 @@ int grayscale, int max_colors, XCBDRAWABLE mask, - int shape_dither) + int shape_dither, + int destination_alpha) { Outbuf *buf; @@ -70,6 +71,7 @@ buf->priv.x.depth = x_depth; buf->priv.mask_dither = shape_dither; + buf->priv.destination_alpha = destination_alpha; { Gfx_Func_Convert conv_func; @@ -337,7 +339,7 @@ use_shm, NULL); } - if (buf->priv.x.mask.pixmap.xid) + if ((buf->priv.x.mask.pixmap.xid) || (buf->priv.destination_alpha)) { im->flags |= RGBA_IMAGE_HAS_ALPHA; /* FIXME: faster memset! */ @@ -496,12 +498,35 @@ } else { + DATA32 *s, *e; + if (data != src_data) conv_func(src_data, data, 0, bpl / ((evas_software_xcb_x_output_buffer_depth(obr->xcbob) / 8)) - obr->w, obr->w, obr->h, x, y, NULL); + /* FIXME: this is evil - but it makes ARGB targets look correct */ + if ((buf->priv.destination_alpha) && (!obr->mxcbob) && + (evas_software_xcb_x_output_buffer_depth(obr->xcbob) == 32)) + { + int i; + DATA32 a; + + for (i = 0; i < obr->h; i++) + { + s = ((DATA32 *)data) + ((bpl * i) / sizeof(DATA32)); + e = s + obr->w; + while (s < e) + { + a = A_VAL(s) + 1; + R_VAL(s) = (R_VAL(s) * a) >> 8; + G_VAL(s) = (G_VAL(s) * a) >> 8; + B_VAL(s) = (B_VAL(s) * a) >> 8; + s++; + } + } + } } if (obr->mxcbob) { @@ -600,7 +625,7 @@ int h) { int i; - XCBSCREEN *screen; + XCBSCREEN *screen = NULL; { XCBGetGeometryRep *geom; =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/evas/src/modules/engines/software_xcb/evas_xcb_buffer.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- evas_xcb_buffer.c 14 Jan 2006 12:13:38 -0000 1.1 +++ evas_xcb_buffer.c 10 Mar 2006 07:44:23 -0000 1.2 @@ -100,7 +100,7 @@ if (try_shm > 0) { - XCBQueryExtensionRep *rep; + const XCBQueryExtensionRep *rep; rep = XCBGetExtensionData(c, &XCBShmId); if (rep && rep->present) =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/evas/src/modules/engines/software_xcb/evas_xcb_color.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- evas_xcb_color.c 14 Jan 2006 12:13:38 -0000 1.1 +++ evas_xcb_color.c 10 Mar 2006 07:44:23 -0000 1.2 @@ -135,7 +135,7 @@ XCBAllocColor(conn, cmap, xcl.red, xcl.green, xcl.blue), 0); - /* TODO: XAllocColor tries to approach the color */ + /* FIXME: XAllocColor tries to approach the color */ /* in case the allocation fails */ /* XCB does not that (i think). It should be done */ /* So if rep == NULL, the other following tests */ ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs