summaryrefslogtreecommitdiff
path: root/src/cairo-font-face-twin.c
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2008-12-20 23:30:59 -0500
committerBehdad Esfahbod <behdad@behdad.org>2008-12-23 13:41:04 -0500
commit96e41c28e980f313c51a0eed81681e7e48752797 (patch)
tree919e1824763d2c69cb2fe9d4eae17a83a5381d30 /src/cairo-font-face-twin.c
parent556f6ce364d81f9309162d21deb86a3d5b8b9a6e (diff)
downloadcairo-96e41c28e980f313c51a0eed81681e7e48752797.tar.gz
[twin] Minor cleanup
Diffstat (limited to 'src/cairo-font-face-twin.c')
-rw-r--r--src/cairo-font-face-twin.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/cairo-font-face-twin.c b/src/cairo-font-face-twin.c
index 52c951d4a..83be2d547 100644
--- a/src/cairo-font-face-twin.c
+++ b/src/cairo-font-face-twin.c
@@ -258,7 +258,7 @@ twin_scaled_font_unicode_to_glyph (cairo_scaled_font_t *scaled_font,
* to map all unknown chars to a single unknown glyph to
* reduce pressure on cache. */
- if (unicode < ARRAY_LENGTH (_cairo_twin_charmap))
+ if (likely (unicode < ARRAY_LENGTH (_cairo_twin_charmap)))
*glyph = unicode;
else
*glyph = 0;
@@ -283,9 +283,8 @@ twin_scaled_font_render_glyph (cairo_scaled_font_t *scaled_font,
{
double x1, y1, x2, y2, x3, y3;
twin_face_properties_t *props;
- const int8_t *b = _cairo_twin_outlines +
- _cairo_twin_charmap[glyph >= ARRAY_LENGTH (_cairo_twin_charmap) ? 0 : glyph];
- const int8_t *g = twin_glyph_draw(b);
+ const int8_t *b;
+ const int8_t *g;
struct {
cairo_bool_t snap;
@@ -295,6 +294,10 @@ twin_scaled_font_render_glyph (cairo_scaled_font_t *scaled_font,
int n_snap_y;
} info = {FALSE};
+ b = _cairo_twin_outlines +
+ _cairo_twin_charmap[unlikely (glyph >= ARRAY_LENGTH (_cairo_twin_charmap)) ? 0 : glyph];
+ g = twin_glyph_draw(b);
+
props = cairo_font_face_get_user_data (cairo_scaled_font_get_font_face (scaled_font),
&twin_face_properties_key);
cairo_set_tolerance (cr, 0.01);