mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-05 06:28:01 +02:00
test: use CAIRO_MIME_TYPE_UNIQUE_ID with record-text-transform
The PS output from this test is > 100MB due to the duplicated images. Using CAIRO_MIME_TYPE_UNIQUE_ID reduces the PS output to 650k, runs considerably faster, and now produces correct output.
This commit is contained in:
parent
5ffbaf9e2f
commit
71746c37d4
4 changed files with 16 additions and 0 deletions
|
|
@ -1668,6 +1668,7 @@ cairo_test_create_surface_from_png (const cairo_test_context_t *ctx,
|
|||
{
|
||||
cairo_surface_t *image;
|
||||
cairo_status_t status;
|
||||
char *unique_id;
|
||||
|
||||
image = cairo_image_surface_create_from_png (filename);
|
||||
status = cairo_surface_status (image);
|
||||
|
|
@ -1683,6 +1684,10 @@ cairo_test_create_surface_from_png (const cairo_test_context_t *ctx,
|
|||
free (srcdir_filename);
|
||||
}
|
||||
}
|
||||
unique_id = strdup(filename);
|
||||
cairo_surface_set_mime_data (image, CAIRO_MIME_TYPE_UNIQUE_ID,
|
||||
(unsigned char *)unique_id, strlen(unique_id),
|
||||
free, unique_id);
|
||||
|
||||
return image;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,6 +46,8 @@ static uint32_t data[16] = {
|
|||
0xff00ff00, 0xff00ff00, 0xff0000ff, 0xff0000ff
|
||||
};
|
||||
|
||||
static const char *unique_id = "data";
|
||||
|
||||
static const char *png_filename = "romedalen.png";
|
||||
|
||||
static cairo_t *
|
||||
|
|
@ -70,6 +72,9 @@ paint_alpha (cairo_t *cr)
|
|||
|
||||
surface = cairo_image_surface_create_for_data ((unsigned char *) data,
|
||||
CAIRO_FORMAT_RGB24, 4, 4, 16);
|
||||
cairo_surface_set_mime_data (surface, CAIRO_MIME_TYPE_UNIQUE_ID,
|
||||
(unsigned char *)unique_id, strlen(unique_id),
|
||||
NULL, NULL);
|
||||
|
||||
cairo_test_paint_checkered (cr);
|
||||
|
||||
|
|
@ -106,6 +111,9 @@ paint_alpha_clip (cairo_t *cr)
|
|||
|
||||
surface = cairo_image_surface_create_for_data ((unsigned char *) data,
|
||||
CAIRO_FORMAT_RGB24, 4, 4, 16);
|
||||
cairo_surface_set_mime_data (surface, CAIRO_MIME_TYPE_UNIQUE_ID,
|
||||
(unsigned char *)unique_id, strlen(unique_id),
|
||||
NULL, NULL);
|
||||
|
||||
cairo_test_paint_checkered (cr);
|
||||
|
||||
|
|
@ -131,6 +139,9 @@ paint_alpha_clip_mask (cairo_t *cr)
|
|||
|
||||
surface = cairo_image_surface_create_for_data ((unsigned char *) data,
|
||||
CAIRO_FORMAT_RGB24, 4, 4, 16);
|
||||
cairo_surface_set_mime_data (surface, CAIRO_MIME_TYPE_UNIQUE_ID,
|
||||
(unsigned char *)unique_id, strlen(unique_id),
|
||||
NULL, NULL);
|
||||
|
||||
cairo_test_paint_checkered (cr);
|
||||
|
||||
|
|
|
|||
Binary file not shown.
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 3.9 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 3.9 KiB |
Loading…
Add table
Reference in a new issue