summaryrefslogtreecommitdiff
path: root/src/cairo-type3-glyph-surface.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2008-12-17 10:07:32 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2008-12-18 10:40:14 +0000
commit6458903c95c2bba3f1b9ceaaafb6979d180ab039 (patch)
tree67be2c2d96eb9f3ba12d126644c0594979bc77e5 /src/cairo-type3-glyph-surface.c
parent9b46d13b6cd58c711010df89a41b216c5cc8c881 (diff)
downloadcairo-6458903c95c2bba3f1b9ceaaafb6979d180ab039.tar.gz
[image] Eliminate the short-lived context used for coercing.
When coercing from one image format to another we performed a paint operation using a temporary context - this is overkill as we can just call _cairo_surface_paint() directly.
Diffstat (limited to 'src/cairo-type3-glyph-surface.c')
-rw-r--r--src/cairo-type3-glyph-surface.c20
1 files changed, 4 insertions, 16 deletions
diff --git a/src/cairo-type3-glyph-surface.c b/src/cairo-type3-glyph-surface.c
index b3a48313d..3ff5003bf 100644
--- a/src/cairo-type3-glyph-surface.c
+++ b/src/cairo-type3-glyph-surface.c
@@ -87,18 +87,6 @@ _cairo_type3_glyph_surface_emit_image (cairo_type3_glyph_surface_t *surface,
cairo_matrix_t *image_matrix)
{
cairo_status_t status;
- cairo_image_surface_t *image_mask;
-
- /* The only image type supported by Type 3 fonts are 1-bit image
- * masks */
- if (image->format == CAIRO_FORMAT_A1) {
- image_mask = image;
- } else {
- image_mask = _cairo_image_surface_clone (image, CAIRO_FORMAT_A1);
- status = cairo_surface_status (&image->base);
- if (unlikely (status))
- return status;
- }
_cairo_output_stream_printf (surface->stream,
"q %f %f %f %f %f %f cm\n",
@@ -109,14 +97,14 @@ _cairo_type3_glyph_surface_emit_image (cairo_type3_glyph_surface_t *surface,
image_matrix->x0,
image_matrix->y0);
- status = surface->emit_image (image_mask, surface->stream);
+ /* The only image type supported by Type 3 fonts are 1-bit masks */
+ image = _cairo_image_surface_coerce (image, CAIRO_FORMAT_A1);
+ status = surface->emit_image (image, surface->stream);
+ cairo_surface_destroy (&image->base);
_cairo_output_stream_printf (surface->stream,
"Q\n");
- if (image_mask != image)
- cairo_surface_destroy (&image_mask->base);
-
return status;
}