From b30b1c5e2cdb3de62a20b13b7b699db1de32affb Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Tue, 19 Aug 2008 11:52:38 +0100 Subject: [perf] Continue testing after we fail to create a surface. Sometimes we cannot create a surface because it is larger than the screen. Ignore these non-fatal errors and move on to the next performance case. --- perf/cairo-perf.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/perf/cairo-perf.c b/perf/cairo-perf.c index 1e0e4eaf..abeab21f 100644 --- a/perf/cairo-perf.c +++ b/perf/cairo-perf.c @@ -53,7 +53,7 @@ typedef struct _cairo_perf_case { unsigned int max_size; } cairo_perf_case_t; -cairo_perf_case_t perf_cases[]; +const cairo_perf_case_t perf_cases[]; /* Some targets just aren't that interesting for performance testing, * (not least because many of these surface types use a meta-surface @@ -358,7 +358,6 @@ int main (int argc, char *argv[]) { int i, j; - cairo_perf_case_t *perf_case; cairo_perf_t perf; cairo_surface_t *surface; @@ -390,8 +389,7 @@ main (int argc, char *argv[]) perf.test_number = 0; for (j = 0; perf_cases[j].run; j++) { - - perf_case = &perf_cases[j]; + const cairo_perf_case_t *perf_case = &perf_cases[j]; for (perf.size = perf_case->min_size; perf.size <= perf_case->max_size; @@ -410,8 +408,7 @@ main (int argc, char *argv[]) fprintf (stderr, "Error: Failed to create target surface: %s\n", target->name); - cairo_perf_fini (&perf); - exit (1); + continue; } cairo_perf_timer_set_synchronize (target->synchronize, closure); @@ -423,8 +420,6 @@ main (int argc, char *argv[]) if (cairo_status (perf.cr)) { fprintf (stderr, "Error: Test left cairo in an error state: %s\n", cairo_status_to_string (cairo_status (perf.cr))); - cairo_perf_fini (&perf); - exit (1); } cairo_destroy (perf.cr); @@ -441,7 +436,7 @@ main (int argc, char *argv[]) return 0; } -cairo_perf_case_t perf_cases[] = { +const cairo_perf_case_t perf_cases[] = { { paint, 256, 512}, { paint_with_alpha, 256, 512}, { fill, 64, 256}, -- cgit v1.2.3