Enlightenment CVS committal

Author  : raster
Project : e17
Module  : libs/evas

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


Modified Files:
        evas_font_load.c evas_line_main.c 


Log Message:


2 problems fixed.

1. evas line draws of 2 pixelin size work now. oops!
2. font faces are shared between multiple sizes without a performance hit! yay!

===================================================================
RCS file: 
/cvsroot/enlightenment/e17/libs/evas/src/lib/engines/common/evas_font_load.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -3 -r1.9 -r1.10
--- evas_font_load.c    23 Jan 2004 11:02:46 -0000      1.9
+++ evas_font_load.c    26 Jan 2004 03:31:39 -0000      1.10
@@ -78,13 +78,6 @@
 {
    Evas_Object_List *l;
 
-#if 1 
-   /* this effectively disables sharing out loaded outlines between */
-   /* multiple sizes of the same font. because FT_Set_Char_Size() needs */
-   /* to be called to update the fonts size output and caluclations */
-   /* for a different face size, but this can be SLOOOW */
-   return NULL;
-#endif   
    if (!name) return NULL;
    for (l = fonts_src; l; l = l->next)
      {
@@ -120,8 +113,7 @@
 evas_common_font_size_use(RGBA_Font *fn)
 {
    if (fn->src->current_size == fn->real_size) return;
-   /* This call is evil and SLOW! */
-   FT_Set_Char_Size(fn->src->ft.face, 0, fn->real_size, 96, 96);
+   FT_Activate_Size(fn->ft.size);
    fn->src->current_size = fn->real_size;
 }
 
@@ -180,6 +172,13 @@
 {
    int error;
    
+   if (fn->src->references == 1)
+     fn->ft.size = fn->src->ft.face->size;
+   else
+     {
+       error = FT_New_Size(fn->src->ft.face, &(fn->ft.size));
+       FT_Activate_Size(fn->ft.size);
+     }
    fn->real_size = fn->size * 64;
    error = FT_Set_Char_Size(fn->src->ft.face, 0, fn->real_size, 96, 96);
    if (error)
@@ -254,7 +253,6 @@
          }
  */
      }
-   
    fn->glyphs = NULL;
    fn->usage = 0;
    fn->references = 1;
@@ -351,6 +349,8 @@
      }
    if (!fn) return;
    
+   if (fn->src->references > 1) FT_Done_Size(fn->ft.size);
+   
    fonts = evas_object_list_remove(fonts, fn);
    evas_common_font_modify_cache_by(fn, -1);
 
===================================================================
RCS file: 
/cvsroot/enlightenment/e17/libs/evas/src/lib/engines/common/evas_line_main.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- evas_line_main.c    12 May 2003 02:26:27 -0000      1.3
+++ evas_line_main.c    26 Jan 2004 03:31:39 -0000      1.4
@@ -33,6 +33,53 @@
    
    if ((dx == 0) && (dy == 0))
      {
+       if ((x1 < 0) ||
+           (y1 < 0) ||
+           (x1 >= dst->image->w) ||
+           (y1 >= dst->image->h))
+         return;
+       if (dc->clip.use)
+         {
+            if ((x1 < dc->clip.x) ||
+                (y1 < dc->clip.y) ||
+                (x1 >= (dc->clip.x + dc->clip.w)) ||
+                (y1 >= (dc->clip.y + dc->clip.h)))
+              return;
+         }
+       if (dst->flags & RGBA_IMAGE_HAS_ALPHA)
+         {
+            DATA32 __blend_tmp;                       
+            DATA8  __blend_a;                                  
+            
+            ptr = dst->image->data + (y1 * dst->image->w) + x1;
+            __blend_a = _evas_pow_lut[A_VAL(&(col))][A_VAL(ptr)]; 
+            
+            BLEND_COLOR(__blend_a, R_VAL(ptr), 
+                        R_VAL(&(col)), R_VAL(ptr), 
+                        __blend_tmp);                 
+            BLEND_COLOR(__blend_a, G_VAL(ptr), 
+                        G_VAL(&(col)), G_VAL(ptr), 
+                        __blend_tmp);                 
+            BLEND_COLOR(__blend_a, B_VAL(ptr), 
+                        B_VAL(&(col)), B_VAL(ptr), 
+                        __blend_tmp);                 
+            A_VAL(ptr) = A_VAL(ptr) + ((A_VAL(&(col)) * (255 - A_VAL(ptr))) / 255);
+         }
+       else
+         {
+            DATA32 __blend_tmp;                       
+            
+            ptr = dst->image->data + (y1 * dst->image->w) + x1;
+            BLEND_COLOR(A_VAL(&(col)), R_VAL(ptr), 
+                        R_VAL(&(col)), R_VAL(ptr), 
+                        __blend_tmp);                 
+            BLEND_COLOR(A_VAL(&(col)), G_VAL(ptr), 
+                        G_VAL(&(col)), G_VAL(ptr), 
+                        __blend_tmp);                 
+            BLEND_COLOR(A_VAL(&(col)), B_VAL(ptr), 
+                        B_VAL(&(col)), B_VAL(ptr), 
+                        __blend_tmp);                 
+         }
        /* point draw */
        return;
      }




-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to