diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2009-06-12 12:25:22 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2009-06-12 22:28:38 +0100 |
commit | 6aebde6598c629d667b06e20111106832d139c4d (patch) | |
tree | 218758c9489dbf4d5c70a5e6590d1f999f0c85dd /boilerplate | |
parent | d008167b9bcd6a24199740183bbfcabcfdccdd63 (diff) |
[boilerplate] Export cairo_boilerplate_get_image_target()
A routine to scan the compiled list of targets and return the entry
corresponding to the image backend.
Diffstat (limited to 'boilerplate')
-rw-r--r-- | boilerplate/cairo-boilerplate.c | 17 | ||||
-rw-r--r-- | boilerplate/cairo-boilerplate.h | 3 |
2 files changed, 20 insertions, 0 deletions
diff --git a/boilerplate/cairo-boilerplate.c b/boilerplate/cairo-boilerplate.c index 31df7047..03173379 100644 --- a/boilerplate/cairo-boilerplate.c +++ b/boilerplate/cairo-boilerplate.c @@ -850,6 +850,23 @@ cairo_boilerplate_get_targets (int *pnum_targets, cairo_bool_t *plimited_targets return targets_to_test; } +const cairo_boilerplate_target_t * +cairo_boilerplate_get_image_target (cairo_content_t content) +{ + int num_targets, i; + + num_targets = sizeof (targets) / sizeof (targets[0]); + for (i = 0; i < num_targets; i++) { + if (targets[i].expected_type == CAIRO_SURFACE_TYPE_IMAGE && + targets[i].content == content) + { + return &targets[i]; + } + } + + return NULL; +} + void cairo_boilerplate_free_targets (cairo_boilerplate_target_t **targets) { diff --git a/boilerplate/cairo-boilerplate.h b/boilerplate/cairo-boilerplate.h index d3b86d17..ba3c4eb5 100644 --- a/boilerplate/cairo-boilerplate.h +++ b/boilerplate/cairo-boilerplate.h @@ -165,6 +165,9 @@ typedef struct _cairo_boilerplate_target cairo_bool_t is_meta; } cairo_boilerplate_target_t; +const cairo_boilerplate_target_t * +cairo_boilerplate_get_image_target (cairo_content_t content); + cairo_boilerplate_target_t ** cairo_boilerplate_get_targets (int *num_targets, cairo_bool_t *limited_targets); |