Enlightenment CVS committal

Author  : raster
Project : e17
Module  : libs/evas

Dir     : e17/libs/evas/src/lib/engines/common


Modified Files:
        evas_draw_main.c evas_font_draw.c evas_font_load.c 


Log Message:


open gl is fulyl functional now - it coudl defnitely do with optimizations
with texture upload. it does NOt check error returns anywhere from gl... this
may mean issues with LOTs of images, LARGE images etc. need to fix that later

===================================================================
RCS file: 
/cvsroot/enlightenment/e17/libs/evas/src/lib/engines/common/evas_draw_main.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- evas_draw_main.c    20 Jul 2003 05:33:11 -0000      1.3
+++ evas_draw_main.c    9 Sep 2003 05:51:02 -0000       1.4
@@ -21,6 +21,19 @@
 }
 
 void
+evas_common_draw_context_font_ext_set(RGBA_Draw_Context *dc,
+                                     void *data,
+                                     void *(*gl_new)  (void *data, RGBA_Font_Glyph 
*fg),
+                                     void  (*gl_free) (void *ext_dat),
+                                     void  (*gl_draw) (void *data, void *dest, void 
*context, RGBA_Font_Glyph *fg, int x, int y))
+{
+   dc->font_ext.data = data;
+   dc->font_ext.func.gl_new = gl_new;
+   dc->font_ext.func.gl_free = gl_free;
+   dc->font_ext.func.gl_draw = gl_draw;
+}
+
+void
 evas_common_draw_context_clip_clip(RGBA_Draw_Context *dc, int x, int y, int w, int h)
 {
    if (dc->clip.use)
===================================================================
RCS file: 
/cvsroot/enlightenment/e17/libs/evas/src/lib/engines/common/evas_font_draw.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- evas_font_draw.c    5 Jun 2003 02:59:19 -0000       1.4
+++ evas_font_draw.c    9 Sep 2003 05:51:02 -0000       1.5
@@ -44,7 +44,7 @@
      }
    fg->glyph_out = (FT_BitmapGlyph)fg->glyph;
    
-   fn->glyphs = evas_hash_add(fn->glyphs, key, fg);   
+   fn->glyphs = evas_hash_add(fn->glyphs, key, fg);
    return fg;
 }
 
@@ -114,6 +114,13 @@
          }
        fg = evas_common_font_cache_glyph_get(fn, index);
        if (!fg) continue;
+       
+       if ((dc->font_ext.func.gl_new) && (!fg->ext_dat))
+         {
+            /* extension calls */
+            fg->ext_dat = dc->font_ext.func.gl_new(dc->font_ext.data, fg);
+            fg->ext_dat_free = dc->font_ext.func.gl_free;
+         }
 
        chr_x = (pen_x + (fg->glyph_out->left << 8)) >> 8;
        chr_y = (pen_y + (fg->glyph_out->top << 8)) >> 8;
@@ -133,33 +140,46 @@
               {
                  if ((j > 0) && (chr_x + w > ext_x))
                    {
-                      for (i = 0; i < h; i++)
+                      if (fg->ext_dat)
                         {
-                           int dx, dy;
-                           int in_x, in_w;
-                           
-                           in_x = 0;
-                           in_w = 0;
-                           dx = chr_x;
-                           dy = y - (chr_y - i - y);
-                           if ((dx < (ext_x + ext_w)) &&
-                               (dy >= (ext_y)) &&
-                               (dy < (ext_y + ext_h)))
+                           /* ext glyph draw */
+                           dc->font_ext.func.gl_draw(dc->font_ext.data, 
+                                                     NULL,
+                                                     dc, fg, 
+                                                     chr_x, 
+                                                     y - (chr_y - y)
+                                                     );
+                        }
+                      else
+                        {
+                           for (i = 0; i < h; i++)
                              {
-                                if (dx + w > (ext_x + ext_w))
-                                  in_w += (dx + w) - (ext_x + ext_w);
-                                if (dx < ext_x)
-                                  {
-                                     in_w += ext_x - dx;
-                                     in_x = ext_x - dx;
-                                     dx = ext_x;
-                                  }
-                                if (in_w < w)
+                                int dx, dy;
+                                int in_x, in_w;
+                                
+                                in_x = 0;
+                                in_w = 0;
+                                dx = chr_x;
+                                dy = y - (chr_y - i - y);
+                                if ((dx < (ext_x + ext_w)) &&
+                                    (dy >= (ext_y)) &&
+                                    (dy < (ext_y + ext_h)))
                                   {
-                                     func(data + (i * j) + in_x, 
-                                          im + (dy * im_w) + dx,
-                                          w - in_w, 
-                                          dc->col.col);
+                                     if (dx + w > (ext_x + ext_w))
+                                       in_w += (dx + w) - (ext_x + ext_w);
+                                     if (dx < ext_x)
+                                       {
+                                          in_w += ext_x - dx;
+                                          in_x = ext_x - dx;
+                                          dx = ext_x;
+                                       }
+                                     if (in_w < w)
+                                       {
+                                          func(data + (i * j) + in_x, 
+                                               im + (dy * im_w) + dx,
+                                               w - in_w, 
+                                               dc->col.col);
+                                       }
                                   }
                              }
                         }
===================================================================
RCS file: 
/cvsroot/enlightenment/e17/libs/evas/src/lib/engines/common/evas_font_load.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- evas_font_load.c    14 Nov 2002 05:38:10 -0000      1.2
+++ evas_font_load.c    9 Sep 2003 05:51:02 -0000       1.3
@@ -182,6 +182,8 @@
    
    fg = data;
    FT_Done_Glyph(fg->glyph);
+   /* extension calls */
+   if (fg->ext_dat_free) fg->ext_dat_free(fg->ext_dat);
    free(fg);
    return 1;
    hash = 0;




-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to