summaryrefslogtreecommitdiff
path: root/pango/pangocairo-font.c
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@gnome.org>2006-11-28 21:17:39 +0000
committerBehdad Esfahbod <behdad@src.gnome.org>2006-11-28 21:17:39 +0000
commit730324111fd91f6778a8da8cacb3fe4b2eab64c7 (patch)
tree17f055e08b7ef1697cf982d2f061aa204baa8d80 /pango/pangocairo-font.c
parentca3bbbed0304c49cda8a222d52a75235c3c0c6cf (diff)
downloadpango-730324111fd91f6778a8da8cacb3fe4b2eab64c7.tar.gz
Use simple, fast, casts instead of PANGO_CAIRO_*() macros where the object
2006-11-28 Behdad Esfahbod <behdad@gnome.org> * pango/pangocairo-fcfont.c (pango_cairo_fc_font_get_font_face), (pango_cairo_fc_font_install), (pango_cairo_fc_font_finalize), (pango_cairo_fc_font_get_metrics), (pango_cairo_fc_font_shutdown), (_pango_cairo_fc_font_new): * pango/pangocairo-fcfontmap.c (pango_cairo_fc_font_map_set_resolution), (pango_cairo_fc_font_map_get_resolution_cairo), (pango_cairo_fc_font_map_get_renderer), (pango_cairo_fc_font_map_finalize), (pango_cairo_fc_font_map_get_resolution_fc), (pango_cairo_fc_font_map_create_font): * pango/pangocairo-font.c (_pango_cairo_font_install), (_pango_cairo_font_get_font_face), (_pango_cairo_font_get_scaled_font), (_pango_cairo_font_get_hex_box_info): * pango/pangocairo-fontmap.c (pango_cairo_create_layout): * pango/pangocairo-render.c (set_color), (_pango_cairo_renderer_draw_unknown_glyph), (pango_cairo_renderer_draw_glyphs), (pango_cairo_renderer_draw_rectangle), (pango_cairo_renderer_draw_error_underline): Use simple, fast, casts instead of PANGO_CAIRO_*() macros where the object cannot have reached us if it wasn't of the right type.
Diffstat (limited to 'pango/pangocairo-font.c')
-rw-r--r--pango/pangocairo-font.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/pango/pangocairo-font.c b/pango/pangocairo-font.c
index ff05dd45..34b2b639 100644
--- a/pango/pangocairo-font.c
+++ b/pango/pangocairo-font.c
@@ -72,7 +72,7 @@ gboolean
_pango_cairo_font_install (PangoCairoFont *font,
cairo_t *cr)
{
- if (G_UNLIKELY (!PANGO_IS_CAIRO_FONT (font)))
+ if (G_UNLIKELY (!font))
{
if (!_pango_cairo_warning_history.font_install)
{
@@ -89,7 +89,7 @@ _pango_cairo_font_install (PangoCairoFont *font,
cairo_font_face_t *
_pango_cairo_font_get_font_face (PangoCairoFont *font)
{
- g_return_val_if_fail (PANGO_IS_CAIRO_FONT (font), NULL);
+ g_return_val_if_fail (font, NULL);
return (* PANGO_CAIRO_FONT_GET_IFACE (font)->get_font_face) (font);
}
@@ -97,7 +97,7 @@ _pango_cairo_font_get_font_face (PangoCairoFont *font)
cairo_scaled_font_t *
_pango_cairo_font_get_scaled_font (PangoCairoFont *font)
{
- g_return_val_if_fail (PANGO_IS_CAIRO_FONT (font), NULL);
+ g_return_val_if_fail (font, NULL);
return (* PANGO_CAIRO_FONT_GET_IFACE (font)->get_scaled_font) (font);
}
@@ -122,7 +122,7 @@ _pango_cairo_font_get_hex_box_info (PangoCairoFont *cfont)
PangoCairoHexBoxInfo *hbi;
/* for metrics hinting */
- double scale_x, scale_x_inv, scale_y, scale_y_inv;
+ double scale_x = 1., scale_x_inv = 1., scale_y = 1., scale_y_inv = 1.;
gboolean is_hinted;
int i;
@@ -217,7 +217,7 @@ _pango_cairo_font_get_hex_box_info (PangoCairoFont *cfont)
/* load mini_font */
- context = pango_cairo_font_map_create_context (PANGO_CAIRO_FONT_MAP (fontmap));
+ context = pango_cairo_font_map_create_context ((PangoCairoFontMap *) (fontmap));
pango_context_set_matrix (context, &pango_ctm);
pango_context_set_language (context, pango_language_from_string ("en"));