diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2009-06-07 23:35:57 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2009-06-07 23:35:57 +0100 |
commit | 055e9b0eb650bec6ae8297e5a36f1cac22c43d56 (patch) | |
tree | 323037d404202f3598022a33fef6d5183be726bd /test/solid-pattern-cache-stress.c | |
parent | 25c37509396a89deb644cbd6ada99137ba9d3095 (diff) |
[test] Cache resolved scaled-font
The intention is to stress test the solid pattern caches, so we can cheat
and avoid repeatedly resolving the toy font.
Diffstat (limited to 'test/solid-pattern-cache-stress.c')
-rw-r--r-- | test/solid-pattern-cache-stress.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/solid-pattern-cache-stress.c b/test/solid-pattern-cache-stress.c index 285275e1d..c2a1c1526 100644 --- a/test/solid-pattern-cache-stress.c +++ b/test/solid-pattern-cache-stress.c @@ -37,6 +37,8 @@ #define drand48() (rand () / (double) RAND_MAX) #endif +static cairo_scaled_font_t *scaled_font; + static cairo_t * _cairo_create_similar (cairo_t *cr, int width, int height) { @@ -93,6 +95,7 @@ _draw (cairo_t *cr, cairo_mask (cr, cairo_get_source (cr)); + cairo_set_scaled_font (cr, scaled_font); cairo_text_extents (cr, "cairo", &extents); cairo_move_to (cr, -extents.x_bearing - .5 * extents.width, @@ -173,6 +176,9 @@ draw (cairo_t *cr, int width, int height) }; int i, j, loop; + /* cache a resolved scaled-font */ + scaled_font = cairo_get_scaled_font (cr); + for (loop = 0; loop < LOOPS; loop++) { for (i = 0; i < LOOPS; i++) { for (j = 0; j < 8; j++) { |