[pango] Make test-pangocairo-threads stress fontconfig more



commit 50c692acd35b2c0cfe6125f820e5480f4b59ef19
Author: Behdad Esfahbod <behdad behdad org>
Date:   Mon Jan 7 01:19:49 2013 -0600

    Make test-pangocairo-threads stress fontconfig more

 tests/test-pangocairo-threads.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)
---
diff --git a/tests/test-pangocairo-threads.c b/tests/test-pangocairo-threads.c
index e358f74..b33de73 100644
--- a/tests/test-pangocairo-threads.c
+++ b/tests/test-pangocairo-threads.c
@@ -27,15 +27,16 @@ create_layout (cairo_t *cr)
 }
 
 static void
-draw (cairo_t *cr, PangoLayout *layout)
+draw (cairo_t *cr, PangoLayout *layout, unsigned int i)
 {
   cairo_set_source_rgba (cr, 1, 1, 1, 1);
   cairo_paint (cr);
   cairo_set_source_rgba (cr, 1, 1, 1, 0);
   cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
 
-  /* force a relayout */
-  pango_layout_context_changed (layout);
+  cairo_identity_matrix (cr);
+  cairo_scale (cr, (100 + i) / 10.,  (100 + i) / 10.);
+  pango_cairo_update_layout (cr, layout);
 
   pango_cairo_show_layout (cr, layout);
 }
@@ -55,7 +56,7 @@ thread_func (gpointer data)
   g_mutex_unlock (&mutex);
 
   for (i = 0; i < num_iters; i++)
-    draw (cr, layout);
+    draw (cr, layout, i);
 
   return 0;
 }
@@ -99,7 +100,7 @@ main (int argc, char **argv)
     unsigned char *ref_data = cairo_image_surface_get_data (ref_surface);
     unsigned int len = WIDTH * HEIGHT;
 
-    draw (cr, layout);
+    draw (cr, layout, num_iters - 1);
 
     /* cairo_surface_write_to_png (ref_surface, "test-pangocairo-threads-reference.png"); */
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]