mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-05 22:48:07 +02:00
Merge branch 'master' of git+ssh://git.cairographics.org/git/cairo into cairo-master
This commit is contained in:
commit
97f26c5235
5 changed files with 34 additions and 34 deletions
|
|
@ -968,7 +968,7 @@ create_xlib_surface (const char *name,
|
|||
* step better would be to always test the non-Render fallbacks
|
||||
* for each test even if the server does have the Render
|
||||
* extension. That would probably be through another
|
||||
* cairo_test_target which would use an extended version of
|
||||
* cairo_boilerplate_target which would use an extended version of
|
||||
* cairo_test_xlib_disable_render. */
|
||||
switch (content) {
|
||||
case CAIRO_CONTENT_COLOR_ALPHA:
|
||||
|
|
@ -1340,7 +1340,7 @@ cleanup_svg (void *closure)
|
|||
}
|
||||
#endif /* CAIRO_HAS_SVG_SURFACE && CAIRO_CAN_TEST_SVG_SURFACE */
|
||||
|
||||
cairo_test_target_t targets[] =
|
||||
cairo_boilerplate_target_t targets[] =
|
||||
{
|
||||
/* I'm uncompromising about leaving the image backend as 0
|
||||
* for tolerance. There shouldn't ever be anything that is out of
|
||||
|
|
|
|||
|
|
@ -89,31 +89,31 @@ _cairo_test_content_name (cairo_content_t content);
|
|||
#endif
|
||||
|
||||
typedef cairo_surface_t *
|
||||
(*cairo_test_create_target_surface_t) (const char *name,
|
||||
(*cairo_boilerplate_create_surface_t) (const char *name,
|
||||
cairo_content_t content,
|
||||
int width,
|
||||
int height,
|
||||
void **closure);
|
||||
|
||||
typedef cairo_status_t
|
||||
(*cairo_test_write_to_png_t) (cairo_surface_t *surface, const char *filename);
|
||||
(*cairo_boilerplate_write_to_png_t) (cairo_surface_t *surface, const char *filename);
|
||||
|
||||
typedef void
|
||||
(*cairo_test_cleanup_target_t) (void *closure);
|
||||
(*cairo_boilerplate_cleanup_t) (void *closure);
|
||||
|
||||
typedef struct _cairo_test_target
|
||||
typedef struct _cairo_boilerplate_target
|
||||
{
|
||||
const char *name;
|
||||
cairo_surface_type_t expected_type;
|
||||
cairo_content_t content;
|
||||
int error_tolerance;
|
||||
cairo_test_create_target_surface_t create_target_surface;
|
||||
cairo_test_write_to_png_t write_to_png;
|
||||
cairo_test_cleanup_target_t cleanup_target;
|
||||
unsigned int error_tolerance;
|
||||
cairo_boilerplate_create_surface_t create_surface;
|
||||
cairo_boilerplate_write_to_png_t write_to_png;
|
||||
cairo_boilerplate_cleanup_t cleanup;
|
||||
void *closure;
|
||||
} cairo_test_target_t;
|
||||
} cairo_boilerplate_target_t;
|
||||
|
||||
extern cairo_test_target_t targets[];
|
||||
extern cairo_boilerplate_target_t targets[];
|
||||
|
||||
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)
|
||||
#define CAIRO_PRINTF_FORMAT(fmt_index, va_index) \
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ cairo_perf_t perfs[];
|
|||
* loops wouldn't count the real work, just the recording by the
|
||||
* meta-surface. */
|
||||
static cairo_bool_t
|
||||
target_is_measurable (cairo_test_target_t *target)
|
||||
target_is_measurable (cairo_boilerplate_target_t *target)
|
||||
{
|
||||
switch (target->expected_type) {
|
||||
case CAIRO_SURFACE_TYPE_IMAGE:
|
||||
|
|
@ -134,7 +134,7 @@ int
|
|||
main (int argc, char *argv[])
|
||||
{
|
||||
int i, j, k;
|
||||
cairo_test_target_t *target;
|
||||
cairo_boilerplate_target_t *target;
|
||||
cairo_perf_t *perf;
|
||||
cairo_surface_t *surface;
|
||||
cairo_t *cr;
|
||||
|
|
@ -159,10 +159,10 @@ main (int argc, char *argv[])
|
|||
for (j = 0; perfs[j].name; j++) {
|
||||
perf = &perfs[j];
|
||||
for (size = perf->min_size; size <= perf->max_size; size *= 2) {
|
||||
surface = (target->create_target_surface) (perf->name,
|
||||
target->content,
|
||||
size, size,
|
||||
&target->closure);
|
||||
surface = (target->create_surface) (perf->name,
|
||||
target->content,
|
||||
size, size,
|
||||
&target->closure);
|
||||
cr = cairo_create (surface);
|
||||
for (k =0; k < cairo_perf_iterations; k++) {
|
||||
cairo_perf_yield ();
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ draw (cairo_t *cr, int width, int height)
|
|||
cairo_status_t status;
|
||||
const char *srcdir = getenv ("srcdir");
|
||||
char *filename;
|
||||
int *face_count;
|
||||
int face_count;
|
||||
struct stat stat_buf;
|
||||
|
||||
if (! srcdir)
|
||||
|
|
@ -66,7 +66,7 @@ draw (cairo_t *cr, int width, int height)
|
|||
return CAIRO_TEST_FAILURE;
|
||||
}
|
||||
|
||||
pattern = FcFreeTypeQuery (filename, 0, NULL, &face_count);
|
||||
pattern = FcFreeTypeQuery ((unsigned char *)filename, 0, NULL, &face_count);
|
||||
free (filename);
|
||||
if (! pattern) {
|
||||
cairo_test_log ("FcFreeTypeQuery failed.\n");
|
||||
|
|
|
|||
|
|
@ -178,9 +178,9 @@ done:
|
|||
}
|
||||
|
||||
static cairo_test_status_t
|
||||
cairo_test_for_target (cairo_test_t *test,
|
||||
cairo_test_target_t *target,
|
||||
int dev_offset)
|
||||
cairo_test_for_target (cairo_test_t *test,
|
||||
cairo_boilerplate_target_t *target,
|
||||
int dev_offset)
|
||||
{
|
||||
cairo_test_status_t status;
|
||||
cairo_surface_t *surface;
|
||||
|
|
@ -216,11 +216,11 @@ cairo_test_for_target (cairo_test_t *test,
|
|||
test->height += dev_offset;
|
||||
}
|
||||
|
||||
surface = (target->create_target_surface) (test->name,
|
||||
target->content,
|
||||
test->width,
|
||||
test->height,
|
||||
&target->closure);
|
||||
surface = (target->create_surface) (test->name,
|
||||
target->content,
|
||||
test->width,
|
||||
test->height,
|
||||
&target->closure);
|
||||
|
||||
if (test->width && test->height) {
|
||||
test->width -= dev_offset;
|
||||
|
|
@ -343,8 +343,8 @@ UNWIND_SURFACE:
|
|||
|
||||
cairo_debug_reset_static_data ();
|
||||
|
||||
if (target->cleanup_target)
|
||||
target->cleanup_target (target->closure);
|
||||
if (target->cleanup)
|
||||
target->cleanup (target->closure);
|
||||
|
||||
UNWIND_STRINGS:
|
||||
if (png_name)
|
||||
|
|
@ -380,7 +380,7 @@ cairo_test_expecting (cairo_test_t *test,
|
|||
void (*old_segfault_handler)(int);
|
||||
#endif
|
||||
volatile cairo_test_status_t status, ret;
|
||||
cairo_test_target_t ** volatile targets_to_test;
|
||||
cairo_boilerplate_target_t ** volatile targets_to_test;
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
if (isatty (2)) {
|
||||
|
|
@ -418,7 +418,7 @@ cairo_test_expecting (cairo_test_t *test,
|
|||
if (0 == strncmp (targets[i].name, tname, end - tname) &&
|
||||
!isalnum (targets[i].name[end - tname])) {
|
||||
/* realloc isn't exactly the best thing here, but meh. */
|
||||
targets_to_test = realloc (targets_to_test, sizeof(cairo_test_target_t *) * (num_targets+1));
|
||||
targets_to_test = realloc (targets_to_test, sizeof(cairo_boilerplate_target_t *) * (num_targets+1));
|
||||
targets_to_test[num_targets++] = &targets[i];
|
||||
found = 1;
|
||||
}
|
||||
|
|
@ -437,7 +437,7 @@ cairo_test_expecting (cairo_test_t *test,
|
|||
num_targets = 0;
|
||||
for (i = 0; targets[i].name != NULL; i++)
|
||||
num_targets++;
|
||||
targets_to_test = malloc (sizeof(cairo_test_target_t*) * num_targets);
|
||||
targets_to_test = malloc (sizeof(cairo_boilerplate_target_t*) * num_targets);
|
||||
for (i = 0; i < num_targets; i++) {
|
||||
targets_to_test[i] = &targets[i];
|
||||
}
|
||||
|
|
@ -460,7 +460,7 @@ cairo_test_expecting (cairo_test_t *test,
|
|||
ret = CAIRO_TEST_UNTESTED;
|
||||
for (i = 0; i < num_targets; i++) {
|
||||
for (j = 0; j < NUM_DEVICE_OFFSETS; j++) {
|
||||
cairo_test_target_t * volatile target = targets_to_test[i];
|
||||
cairo_boilerplate_target_t * volatile target = targets_to_test[i];
|
||||
volatile int dev_offset = j * 25;
|
||||
|
||||
cairo_test_log ("Testing %s with %s target (dev offset %d)\n", test->name, target->name, dev_offset);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue