Check for error whilst trying to advance along a text string.

The text perf-case tries to fill the region with a single text string,
but fails to detect when the current point does not advance due to an
error. This causes the perf-case to enter an infinite loop, so we break
out when the cairo_status() has been set.
This commit is contained in:
Chris Wilson 2007-04-08 22:56:43 +01:00 committed by Carl Worth
parent ea4945850a
commit 1237eedff3

View file

@ -40,14 +40,14 @@ do_text (cairo_t *cr, int width, int height)
cairo_move_to (cr, 0, i * 10);
cairo_show_text (cr, text + i);
cairo_get_current_point (cr, &x, &y);
while (x < width) {
while (x < width && cairo_status (cr) == CAIRO_STATUS_SUCCESS) {
cairo_show_text (cr, text);
cairo_get_current_point (cr, &x, &y);
}
i++;
if (i >= len)
i = 0;
} while (y < height);
} while (y < height && cairo_status (cr) == CAIRO_STATUS_SUCCESS);
cairo_perf_timer_stop ();