[librsvg] Add rsvg_drawing_ctx_get_pango_context() to call the virtual method
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg] Add rsvg_drawing_ctx_get_pango_context() to call the virtual method
- Date: Fri, 15 Dec 2017 18:53:12 +0000 (UTC)
commit 408df468dba6049f10109641a1710b8e55cef5fc
Author: Federico Mena Quintero <federico gnome org>
Date: Thu Dec 14 14:04:10 2017 -0600
Add rsvg_drawing_ctx_get_pango_context() to call the virtual method
Don't call it by poking at the vtable struct by hand.
rsvg-base.c | 6 ++++++
rsvg-private.h | 3 +++
rsvg-text.c | 2 +-
3 files changed, 10 insertions(+), 1 deletion(-)
---
diff --git a/rsvg-base.c b/rsvg-base.c
index ba0a9fa..72c10b1 100644
--- a/rsvg-base.c
+++ b/rsvg-base.c
@@ -1792,6 +1792,12 @@ rsvg_drawing_ctx_set_current_state_affine (RsvgDrawingCtx *ctx, cairo_matrix_t *
rsvg_current_state (ctx)->affine = *affine;
}
+PangoContext *
+rsvg_drawing_ctx_get_pango_context (RsvgDrawingCtx *draw_ctx)
+{
+ return draw_ctx->render->get_pango_context (draw_ctx);
+}
+
void
rsvg_render_path_builder (RsvgDrawingCtx * ctx, RsvgPathBuilder *builder)
{
diff --git a/rsvg-private.h b/rsvg-private.h
index f87c917..a923c0e 100644
--- a/rsvg-private.h
+++ b/rsvg-private.h
@@ -534,6 +534,9 @@ G_GNUC_INTERNAL
void rsvg_drawing_ctx_set_current_state_affine (RsvgDrawingCtx *ctx, cairo_matrix_t *affine);
G_GNUC_INTERNAL
+PangoContext *rsvg_drawing_ctx_get_pango_context (RsvgDrawingCtx *draw_ctx);
+
+G_GNUC_INTERNAL
double _rsvg_css_accumulate_baseline_shift (RsvgState * state, RsvgDrawingCtx * ctx);
/* Implemented in rust/src/length.rs */
diff --git a/rsvg-text.c b/rsvg-text.c
index 07a1b29..61190cb 100644
--- a/rsvg-text.c
+++ b/rsvg-text.c
@@ -562,7 +562,7 @@ rsvg_text_create_layout (RsvgDrawingCtx *ctx, const char *text)
state = rsvg_current_state (ctx);
- context = ctx->render->get_pango_context (ctx);
+ context = rsvg_drawing_ctx_get_pango_context (ctx);
if (state->lang)
pango_context_set_language (context, pango_language_from_string (state->lang));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]