summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2022-01-19 07:05:29 -0500
committerMatthias Clasen <mclasen@redhat.com>2022-01-24 10:58:17 -0500
commitd513c60b22b882e546af1f72cfd9db8431336dd8 (patch)
treed24b0ea2721ecbd4b78082e9047270a20e9445ab
parent17c983c4998e6f203d35d601b0d7d857a209de8b (diff)
downloadpango-d513c60b22b882e546af1f72cfd9db8431336dd8.tar.gz
Port test-pangocairo-threads
-rw-r--r--tests/test-pangocairo-threads.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/tests/test-pangocairo-threads.c b/tests/test-pangocairo-threads.c
index ea97fc17..308f87e4 100644
--- a/tests/test-pangocairo-threads.c
+++ b/tests/test-pangocairo-threads.c
@@ -18,17 +18,20 @@ create_surface (void)
return cairo_image_surface_create (CAIRO_FORMAT_A8, WIDTH, HEIGHT);
}
-static PangoLayout *
+static PangoSimpleLayout *
create_layout (cairo_t *cr)
{
- PangoLayout *layout = pango_cairo_create_layout (cr);
- pango_layout_set_text (layout, text, -1);
- pango_layout_set_width (layout, WIDTH * PANGO_SCALE);
+ PangoSimpleLayout *layout;
+
+ layout = pango_cairo_create_simple_layout (cr);
+ pango_simple_layout_set_text (layout, text, -1);
+ pango_simple_layout_set_width (layout, WIDTH * PANGO_SCALE);
+
return layout;
}
static void
-draw (cairo_t *cr, PangoLayout *layout, unsigned int i)
+draw (cairo_t *cr, PangoSimpleLayout *layout, unsigned int i)
{
cairo_set_source_rgba (cr, 1, 1, 1, 1);
cairo_paint (cr);
@@ -37,16 +40,16 @@ draw (cairo_t *cr, PangoLayout *layout, unsigned int i)
cairo_identity_matrix (cr);
cairo_scale (cr, (100 + i) / 100., (100 + i) / 100.);
- pango_cairo_update_layout (cr, layout);
+ pango_cairo_update_context (cr, pango_simple_layout_get_context (layout));
- pango_cairo_show_layout (cr, layout);
+ pango_cairo_show_lines (cr, pango_simple_layout_get_lines (layout));
}
static gpointer
thread_func (gpointer data)
{
cairo_surface_t *surface = data;
- PangoLayout *layout;
+ PangoSimpleLayout *layout;
int i;
cairo_t *cr = cairo_create (surface);
@@ -99,7 +102,7 @@ pangocairo_threads (void)
{
cairo_surface_t *ref_surface = create_surface ();
cairo_t *cr = cairo_create (ref_surface);
- PangoLayout *layout = create_layout (cr);
+ PangoSimpleLayout *layout = create_layout (cr);
unsigned char *ref_data = cairo_image_surface_get_data (ref_surface);
unsigned int len = WIDTH * HEIGHT;