summaryrefslogtreecommitdiff
path: root/perf
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2010-03-27 21:52:16 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2010-03-27 21:53:55 +0000
commit97f8c20727eaeb2dfddb0d4796192cc042eb14fa (patch)
tree87a4a060c395ed7f5704d4b37026d8f163ed06d7 /perf
parent022291be1cbddf4f6722f0bf76ebda6922780276 (diff)
boilerplate: Create an image16 target
In order to exercise the newly restored r5g6g5 support, we need to create an appropriate surface and feed it through the test and performance suites.
Diffstat (limited to 'perf')
-rw-r--r--perf/cairo-perf-micro.c59
-rw-r--r--perf/cairo-perf-trace.c67
2 files changed, 2 insertions, 124 deletions
diff --git a/perf/cairo-perf-micro.c b/perf/cairo-perf-micro.c
index eec32ef7..ec40409c 100644
--- a/perf/cairo-perf-micro.c
+++ b/perf/cairo-perf-micro.c
@@ -62,63 +62,6 @@ typedef struct _cairo_perf_case {
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 recording-surface
- * and as such defer the "real" rendering to later, so our timing
- * loops wouldn't count the real work, just the recording by the
- * recording-surface. */
-static cairo_bool_t
-target_is_measurable (const cairo_boilerplate_target_t *target)
-{
- switch ((int) target->expected_type) {
- case CAIRO_SURFACE_TYPE_IMAGE:
- if (strcmp (target->name, "pdf") == 0 ||
- strcmp (target->name, "ps") == 0)
- {
- return FALSE;
- }
- else
- {
- return TRUE;
- }
- case CAIRO_SURFACE_TYPE_XLIB:
- if (strcmp (target->name, "xlib-fallback") == 0 ||
- strcmp (target->name, "xlib-reference") == 0)
- {
- return FALSE;
- }
- else
- {
- return TRUE;
- }
- case CAIRO_SURFACE_TYPE_XCB:
- case CAIRO_SURFACE_TYPE_GLITZ:
- case CAIRO_SURFACE_TYPE_QUARTZ:
- 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
-#if CAIRO_HAS_GL_SURFACE
- case CAIRO_SURFACE_TYPE_GL:
-#endif
-#if CAIRO_HAS_DRM_SURFACE
- case CAIRO_SURFACE_TYPE_DRM:
-#endif
-#if CAIRO_HAS_SKIA_SURFACE
- case CAIRO_SURFACE_TYPE_SKIA:
-#endif
- return TRUE;
-
- default:
- return FALSE;
- }
-}
-
static const char *
_content_to_string (cairo_content_t content, cairo_bool_t similar)
{
@@ -514,7 +457,7 @@ main (int argc, char *argv[])
for (i = 0; i < perf.num_targets; i++) {
const cairo_boilerplate_target_t *target = perf.targets[i];
- if (! target_is_measurable (target))
+ if (! target->is_measurable)
continue;
perf.target = target;
diff --git a/perf/cairo-perf-trace.c b/perf/cairo-perf-trace.c
index 88c797b6..a87ef337 100644
--- a/perf/cairo-perf-trace.c
+++ b/perf/cairo-perf-trace.c
@@ -68,71 +68,6 @@
#define CAIRO_PERF_MIN_STD_DEV_COUNT 3
#define CAIRO_PERF_STABLE_STD_DEV_COUNT 3
-/* Some targets just aren't that interesting for performance testing,
- * (not least because many of these surface types use a recording-surface
- * and as such defer the "real" rendering to later, so our timing
- * loops wouldn't count the real work, just the recording by the
- * recording-surface. */
-static cairo_bool_t
-target_is_measurable (const cairo_boilerplate_target_t *target)
-{
- if (target->content != CAIRO_CONTENT_COLOR_ALPHA)
- return FALSE;
-
- switch ((int) target->expected_type) {
- case CAIRO_SURFACE_TYPE_IMAGE:
- if (strcmp (target->name, "pdf") == 0 ||
- strcmp (target->name, "ps") == 0)
- {
- return FALSE;
- }
- else
- {
- return TRUE;
- }
- case CAIRO_SURFACE_TYPE_XLIB:
- if (strcmp (target->name, "xlib-fallback") == 0 ||
- strcmp (target->name, "xlib-reference") == 0)
- {
- return FALSE;
- }
- else
- {
- return TRUE;
- }
- case CAIRO_SURFACE_TYPE_XCB:
- case CAIRO_SURFACE_TYPE_GLITZ:
- case CAIRO_SURFACE_TYPE_QUARTZ:
- 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_HAS_QT_SURFACE
- case CAIRO_SURFACE_TYPE_QT:
-#endif
-#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1,9,3)
- case CAIRO_INTERNAL_SURFACE_TYPE_NULL:
-#endif
-#if CAIRO_HAS_GL_SURFACE
- case CAIRO_SURFACE_TYPE_GL:
-#endif
-#if CAIRO_HAS_DRM_SURFACE
- case CAIRO_SURFACE_TYPE_DRM:
-#endif
-#if CAIRO_HAS_SKIA_SURFACE
- case CAIRO_SURFACE_TYPE_SKIA:
-#endif
- return TRUE;
- case CAIRO_SURFACE_TYPE_PDF:
- case CAIRO_SURFACE_TYPE_PS:
- case CAIRO_SURFACE_TYPE_SVG:
- default:
- return FALSE;
- }
-}
-
cairo_bool_t
cairo_perf_can_run (cairo_perf_t *perf,
const char *name,
@@ -848,7 +783,7 @@ main (int argc, char *argv[])
for (i = 0; i < perf.num_targets; i++) {
const cairo_boilerplate_target_t *target = perf.targets[i];
- if (! perf.list_only && ! target_is_measurable (target))
+ if (! perf.list_only && ! target->is_measurable)
continue;
perf.target = target;