diff options
author | Federico Mena Quintero <federico@gnome.org> | 2018-03-16 08:04:37 -0600 |
---|---|---|
committer | Federico Mena Quintero <federico@gnome.org> | 2018-03-16 10:45:30 -0600 |
commit | 4e5e4ce73bffb3a6852aa9799573af2c79f0a4aa (patch) | |
tree | 498676508e3231912ffcb863716820e24a71b10d | |
parent | 2fb6b64b73ecd1ec1bd8aad449a195d6173ffffa (diff) | |
download | librsvg-4e5e4ce73bffb3a6852aa9799573af2c79f0a4aa.tar.gz |
rsvg_cairo_clip_render_pango_layout(): Just use rsvg_draw_pango_layout() in clipping mode
-rw-r--r-- | librsvg/rsvg-cairo-clip.c | 25 | ||||
-rw-r--r-- | librsvg/rsvg-cairo-render.h | 3 |
2 files changed, 6 insertions, 22 deletions
diff --git a/librsvg/rsvg-cairo-clip.c b/librsvg/rsvg-cairo-clip.c index 8736f504..11010d08 100644 --- a/librsvg/rsvg-cairo-clip.c +++ b/librsvg/rsvg-cairo-clip.c @@ -50,32 +50,13 @@ struct RsvgCairoClipRender { #define RSVG_CAIRO_CLIP_RENDER(render) (_RSVG_RENDER_CIC ((render), RSVG_RENDER_TYPE_CAIRO_CLIP, RsvgCairoClipRender)) static void -rsvg_cairo_clip_render_pango_layout (RsvgDrawingCtx * ctx, PangoLayout * layout, double x, double y) +rsvg_cairo_clip_render_pango_layout (RsvgDrawingCtx *ctx, PangoLayout * layout, double x, double y) { - RsvgCairoClipRender *render = RSVG_CAIRO_CLIP_RENDER (ctx->render); - RsvgCairoRender *cairo_render = &render->super; - cairo_matrix_t affine; - PangoGravity gravity = pango_context_get_gravity (pango_layout_get_context (layout)); - double rotation; - - affine = rsvg_drawing_ctx_get_current_state_affine (ctx); - rsvg_drawing_ctx_set_affine_on_cr (ctx, cairo_render->cr, &affine); - - rotation = pango_gravity_to_rotation (gravity); - - cairo_save (cairo_render->cr); - cairo_move_to (cairo_render->cr, x, y); - if (rotation != 0.) - cairo_rotate (cairo_render->cr, -rotation); - - pango_cairo_update_layout (cairo_render->cr, layout); - pango_cairo_layout_path (cairo_render->cr, layout); - - cairo_restore (cairo_render->cr); + rsvg_draw_pango_layout (ctx, layout, x, y, TRUE); } static void -rsvg_cairo_clip_render_path_builder (RsvgDrawingCtx * ctx, RsvgPathBuilder *builder) +rsvg_cairo_clip_render_path_builder (RsvgDrawingCtx *ctx, RsvgPathBuilder *builder) { rsvg_draw_path_builder (ctx, builder, TRUE); } diff --git a/librsvg/rsvg-cairo-render.h b/librsvg/rsvg-cairo-render.h index aa8b5904..22fe7d20 100644 --- a/librsvg/rsvg-cairo-render.h +++ b/librsvg/rsvg-cairo-render.h @@ -70,6 +70,9 @@ RsvgDrawingCtx *rsvg_cairo_new_drawing_ctx (cairo_t * cr, RsvgHandle * handle); G_GNUC_INTERNAL void rsvg_draw_path_builder (RsvgDrawingCtx * ctx, RsvgPathBuilder *builder, gboolean clipping); +G_GNUC_INTERNAL +void rsvg_draw_pango_layout (RsvgDrawingCtx *ctx, PangoLayout *layout, double x, double y, gboolean clipping); + G_END_DECLS #endif |