summaryrefslogtreecommitdiff
path: root/src/cairo-gstate.c
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2013-05-30 20:53:29 +0200
committerChris Wilson <chris@chris-wilson.co.uk>2013-09-05 16:08:19 +0100
commit900fc4a890026e46a3b0a00967632f57074b8b93 (patch)
tree9bccd996bdf3faa161770ae2aa5365485f0a3ab2 /src/cairo-gstate.c
parent25eaec0a3874a2090e1bb97547a328eb5c00b0b1 (diff)
downloadcairo-900fc4a890026e46a3b0a00967632f57074b8b93.tar.gz
gstate: Move device-scale font scaling to gstate
If we do this in surface it will be applied twice then we chain to a different surface, like e.g. a subsurface. We also remove a hack in cairo-surface-wrapper where it compensated for the device scale not being applied. v2: Compute the backend CTM in ensure_scaled_font().
Diffstat (limited to 'src/cairo-gstate.c')
-rw-r--r--src/cairo-gstate.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/cairo-gstate.c b/src/cairo-gstate.c
index 56e961e66..8ddb3affd 100644
--- a/src/cairo-gstate.c
+++ b/src/cairo-gstate.c
@@ -1842,6 +1842,7 @@ _cairo_gstate_ensure_scaled_font (cairo_gstate_t *gstate)
cairo_status_t status;
cairo_font_options_t options;
cairo_scaled_font_t *scaled_font;
+ cairo_matrix_t font_ctm;
if (gstate->scaled_font != NULL)
return gstate->scaled_font->status;
@@ -1853,9 +1854,13 @@ _cairo_gstate_ensure_scaled_font (cairo_gstate_t *gstate)
cairo_surface_get_font_options (gstate->target, &options);
cairo_font_options_merge (&options, &gstate->font_options);
+ cairo_matrix_multiply (&font_ctm,
+ &gstate->ctm,
+ &gstate->target->device_transform);
+
scaled_font = cairo_scaled_font_create (gstate->font_face,
&gstate->font_matrix,
- &gstate->ctm,
+ &font_ctm,
&options);
status = cairo_scaled_font_status (scaled_font);
@@ -2005,6 +2010,7 @@ _cairo_gstate_show_text_glyphs (cairo_gstate_t *gstate,
if (cairo_surface_has_show_text_glyphs (gstate->target) ||
_cairo_scaled_font_get_max_scale (gstate->scaled_font) <= 10240)
{
+
if (info != NULL) {
status = _cairo_surface_show_text_glyphs (gstate->target, op, pattern,
info->utf8, info->utf8_len,