Trivial patch reducing fp mults in pango-cairo



Hi,

Attached is a ridiculously simple patch cutting out two unnecessary FP
mults. It brings down __muldf3 by a few % in the profile (attached).

Thanks,

Jorn

-- 
OpenedHand Ltd.
http://o-hand.com/
Index: pango/pangocairo-fcfont.c
===================================================================
RCS file: /cvs/gnome/pango/pango/pangocairo-fcfont.c,v
retrieving revision 1.46
diff -u -r1.46 pangocairo-fcfont.c
--- pango/pangocairo-fcfont.c	28 Nov 2006 21:17:39 -0000	1.46
+++ pango/pangocairo-fcfont.c	9 Dec 2006 15:35:30 -0000
@@ -309,7 +309,7 @@
 	break;
       case PANGO_GRAVITY_EAST:
       case PANGO_GRAVITY_WEST:
-        cffont->font_extents.y = - PANGO_UNITS ((font_extents.ascent + font_extents.descent) * 0.5);
+        cffont->font_extents.y = - PANGO_UNITS ((font_extents.ascent + font_extents.descent) / 2);
     }
 
   cffont->glyph_extents_cache = g_new0 (GlyphExtentsCacheEntry, GLYPH_CACHE_NUM_ENTRIES);
Index: pango/pangocairo-font.c
===================================================================
RCS file: /cvs/gnome/pango/pango/pangocairo-font.c,v
retrieving revision 1.30
diff -u -r1.30 pangocairo-font.c
--- pango/pangocairo-font.c	28 Nov 2006 21:47:51 -0000	1.30
+++ pango/pangocairo-font.c	9 Dec 2006 15:35:31 -0000
@@ -202,7 +202,7 @@
     fontmap = pango_font_get_font_map ((PangoFont *)cfont);
 
     desc = pango_font_describe_with_absolute_size ((PangoFont *)cfont);
-    size = pango_font_description_get_size (desc) / (1.*PANGO_SCALE);
+    size = pango_font_description_get_size (desc) / (double) PANGO_SCALE;
 
     mini_desc = pango_font_description_new ();
     pango_font_description_set_family_static (mini_desc, "monospace");


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]