mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2025-12-27 14:00:14 +01:00
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:
parent
ea4945850a
commit
1237eedff3
1 changed files with 2 additions and 2 deletions
|
|
@ -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 ();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue