summaryrefslogtreecommitdiff
path: root/perf/cairo-perf.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2008-08-19 11:52:38 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2008-08-19 11:54:07 +0100
commitb30b1c5e2cdb3de62a20b13b7b699db1de32affb (patch)
tree5ea4520278267cc56bdd0ac2f30c0ac1942906f2 /perf/cairo-perf.c
parent776844eb9e4b0eb70621242212d732dfefcb6d8e (diff)
[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.
Diffstat (limited to 'perf/cairo-perf.c')
-rw-r--r--perf/cairo-perf.c13
1 files 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},