diff options
author | Adrian Johnson <ajohnson@redneon.com> | 2017-11-09 20:52:36 +1030 |
---|---|---|
committer | Adrian Johnson <ajohnson@redneon.com> | 2017-11-09 22:02:05 +1030 |
commit | 71746c37d48a08d56b18d4d82185896ada215194 (patch) | |
tree | fedf44349a2e15feb23f65d61e2615c37064a610 /test/record.c | |
parent | 5ffbaf9e2f7da103da8d015b5f928e25f9433b60 (diff) | |
download | cairo-71746c37d48a08d56b18d4d82185896ada215194.tar.gz |
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.
Diffstat (limited to 'test/record.c')
-rw-r--r-- | test/record.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/record.c b/test/record.c index b1baadace..774c13316 100644 --- a/test/record.c +++ b/test/record.c @@ -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); |