mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-22 19:38:18 +02:00
[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.
This commit is contained in:
parent
d008167b9b
commit
6aebde6598
2 changed files with 20 additions and 0 deletions
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue