# HG changeset patch # User Thinker K.F. Li # Date 1283146981 -28800 # Node ID 8e9481bf1cc0346fdc2f357567ad57a50bf31bfe # Parent 61c217f8cec8d0f06f42535a7eba28d97d5a8246 Avoid float divide to improve performance diff -r 61c217f8cec8 -r 8e9481bf1cc0 src/coord.c --- a/src/coord.c Mon Aug 30 13:07:49 2010 +0800 +++ b/src/coord.c Mon Aug 30 13:43:01 2010 +0800 @@ -144,12 +144,14 @@ reverse[2] = -working[2]; reverse[5] = -working[5]; - reverse[0] /= working[0]; - reverse[1] /= working[0]; - reverse[2] /= working[0]; - reverse[3] /= working[4]; - reverse[4] /= working[4]; - reverse[5] /= working[4]; + factor = 1 / working[0]; + reverse[0] *= factor; + reverse[1] *= factor; + reverse[2] *= factor; + factor = 1 / working[4]; + reverse[3] *= factor; + reverse[4] *= factor; + reverse[5] *= factor; } /*! \brief Update aggregate matrices of elements under a sub-tree. diff -r 61c217f8cec8 -r 8e9481bf1cc0 src/shape_image.c --- a/src/shape_image.c Mon Aug 30 13:07:49 2010 +0800 +++ b/src/shape_image.c Mon Aug 30 13:43:01 2010 +0800 @@ -70,8 +70,6 @@ shape_t *rdman_shape_image_new(redraw_man_t *rdman, co_aix x, co_aix y, co_aix w, co_aix h) { sh_image_t *img; - mb_img_fmt_t fmt; - int r; img = O_ALLOC(sh_image_t); if(img == NULL) @@ -158,8 +156,6 @@ */ void sh_image_draw(shape_t *shape, mbe_t *cr) { sh_image_t *img = (sh_image_t *)shape; - mbe_pattern_t *saved_source; - co_aix *aggr; mbe_move_to(cr, img->poses[0][0], img->poses[0][1]); mbe_line_to(cr, img->poses[1][0], img->poses[1][1]);