From ef0d307d549b9cc7a98cdce2ee4bae40d0fd0bd1 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sun, 21 Jun 2009 08:43:55 +0100 Subject: [PATCH] [perf] Need to version surface types As cairo-perf-diff will execute the current cairo-perf against historical revisions, any introduced api must be protect in order to compile on old versions. --- perf/cairo-perf-trace.c | 8 ++++++++ perf/cairo-perf.c | 6 ++++++ 2 files changed, 14 insertions(+) diff --git a/perf/cairo-perf-trace.c b/perf/cairo-perf-trace.c index 6859a0d7f..512bfa255 100644 --- a/perf/cairo-perf-trace.c +++ b/perf/cairo-perf-trace.c @@ -30,6 +30,8 @@ #define _GNU_SOURCE 1 /* for sched_getaffinity() and getline() */ +#include "../cairo-version.h" /* for the real version */ + #include "cairo-perf.h" #include "cairo-stats.h" @@ -98,9 +100,15 @@ target_is_measurable (const cairo_boilerplate_target_t *target) case CAIRO_SURFACE_TYPE_WIN32: case CAIRO_SURFACE_TYPE_BEOS: case CAIRO_SURFACE_TYPE_DIRECTFB: +#if CAIRO_VERSION > CAIRO_VERSION_ENCODE(1,1,2) case CAIRO_SURFACE_TYPE_OS2: +#endif +#if CAIRO_VERSION > CAIRO_VERSION_ENCODE(1,9,3) case CAIRO_SURFACE_TYPE_QT: +#endif +#if CAIRO_VERSION > CAIRO_VERSION_ENCODE(1,9,3) case CAIRO_INTERNAL_SURFACE_TYPE_NULL: +#endif return TRUE; case CAIRO_SURFACE_TYPE_PDF: case CAIRO_SURFACE_TYPE_PS: diff --git a/perf/cairo-perf.c b/perf/cairo-perf.c index 4965e577d..40cc28a4d 100644 --- a/perf/cairo-perf.c +++ b/perf/cairo-perf.c @@ -28,6 +28,8 @@ #define _GNU_SOURCE 1 /* for sched_getaffinity() */ +#include "../cairo-version.h" /* for the real version */ + #include "cairo-perf.h" #include "cairo-stats.h" @@ -92,8 +94,12 @@ target_is_measurable (const cairo_boilerplate_target_t *target) case CAIRO_SURFACE_TYPE_WIN32: case CAIRO_SURFACE_TYPE_BEOS: case CAIRO_SURFACE_TYPE_DIRECTFB: +#if CAIRO_VERSION > CAIRO_VERSION_ENCODE(1,1,2) case CAIRO_SURFACE_TYPE_OS2: +#endif +#if CAIRO_VERSION > CAIRO_VERSION_ENCODE(1,9,4) case CAIRO_SURFACE_TYPE_QT: +#endif return TRUE; case CAIRO_SURFACE_TYPE_PDF: case CAIRO_SURFACE_TYPE_PS: