Enlightenment CVS committal Author : barbieri Project : e17 Module : libs/evas
Dir : e17/libs/evas/src/modules/engines/software_16 Modified Files: Makefile.am evas_engine.c evas_soft16.h evas_soft16_dither_mask.c evas_soft16_main.c evas_soft16_rectangle.c evas_soft16_scanline_blend.c evas_soft16_scanline_fill.c Added Files: evas_soft16_line.c evas_soft16_polygon.c Log Message: Line, Polygon and minor fixes for software_16. Line is a complete rewrite based on my university works. It's much cleaner than the engine/common and works better (the later is producing weird results, I still have to debug why), but I don't provide anti-aliased drawings. Polygon is almost the same code, with minor changes to draw the spans as soon as possible and then no malloc/free is required for each of them. Minor fixes to remove unused variables, gotos... =================================================================== RCS file: /cvs/e/e17/libs/evas/src/modules/engines/software_16/Makefile.am,v retrieving revision 1.6 retrieving revision 1.7 diff -u -3 -r1.6 -r1.7 --- Makefile.am 8 Oct 2007 19:08:42 -0000 1.6 +++ Makefile.am 25 Oct 2007 16:17:18 -0000 1.7 @@ -17,7 +17,9 @@ evas_soft16_image_unscaled.c \ evas_soft16_image_scaled_sampled.c \ evas_soft16_font.c \ -evas_soft16_rectangle.c +evas_soft16_rectangle.c \ +evas_soft16_polygon.c \ +evas_soft16_line.c module_la_LIBADD = $(top_builddir)/src/lib/libevas.la module_la_LDFLAGS = @create_shared_lib@ -module -avoid-version -L$(top_builddir)/src/lib -L$(top_builddir)/src/lib/.libs @@ -34,6 +36,8 @@ evas_soft16_image_scaled_sampled.c \ evas_soft16_font.c \ evas_soft16_rectangle.c \ +evas_soft16_polygon.c \ +evas_soft16_line.c \ evas_soft16_scanline_fill.c \ evas_soft16_scanline_blend.c =================================================================== RCS file: /cvs/e/e17/libs/evas/src/modules/engines/software_16/evas_engine.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -3 -r1.8 -r1.9 --- evas_engine.c 3 Aug 2007 23:11:56 -0000 1.8 +++ evas_engine.c 25 Oct 2007 16:17:18 -0000 1.9 @@ -148,39 +148,31 @@ static void eng_rectangle_draw(void *data, void *context, void *surface, int x, int y, int w, int h) { - soft16_rectangle_draw(surface, context, x, y, w, h); + soft16_rectangle_draw(surface, context, x, y, w, h); } static void eng_line_draw(void *data, void *context, void *surface, int x1, int y1, int x2, int y2) { - NOT_IMPLEMENTED(); -// evas_common_line_draw(surface, context, x1, y1, x2, y2); -// evas_common_cpu_end_opt(); + soft16_line_draw(surface, context, x1, y1, x2, y2); } static void * eng_polygon_point_add(void *data, void *context, void *polygon, int x, int y) { - NOT_IMPLEMENTED(); - return NULL; -// return evas_common_polygon_point_add(polygon, x, y); + return evas_common_polygon_point_add(polygon, x, y); } static void * eng_polygon_points_clear(void *data, void *context, void *polygon) { - NOT_IMPLEMENTED(); - return NULL; -// return evas_common_polygon_points_clear(polygon); + return evas_common_polygon_points_clear(polygon); } static void eng_polygon_draw(void *data, void *context, void *surface, void *polygon) { - NOT_IMPLEMENTED(); -// evas_common_polygon_draw(surface, context, polygon); -// evas_common_cpu_end_opt(); + soft16_polygon_draw(surface, context, polygon); } static void * =================================================================== RCS file: /cvs/e/e17/libs/evas/src/modules/engines/software_16/evas_soft16.h,v retrieving revision 1.9 retrieving revision 1.10 diff -u -3 -r1.9 -r1.10 --- evas_soft16.h 10 Oct 2007 19:22:26 -0000 1.9 +++ evas_soft16.h 25 Oct 2007 16:17:18 -0000 1.10 @@ -105,6 +105,18 @@ */ void soft16_rectangle_draw(Soft16_Image *dst, RGBA_Draw_Context *dc, int x, int y, int w, int h); +/** + * Polygon (evas_soft16_polygon.c) + */ +void +soft16_polygon_draw(Soft16_Image *dst, RGBA_Draw_Context *dc, RGBA_Polygon_Point *points); + +/** + * Line (evas_soft16_line.c) + */ +void +soft16_line_draw(Soft16_Image *dst, RGBA_Draw_Context *dc, int x0, int y0, int x1, int y1); + /** * Font (evas_soft16_font.c) =================================================================== RCS file: /cvs/e/e17/libs/evas/src/modules/engines/software_16/evas_soft16_dither_mask.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -3 -r1.3 -r1.4 --- evas_soft16_dither_mask.c 10 Oct 2007 19:22:26 -0000 1.3 +++ evas_soft16_dither_mask.c 25 Oct 2007 16:17:18 -0000 1.4 @@ -283,7 +283,7 @@ { const DATA32 *sp; DATA16 *dp; - int x, y, pad; + int y, pad; sp = src; dp = im->pixels; =================================================================== RCS file: /cvs/e/e17/libs/evas/src/modules/engines/software_16/evas_soft16_main.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -3 -r1.14 -r1.15 --- evas_soft16_main.c 3 Aug 2007 23:11:56 -0000 1.14 +++ evas_soft16_main.c 25 Oct 2007 16:17:18 -0000 1.15 @@ -230,7 +230,6 @@ if (!im->pixels) soft16_image_alloc_pixels(im); if (im->pixels) _soft16_image_rgba32_import(im, im->source_im->image->data); } - done: evas_cache_image_drop(im->source_im); im->source_im = NULL; } =================================================================== RCS file: /cvs/e/e17/libs/evas/src/modules/engines/software_16/evas_soft16_rectangle.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- evas_soft16_rectangle.c 10 Oct 2007 19:22:26 -0000 1.2 +++ evas_soft16_rectangle.c 25 Oct 2007 16:17:19 -0000 1.3 @@ -8,45 +8,32 @@ } static inline void -_soft16_rectangle_draw_solid_solid(Soft16_Image *dst, RGBA_Draw_Context *dc, - int offset, int w, int h) +_soft16_rectangle_draw_solid_solid(Soft16_Image *dst, int offset, int w, int h, + DATA16 rgb565) { - DATA16 *dst_itr, rgb565; + DATA16 *dst_itr; int i; dst_itr = dst->pixels + offset; - rgb565 = RGB_565_FROM_COMPONENTS(R_VAL(&dc->col.col), - G_VAL(&dc->col.col), - B_VAL(&dc->col.col)); for (i = 0; i < h; i++, dst_itr += dst->stride) _soft16_scanline_fill_solid_solid(dst_itr, w, rgb565); } static inline void -_soft16_rectangle_draw_transp_solid(Soft16_Image *dst, RGBA_Draw_Context *dc, - int offset, int w, int h) +_soft16_rectangle_draw_transp_solid(Soft16_Image *dst, int offset, int w, int h, + DATA16 rgb565, DATA8 alpha) { - char alpha; + DATA16 *dst_itr; + DATA32 rgb565_unpack; + int i; - alpha = A_VAL(&dc->col.col) >> 3; - if (alpha == 31) _soft16_rectangle_draw_solid_solid(dst, dc, offset, w, h); - else if (alpha != 0) - { - DATA16 *dst_itr; - DATA32 rgb565; - int i; - - dst_itr = dst->pixels + offset; - rgb565 = RGB_565_FROM_COMPONENTS(R_VAL(&dc->col.col), - G_VAL(&dc->col.col), - B_VAL(&dc->col.col)); - rgb565 = RGB_565_UNPACK(rgb565); - alpha++; - - for (i = 0; i < h; i++, dst_itr += dst->stride) - _soft16_scanline_fill_transp_solid(dst_itr, w, rgb565, alpha); - } + dst_itr = dst->pixels + offset; + rgb565_unpack = RGB_565_UNPACK(rgb565); + alpha++; + + for (i = 0; i < h; i++, dst_itr += dst->stride) + _soft16_scanline_fill_transp_solid(dst_itr, w, rgb565_unpack, alpha); } static void @@ -69,12 +56,19 @@ if (!dst->have_alpha) { - if (A_VAL(&dc->col.col) == 255) - _soft16_rectangle_draw_solid_solid - (dst, dc, dst_offset, dr.w, dr.h); - else - _soft16_rectangle_draw_transp_solid - (dst, dc, dst_offset, dr.w, dr.h); + DATA16 rgb565; + DATA8 alpha; + + alpha = A_VAL(&dc->col.col) >> 3; + rgb565 = RGB_565_FROM_COMPONENTS(R_VAL(&dc->col.col), + G_VAL(&dc->col.col), + B_VAL(&dc->col.col)); + if (alpha == 31) + _soft16_rectangle_draw_solid_solid + (dst, dst_offset, dr.w, dr.h, rgb565); + else if (alpha > 0) + _soft16_rectangle_draw_transp_solid + (dst, dst_offset, dr.w, dr.h, rgb565, alpha); } else fprintf(stderr, =================================================================== RCS file: /cvs/e/e17/libs/evas/src/modules/engines/software_16/evas_soft16_scanline_blend.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -3 -r1.3 -r1.4 --- evas_soft16_scanline_blend.c 10 Oct 2007 19:22:26 -0000 1.3 +++ evas_soft16_scanline_blend.c 25 Oct 2007 16:17:19 -0000 1.4 @@ -19,8 +19,6 @@ { DATA32 a, b; - DATA32 dst = *p_dst; - a = RGB_565_UNPACK(src); b = RGB_565_UNPACK(*p_dst); b = RGB_565_UNPACKED_BLEND(a, b, alpha); =================================================================== RCS file: /cvs/e/e17/libs/evas/src/modules/engines/software_16/evas_soft16_scanline_fill.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- evas_soft16_scanline_fill.c 20 Jun 2007 20:50:34 -0000 1.2 +++ evas_soft16_scanline_fill.c 25 Oct 2007 16:17:19 -0000 1.3 @@ -58,7 +58,6 @@ _soft16_scanline_fill_transp_solid(DATA16 *dst, int size, DATA32 rgb565_unpack, DATA8 alpha) { DATA16 *start, *end; - DATA32 a; start = dst; pld(start, 0); ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs