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_main.c 
Added Files:
        evas_soft16_font.c 


Log Message:
Add font/text support for software_16.

===================================================================
RCS file: /cvs/e/e17/libs/evas/src/modules/engines/software_16/Makefile.am,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- Makefile.am 29 Apr 2007 15:45:40 -0000      1.1
+++ Makefile.am 19 Jun 2007 22:52:12 -0000      1.2
@@ -12,7 +12,8 @@
 module_la_SOURCES  = \
 evas_engine.c \
 evas_soft16.h \
-evas_soft16_main.c
+evas_soft16_main.c \
+evas_soft16_font.c
 
 module_la_LIBADD = $(top_builddir)/src/lib/libevas.la
 module_la_LDFLAGS = -module -avoid-version -L$(top_builddir)/src/lib 
-L$(top_builddir)/src/lib/.libs
@@ -23,4 +24,5 @@
 EXTRA_DIST = \
 evas_engine.c \
 evas_soft16.h \
-evas_soft16_main.c
+evas_soft16_main.c \
+evas_soft16_font.c
===================================================================
RCS file: /cvs/e/e17/libs/evas/src/modules/engines/software_16/evas_engine.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- evas_engine.c       18 Jun 2007 16:50:37 -0000      1.3
+++ evas_engine.c       19 Jun 2007 22:52:12 -0000      1.4
@@ -574,8 +574,28 @@
 static void
 eng_font_draw(void *data, void *context, void *surface, void *font, int x, int 
y, int w, int h, int ow, int oh, const char *text)
 {
-//   evas_common_font_draw(surface, context, font, x, y, text);
-//   evas_common_cpu_end_opt();
+   static RGBA_Image *im = NULL;
+   Soft16_Image *dst = surface;
+
+   if (!im)
+     {
+       im = evas_common_image_new();
+       im->image = evas_common_image_surface_new(im);
+       im->image->no_free = 1;
+     }
+   im->image->w = dst->w;
+   im->image->h = dst->h;
+   evas_common_draw_context_font_ext_set(context,
+                                        surface,
+                                        soft16_font_glyph_new,
+                                        soft16_font_glyph_free,
+                                        soft16_font_glyph_draw);
+   evas_common_font_draw(im, context, font, x, y, text);
+   evas_common_draw_context_font_ext_set(context,
+                                        NULL,
+                                        NULL,
+                                        NULL,
+                                        NULL);
 }
 
 static void
===================================================================
RCS file: /cvs/e/e17/libs/evas/src/modules/engines/software_16/evas_soft16.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- evas_soft16.h       18 Jun 2007 16:50:37 -0000      1.2
+++ evas_soft16.h       19 Jun 2007 22:52:12 -0000      1.3
@@ -5,6 +5,35 @@
 #include "evas_private.h"
 #include "evas_common.h"
 
+#define RGB_565_UNPACKED_MASK 0x07e0f81f
+#define RGB_565_UNPACK(rgb)                                             \
+   (((rgb) | ((rgb) << 16)) & RGB_565_UNPACKED_MASK)
+#define RGB_565_PACK(rgb)                                               \
+  ((((rgb) & RGB_565_UNPACKED_MASK) |                                   \
+   ((rgb) & RGB_565_UNPACKED_MASK) >> 16) & 0xffff)
+#define RGB_565_UNPACKED_BLEND(a, b, alpha)                             \
+   ((b) + ((((a) - (b)) * (alpha)) >> 5))
+
+#define RGB_565_FROM_COMPONENTS(r, g, b)                                \
+  (((((r) >> 3) & 0x1f) << 11) |                                        \
+   ((((g) >> 2) & 0x3f) << 5) |                                         \
+   (((b) >> 3) & 0x1f))
+
+#define UNROLL2(op...) op op
+#define UNROLL4(op...) UNROLL2(op) UNROLL2(op)
+#define UNROLL8(op...) UNROLL4(op) UNROLL4(op)
+#define UNROLL16(op...) UNROLL8(op) UNROLL8(op)
+
+
+#if defined(__ARMEL__)
+/* tested on ARMv6 (arm1136j-s), Nokia N800 CPU */
+#define pld(addr, off)                                                  \
+   __asm__("pld [%[address], %[offset]]"::                              \
+           [address] "r" (addr), [offset] "i" (off))
+#else
+#define pld(addr, off)
+#endif /* __ARMEL__ */
+
 typedef struct _Soft16_Image Soft16_Image;
   
 struct _Soft16_Image
@@ -43,4 +72,10 @@
 
 void soft16_rectangle_draw(Soft16_Image *dst, RGBA_Draw_Context *dc,
                            int x, int y, int w, int h);
+
+
+
+void *soft16_font_glyph_new(void *data, RGBA_Font_Glyph *fg);
+void  soft16_font_glyph_free(void *ext_dat);
+void  soft16_font_glyph_draw(Soft16_Image *dst, void *data, RGBA_Draw_Context 
*dc, RGBA_Font_Glyph *fg, int x, int y);
 #endif
===================================================================
RCS file: 
/cvs/e/e17/libs/evas/src/modules/engines/software_16/evas_soft16_main.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- evas_soft16_main.c  19 Jun 2007 22:51:39 -0000      1.4
+++ evas_soft16_main.c  19 Jun 2007 22:52:12 -0000      1.5
@@ -2,36 +2,6 @@
 #include "evas_private.h"
 #include "evas_soft16.h"
 
-#define RGB_565_UNPACKED_MASK 0x07e0f81f
-#define RGB_565_UNPACK(rgb)                                             \
-   (((rgb) | ((rgb) << 16)) & RGB_565_UNPACKED_MASK)
-#define RGB_565_PACK(rgb)                                               \
-  ((((rgb) & RGB_565_UNPACKED_MASK) |                                   \
-   ((rgb) & RGB_565_UNPACKED_MASK) >> 16) & 0xffff)
-#define RGB_565_UNPACKED_BLEND(a, b, alpha)                             \
-   ((b) + ((((a) - (b)) * (alpha)) >> 5))
-
-#define RGB_565_FROM_COMPONENTS(r, g, b)                                \
-  (((((r) >> 3) & 0x1f) << 11) |                                        \
-   ((((g) >> 2) & 0x3f) << 5) |                                         \
-   (((b) >> 3) & 0x1f))
-
-#define UNROLL2(op...) op op
-#define UNROLL4(op...) UNROLL2(op) UNROLL2(op)
-#define UNROLL8(op...) UNROLL4(op) UNROLL4(op)
-#define UNROLL16(op...) UNROLL8(op) UNROLL8(op)
-
-
-#if defined(__ARMEL__)
-/* tested on ARMv6 (arm1136j-s), Nokia N800 CPU */
-#define pld(addr, off)                                                  \
-   __asm__("pld [%[address], %[offset]]"::                              \
-           [address] "r" (addr), [offset] "i" (off))
-#else
-#define pld(addr, off)
-#endif /* __ARMEL__ */
-
-
 #define IMG_BYTE_SIZE(stride, height, has_alpha)                       \
    ((stride) * (height) * (!(has_alpha) ? 2 : 3))
 



-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to