mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-04-04 15:30:38 +02:00
boilerplate: Create an image16 target
In order to exercise the newly restored r5g6g5 support, we need to create an appropriate surface and feed it through the test and performance suites.
This commit is contained in:
parent
022291be1c
commit
97f8c20727
19 changed files with 120 additions and 177 deletions
|
|
@ -216,7 +216,8 @@ static const cairo_boilerplate_target_t targets[] = {
|
|||
NULL, NULL,
|
||||
_cairo_boilerplate_get_image_surface,
|
||||
cairo_surface_write_to_png,
|
||||
_cairo_boilerplate_directfb_cleanup
|
||||
_cairo_boilerplate_directfb_cleanup,
|
||||
NULL, TRUE, FALSE, FALSE
|
||||
},
|
||||
{
|
||||
"directfb-bitmap", "directfb", NULL, NULL,
|
||||
|
|
@ -226,7 +227,8 @@ static const cairo_boilerplate_target_t targets[] = {
|
|||
NULL, NULL,
|
||||
_cairo_boilerplate_get_image_surface,
|
||||
cairo_surface_write_to_png,
|
||||
_cairo_boilerplate_directfb_cleanup
|
||||
_cairo_boilerplate_directfb_cleanup,
|
||||
NULL, FALSE, FALSE, FALSE
|
||||
},
|
||||
};
|
||||
CAIRO_BOILERPLATE (directfb, targets);
|
||||
|
|
|
|||
|
|
@ -76,7 +76,8 @@ static const cairo_boilerplate_target_t targets[] = {
|
|||
_cairo_boilerplate_get_image_surface,
|
||||
cairo_surface_write_to_png,
|
||||
NULL,
|
||||
_cairo_boilerplate_drm_synchronize
|
||||
_cairo_boilerplate_drm_synchronize,
|
||||
TRUE, FALSE, FALSE
|
||||
},
|
||||
{
|
||||
"drm", "drm", NULL, NULL,
|
||||
|
|
@ -87,7 +88,8 @@ static const cairo_boilerplate_target_t targets[] = {
|
|||
_cairo_boilerplate_get_image_surface,
|
||||
cairo_surface_write_to_png,
|
||||
NULL,
|
||||
_cairo_boilerplate_drm_synchronize
|
||||
_cairo_boilerplate_drm_synchronize,
|
||||
FALSE, FALSE, FALSE
|
||||
},
|
||||
};
|
||||
CAIRO_BOILERPLATE (drm, targets)
|
||||
|
|
|
|||
|
|
@ -332,7 +332,8 @@ static const cairo_boilerplate_target_t targets[] = {
|
|||
_cairo_boilerplate_get_image_surface,
|
||||
cairo_surface_write_to_png,
|
||||
_cairo_boilerplate_gl_cleanup,
|
||||
_cairo_boilerplate_gl_synchronize
|
||||
_cairo_boilerplate_gl_synchronize,
|
||||
TRUE, FALSE, FALSE
|
||||
},
|
||||
{
|
||||
"gl", "gl", NULL, NULL,
|
||||
|
|
@ -343,7 +344,8 @@ static const cairo_boilerplate_target_t targets[] = {
|
|||
_cairo_boilerplate_get_image_surface,
|
||||
cairo_surface_write_to_png,
|
||||
_cairo_boilerplate_gl_cleanup,
|
||||
_cairo_boilerplate_gl_synchronize
|
||||
_cairo_boilerplate_gl_synchronize,
|
||||
FALSE, FALSE, FALSE
|
||||
},
|
||||
{
|
||||
"gl-window", "gl", NULL, NULL,
|
||||
|
|
@ -355,7 +357,8 @@ static const cairo_boilerplate_target_t targets[] = {
|
|||
_cairo_boilerplate_get_image_surface,
|
||||
cairo_surface_write_to_png,
|
||||
_cairo_boilerplate_gl_cleanup,
|
||||
_cairo_boilerplate_gl_synchronize
|
||||
_cairo_boilerplate_gl_synchronize,
|
||||
FALSE, FALSE, FALSE
|
||||
},
|
||||
#if CAIRO_HAS_EGL_FUNCTIONS
|
||||
{
|
||||
|
|
@ -367,7 +370,8 @@ static const cairo_boilerplate_target_t targets[] = {
|
|||
_cairo_boilerplate_get_image_surface,
|
||||
cairo_surface_write_to_png,
|
||||
_cairo_boilerplate_egl_cleanup,
|
||||
_cairo_boilerplate_egl_synchronize
|
||||
_cairo_boilerplate_egl_synchronize,
|
||||
TRUE, FALSE, FALSE
|
||||
},
|
||||
#endif
|
||||
};
|
||||
|
|
|
|||
|
|
@ -241,7 +241,7 @@ static const cairo_boilerplate_target_t targets[] = {
|
|||
_cairo_boilerplate_pdf_get_image_surface,
|
||||
_cairo_boilerplate_pdf_surface_write_to_png,
|
||||
_cairo_boilerplate_pdf_cleanup,
|
||||
NULL, TRUE, TRUE
|
||||
NULL, FALSE, TRUE, TRUE
|
||||
},
|
||||
{
|
||||
"pdf", "pdf", ".pdf", NULL,
|
||||
|
|
@ -253,7 +253,7 @@ static const cairo_boilerplate_target_t targets[] = {
|
|||
_cairo_boilerplate_pdf_get_image_surface,
|
||||
_cairo_boilerplate_pdf_surface_write_to_png,
|
||||
_cairo_boilerplate_pdf_cleanup,
|
||||
NULL, TRUE, TRUE
|
||||
NULL, FALSE, TRUE, TRUE
|
||||
},
|
||||
#endif
|
||||
};
|
||||
|
|
|
|||
|
|
@ -306,7 +306,7 @@ static const cairo_boilerplate_target_t targets[] = {
|
|||
_cairo_boilerplate_ps_get_image_surface,
|
||||
_cairo_boilerplate_ps_surface_write_to_png,
|
||||
_cairo_boilerplate_ps_cleanup,
|
||||
NULL, TRUE, TRUE
|
||||
NULL, FALSE, TRUE, TRUE
|
||||
},
|
||||
{
|
||||
"ps2", "ps", ".ps", NULL,
|
||||
|
|
@ -318,7 +318,7 @@ static const cairo_boilerplate_target_t targets[] = {
|
|||
_cairo_boilerplate_ps_get_image_surface,
|
||||
_cairo_boilerplate_ps_surface_write_to_png,
|
||||
_cairo_boilerplate_ps_cleanup,
|
||||
NULL, TRUE, TRUE
|
||||
NULL, FALSE, TRUE, TRUE
|
||||
},
|
||||
{
|
||||
"ps3", "ps", ".ps", NULL,
|
||||
|
|
@ -331,7 +331,7 @@ static const cairo_boilerplate_target_t targets[] = {
|
|||
_cairo_boilerplate_ps_get_image_surface,
|
||||
_cairo_boilerplate_ps_surface_write_to_png,
|
||||
_cairo_boilerplate_ps_cleanup,
|
||||
NULL, TRUE, TRUE
|
||||
NULL, FALSE, TRUE, TRUE
|
||||
},
|
||||
{
|
||||
"ps3", "ps", ".ps", NULL,
|
||||
|
|
@ -343,7 +343,7 @@ static const cairo_boilerplate_target_t targets[] = {
|
|||
_cairo_boilerplate_ps_get_image_surface,
|
||||
_cairo_boilerplate_ps_surface_write_to_png,
|
||||
_cairo_boilerplate_ps_cleanup,
|
||||
NULL, TRUE, TRUE
|
||||
NULL, FALSE, TRUE, TRUE
|
||||
},
|
||||
#endif
|
||||
};
|
||||
|
|
|
|||
|
|
@ -57,6 +57,8 @@ static const cairo_boilerplate_target_t targets[] = {
|
|||
NULL, NULL,
|
||||
_cairo_boilerplate_get_image_surface,
|
||||
cairo_surface_write_to_png,
|
||||
NULL, NULL,
|
||||
TRUE, FALSE, FALSE
|
||||
},
|
||||
{
|
||||
"quartz", "quartz", NULL, NULL,
|
||||
|
|
@ -66,6 +68,7 @@ static const cairo_boilerplate_target_t targets[] = {
|
|||
NULL, NULL,
|
||||
_cairo_boilerplate_get_image_surface,
|
||||
cairo_surface_write_to_png,
|
||||
NULL, NULL, FALSE, FALSE, FALSE
|
||||
},
|
||||
};
|
||||
CAIRO_BOILERPLATE (quartz, targets)
|
||||
|
|
|
|||
|
|
@ -136,6 +136,6 @@ static const cairo_boilerplate_target_t target[] = {{
|
|||
_cairo_boilerplate_script_get_image_surface,
|
||||
_cairo_boilerplate_script_surface_write_to_png,
|
||||
_cairo_boilerplate_script_cleanup,
|
||||
NULL, FALSE
|
||||
NULL, FALSE, FALSE, FALSE
|
||||
}};
|
||||
CAIRO_BOILERPLATE (script, target)
|
||||
|
|
|
|||
|
|
@ -37,7 +37,8 @@ static const cairo_boilerplate_target_t targets[] = {
|
|||
_cairo_boilerplate_skia_create_surface,
|
||||
NULL, NULL,
|
||||
_cairo_boilerplate_get_image_surface,
|
||||
cairo_surface_write_to_png
|
||||
cairo_surface_write_to_png,
|
||||
NULL, NULL, TRUE, FALSE, FALSE
|
||||
},
|
||||
{
|
||||
"skia", "skia", NULL, NULL,
|
||||
|
|
@ -46,7 +47,8 @@ static const cairo_boilerplate_target_t targets[] = {
|
|||
_cairo_boilerplate_skia_create_surface,
|
||||
NULL, NULL,
|
||||
_cairo_boilerplate_get_image_surface,
|
||||
cairo_surface_write_to_png
|
||||
cairo_surface_write_to_png,
|
||||
NULL, NULL, FALSE, FALSE, FALSE
|
||||
},
|
||||
};
|
||||
CAIRO_BOILERPLATE (skia, targets)
|
||||
|
|
|
|||
|
|
@ -282,7 +282,7 @@ static const cairo_boilerplate_target_t targets[] = {
|
|||
_cairo_boilerplate_svg_get_image_surface,
|
||||
_cairo_boilerplate_svg_surface_write_to_png,
|
||||
_cairo_boilerplate_svg_cleanup,
|
||||
NULL, TRUE, TRUE
|
||||
NULL, FALSE, TRUE, TRUE
|
||||
},
|
||||
{
|
||||
"svg11", "svg", NULL, NULL,
|
||||
|
|
@ -294,7 +294,7 @@ static const cairo_boilerplate_target_t targets[] = {
|
|||
_cairo_boilerplate_svg_get_image_surface,
|
||||
_cairo_boilerplate_svg_surface_write_to_png,
|
||||
_cairo_boilerplate_svg_cleanup,
|
||||
NULL, TRUE, TRUE
|
||||
NULL, FALSE, TRUE, TRUE
|
||||
},
|
||||
{
|
||||
"svg12", "svg", NULL, NULL,
|
||||
|
|
@ -306,7 +306,7 @@ static const cairo_boilerplate_target_t targets[] = {
|
|||
_cairo_boilerplate_svg_get_image_surface,
|
||||
_cairo_boilerplate_svg_surface_write_to_png,
|
||||
_cairo_boilerplate_svg_cleanup,
|
||||
NULL, TRUE, TRUE
|
||||
NULL, FALSE, TRUE, TRUE
|
||||
},
|
||||
{
|
||||
"svg12", "svg", NULL, NULL,
|
||||
|
|
@ -318,7 +318,7 @@ static const cairo_boilerplate_target_t targets[] = {
|
|||
_cairo_boilerplate_svg_get_image_surface,
|
||||
_cairo_boilerplate_svg_surface_write_to_png,
|
||||
_cairo_boilerplate_svg_cleanup,
|
||||
NULL, TRUE, TRUE
|
||||
NULL, FALSE, TRUE, TRUE
|
||||
},
|
||||
#endif
|
||||
};
|
||||
|
|
|
|||
|
|
@ -237,7 +237,8 @@ static const cairo_boilerplate_target_t targets[] = {
|
|||
_cairo_boilerplate_test_fallback_create_surface,
|
||||
NULL, NULL,
|
||||
_cairo_boilerplate_get_image_surface,
|
||||
cairo_surface_write_to_png
|
||||
cairo_surface_write_to_png,
|
||||
NULL, NULL, FALSE, FALSE, FALSE
|
||||
},
|
||||
{
|
||||
"test-fallback", "image", NULL, NULL,
|
||||
|
|
@ -247,7 +248,8 @@ static const cairo_boilerplate_target_t targets[] = {
|
|||
_cairo_boilerplate_test_fallback_create_surface,
|
||||
NULL, NULL,
|
||||
_cairo_boilerplate_get_image_surface,
|
||||
cairo_surface_write_to_png
|
||||
cairo_surface_write_to_png,
|
||||
NULL, NULL, FALSE, FALSE, FALSE
|
||||
},
|
||||
{
|
||||
"test-fallback16", "image", NULL, NULL,
|
||||
|
|
@ -257,7 +259,8 @@ static const cairo_boilerplate_target_t targets[] = {
|
|||
_cairo_boilerplate_test_fallback16_create_surface,
|
||||
NULL, NULL,
|
||||
NULL, /* _cairo_boilerplate_get_image_surface, */
|
||||
cairo_surface_write_to_png
|
||||
cairo_surface_write_to_png,
|
||||
NULL, NULL, FALSE, FALSE, FALSE
|
||||
},
|
||||
{
|
||||
"test-fallback16", "image", NULL, NULL,
|
||||
|
|
@ -267,7 +270,8 @@ static const cairo_boilerplate_target_t targets[] = {
|
|||
_cairo_boilerplate_test_fallback16_create_surface,
|
||||
NULL, NULL,
|
||||
NULL, /* _cairo_boilerplate_get_image_surface, */
|
||||
cairo_surface_write_to_png
|
||||
cairo_surface_write_to_png,
|
||||
NULL, NULL, FALSE, FALSE, FALSE
|
||||
},
|
||||
#if CAIRO_HAS_TEST_PAGINATED_SURFACE
|
||||
{
|
||||
|
|
@ -280,8 +284,7 @@ static const cairo_boilerplate_target_t targets[] = {
|
|||
_cairo_boilerplate_test_paginated_get_image_surface,
|
||||
_cairo_boilerplate_test_paginated_surface_write_to_png,
|
||||
_cairo_boilerplate_test_paginated_cleanup,
|
||||
NULL,
|
||||
FALSE, TRUE,
|
||||
NULL, FALSE, TRUE, FALSE
|
||||
},
|
||||
{
|
||||
"test-paginated", "image", NULL, NULL,
|
||||
|
|
@ -293,8 +296,7 @@ static const cairo_boilerplate_target_t targets[] = {
|
|||
_cairo_boilerplate_test_paginated_get_image_surface,
|
||||
_cairo_boilerplate_test_paginated_surface_write_to_png,
|
||||
_cairo_boilerplate_test_paginated_cleanup,
|
||||
NULL,
|
||||
FALSE, TRUE
|
||||
NULL, FALSE, TRUE, FALSE
|
||||
},
|
||||
#endif
|
||||
#if CAIRO_HAS_TEST_WRAPPING_SURFACE
|
||||
|
|
@ -307,6 +309,7 @@ static const cairo_boilerplate_target_t targets[] = {
|
|||
NULL, NULL,
|
||||
_cairo_boilerplate_get_image_surface,
|
||||
cairo_surface_write_to_png,
|
||||
NULL, NULL, FALSE, FALSE, FALSE
|
||||
},
|
||||
#endif
|
||||
#if CAIRO_HAS_TEST_NULL_SURFACE
|
||||
|
|
@ -319,7 +322,7 @@ static const cairo_boilerplate_target_t targets[] = {
|
|||
NULL, NULL,
|
||||
NULL, NULL, NULL,
|
||||
NULL,
|
||||
TRUE, FALSE
|
||||
TRUE, TRUE, FALSE
|
||||
},
|
||||
#endif
|
||||
};
|
||||
|
|
|
|||
|
|
@ -311,7 +311,8 @@ static const cairo_boilerplate_target_t targets[] = {
|
|||
_cairo_boilerplate_get_image_surface,
|
||||
cairo_surface_write_to_png,
|
||||
_cairo_boilerplate_vg_cleanup_glx,
|
||||
_cairo_boilerplate_vg_synchronize
|
||||
_cairo_boilerplate_vg_synchronize,
|
||||
TRUE, FALSE, FALSE
|
||||
},
|
||||
{
|
||||
"vg-glx", "vg", NULL, NULL,
|
||||
|
|
@ -322,7 +323,8 @@ static const cairo_boilerplate_target_t targets[] = {
|
|||
_cairo_boilerplate_get_image_surface,
|
||||
cairo_surface_write_to_png,
|
||||
_cairo_boilerplate_vg_cleanup_glx,
|
||||
_cairo_boilerplate_vg_synchronize
|
||||
_cairo_boilerplate_vg_synchronize,
|
||||
FALSE, FALSE, FALSE
|
||||
},
|
||||
#endif
|
||||
#if CAIRO_HAS_EGL_FUNCTIONS
|
||||
|
|
@ -335,7 +337,8 @@ static const cairo_boilerplate_target_t targets[] = {
|
|||
_cairo_boilerplate_get_image_surface,
|
||||
cairo_surface_write_to_png,
|
||||
_cairo_boilerplate_vg_cleanup_egl,
|
||||
_cairo_boilerplate_vg_synchronize
|
||||
_cairo_boilerplate_vg_synchronize,
|
||||
TRUE, FALSE, FALSE
|
||||
},
|
||||
{
|
||||
"vg-egl", "vg", NULL, NULL,
|
||||
|
|
@ -346,7 +349,8 @@ static const cairo_boilerplate_target_t targets[] = {
|
|||
_cairo_boilerplate_get_image_surface,
|
||||
cairo_surface_write_to_png,
|
||||
_cairo_boilerplate_vg_cleanup_egl,
|
||||
_cairo_boilerplate_vg_synchronize
|
||||
_cairo_boilerplate_vg_synchronize,
|
||||
FALSE, FALSE, FALSE
|
||||
},
|
||||
#endif
|
||||
};
|
||||
|
|
|
|||
|
|
@ -353,7 +353,7 @@ static const cairo_boilerplate_target_t targets[] = {
|
|||
_cairo_boilerplate_win32_printing_get_image_surface,
|
||||
_cairo_boilerplate_win32_printing_surface_write_to_png,
|
||||
_cairo_boilerplate_win32_printing_cleanup,
|
||||
NULL, TRUE, TRUE
|
||||
NULL, FALSE, TRUE, TRUE
|
||||
},
|
||||
{
|
||||
"win32-printing", "win32", ".ps", NULL,
|
||||
|
|
@ -364,7 +364,7 @@ static const cairo_boilerplate_target_t targets[] = {
|
|||
_cairo_boilerplate_win32_printing_get_image_surface,
|
||||
_cairo_boilerplate_win32_printing_surface_write_to_png,
|
||||
_cairo_boilerplate_win32_printing_cleanup,
|
||||
NULL, TRUE, TRUE
|
||||
NULL, FALSE, TRUE, TRUE
|
||||
},
|
||||
#endif
|
||||
};
|
||||
|
|
|
|||
|
|
@ -56,7 +56,8 @@ static const cairo_boilerplate_target_t targets[] = {
|
|||
_cairo_boilerplate_win32_create_surface,
|
||||
NULL, NULL,
|
||||
_cairo_boilerplate_get_image_surface,
|
||||
cairo_surface_write_to_png
|
||||
cairo_surface_write_to_png,
|
||||
NULL, NULL, TRUE, FALSE, FALSE
|
||||
},
|
||||
/* Testing the win32 surface isn't interesting, since for
|
||||
* ARGB images it just chains to the image backend
|
||||
|
|
@ -68,7 +69,8 @@ static const cairo_boilerplate_target_t targets[] = {
|
|||
_cairo_boilerplate_win32_create_surface,
|
||||
NULL, NULL,
|
||||
_cairo_boilerplate_get_image_surface,
|
||||
cairo_surface_write_to_png
|
||||
cairo_surface_write_to_png,
|
||||
NULL, NULL, FALSE, FALSE, FALSE
|
||||
},
|
||||
};
|
||||
CAIRO_BOILERPLATE (win32, targets)
|
||||
|
|
|
|||
|
|
@ -601,7 +601,8 @@ static const cairo_boilerplate_target_t targets[] = {
|
|||
_cairo_boilerplate_get_image_surface,
|
||||
cairo_surface_write_to_png,
|
||||
_cairo_boilerplate_xcb_cleanup,
|
||||
_cairo_boilerplate_xcb_synchronize
|
||||
_cairo_boilerplate_xcb_synchronize,
|
||||
TRUE, FALSE, FALSE
|
||||
},
|
||||
{
|
||||
"xcb", "xlib", NULL, NULL,
|
||||
|
|
@ -613,7 +614,8 @@ static const cairo_boilerplate_target_t targets[] = {
|
|||
_cairo_boilerplate_get_image_surface,
|
||||
cairo_surface_write_to_png,
|
||||
_cairo_boilerplate_xcb_cleanup,
|
||||
_cairo_boilerplate_xcb_synchronize
|
||||
_cairo_boilerplate_xcb_synchronize,
|
||||
FALSE, FALSE, FALSE
|
||||
},
|
||||
{
|
||||
"xcb-window", "xlib", NULL, NULL,
|
||||
|
|
@ -625,7 +627,8 @@ static const cairo_boilerplate_target_t targets[] = {
|
|||
_cairo_boilerplate_get_image_surface,
|
||||
cairo_surface_write_to_png,
|
||||
_cairo_boilerplate_xcb_cleanup,
|
||||
_cairo_boilerplate_xcb_synchronize
|
||||
_cairo_boilerplate_xcb_synchronize,
|
||||
FALSE, FALSE, FALSE
|
||||
},
|
||||
{
|
||||
"xcb-window&", "xlib", NULL, NULL,
|
||||
|
|
@ -637,7 +640,8 @@ static const cairo_boilerplate_target_t targets[] = {
|
|||
_cairo_boilerplate_get_image_surface,
|
||||
cairo_surface_write_to_png,
|
||||
_cairo_boilerplate_xcb_cleanup,
|
||||
_cairo_boilerplate_xcb_synchronize
|
||||
_cairo_boilerplate_xcb_synchronize,
|
||||
FALSE, FALSE, FALSE
|
||||
},
|
||||
{
|
||||
"xcb-render-0.0", "xlib-fallback", NULL, NULL,
|
||||
|
|
@ -649,7 +653,8 @@ static const cairo_boilerplate_target_t targets[] = {
|
|||
_cairo_boilerplate_get_image_surface,
|
||||
cairo_surface_write_to_png,
|
||||
_cairo_boilerplate_xcb_cleanup,
|
||||
_cairo_boilerplate_xcb_synchronize
|
||||
_cairo_boilerplate_xcb_synchronize,
|
||||
TRUE, FALSE, FALSE
|
||||
},
|
||||
{
|
||||
"xcb-render-0.0", "xlib-fallback", NULL, NULL,
|
||||
|
|
@ -661,7 +666,8 @@ static const cairo_boilerplate_target_t targets[] = {
|
|||
_cairo_boilerplate_get_image_surface,
|
||||
cairo_surface_write_to_png,
|
||||
_cairo_boilerplate_xcb_cleanup,
|
||||
_cairo_boilerplate_xcb_synchronize
|
||||
_cairo_boilerplate_xcb_synchronize,
|
||||
FALSE, FALSE, FALSE
|
||||
},
|
||||
{
|
||||
"xcb-fallback", "xlib-fallback", NULL, NULL,
|
||||
|
|
@ -673,7 +679,8 @@ static const cairo_boilerplate_target_t targets[] = {
|
|||
_cairo_boilerplate_get_image_surface,
|
||||
cairo_surface_write_to_png,
|
||||
_cairo_boilerplate_xcb_cleanup,
|
||||
_cairo_boilerplate_xcb_synchronize
|
||||
_cairo_boilerplate_xcb_synchronize,
|
||||
FALSE, FALSE, FALSE
|
||||
},
|
||||
};
|
||||
CAIRO_BOILERPLATE (xcb, targets)
|
||||
|
|
|
|||
|
|
@ -445,7 +445,8 @@ static const cairo_boilerplate_target_t targets[] = {
|
|||
_cairo_boilerplate_get_image_surface,
|
||||
cairo_surface_write_to_png,
|
||||
_cairo_boilerplate_xlib_cleanup,
|
||||
_cairo_boilerplate_xlib_synchronize
|
||||
_cairo_boilerplate_xlib_synchronize,
|
||||
TRUE, FALSE, FALSE
|
||||
},
|
||||
{
|
||||
"xlib", "xlib", NULL, "xlib-reference",
|
||||
|
|
@ -456,7 +457,8 @@ static const cairo_boilerplate_target_t targets[] = {
|
|||
_cairo_boilerplate_get_image_surface,
|
||||
cairo_surface_write_to_png,
|
||||
_cairo_boilerplate_xlib_cleanup,
|
||||
_cairo_boilerplate_xlib_synchronize
|
||||
_cairo_boilerplate_xlib_synchronize,
|
||||
FALSE, FALSE, FALSE
|
||||
},
|
||||
{
|
||||
"xlib-reference", "xlib", NULL, NULL,
|
||||
|
|
@ -467,7 +469,8 @@ static const cairo_boilerplate_target_t targets[] = {
|
|||
NULL, /* get_image */
|
||||
cairo_surface_write_to_png,
|
||||
_cairo_boilerplate_xlib_cleanup,
|
||||
_cairo_boilerplate_xlib_synchronize
|
||||
_cairo_boilerplate_xlib_synchronize,
|
||||
FALSE, FALSE, FALSE
|
||||
},
|
||||
#endif
|
||||
#if CAIRO_HAS_XLIB_SURFACE
|
||||
|
|
@ -482,7 +485,8 @@ static const cairo_boilerplate_target_t targets[] = {
|
|||
_cairo_boilerplate_get_image_surface,
|
||||
cairo_surface_write_to_png,
|
||||
_cairo_boilerplate_xlib_cleanup,
|
||||
_cairo_boilerplate_xlib_synchronize
|
||||
_cairo_boilerplate_xlib_synchronize,
|
||||
FALSE, FALSE, FALSE
|
||||
},
|
||||
#endif
|
||||
};
|
||||
|
|
|
|||
|
|
@ -149,6 +149,23 @@ _cairo_boilerplate_image_create_surface (const char *name,
|
|||
return cairo_image_surface_create (format, ceil (width), ceil (height));
|
||||
}
|
||||
|
||||
static cairo_surface_t *
|
||||
_cairo_boilerplate_image16_create_surface (const char *name,
|
||||
cairo_content_t content,
|
||||
double width,
|
||||
double height,
|
||||
double max_width,
|
||||
double max_height,
|
||||
cairo_boilerplate_mode_t mode,
|
||||
int id,
|
||||
void **closure)
|
||||
{
|
||||
*closure = NULL;
|
||||
|
||||
/* XXX force CAIRO_CONTENT_COLOR */
|
||||
return cairo_image_surface_create (CAIRO_FORMAT_RGB16_565, ceil (width), ceil (height));
|
||||
}
|
||||
|
||||
#if CAIRO_HAS_RECORDING_SURFACE
|
||||
static cairo_surface_t *
|
||||
_cairo_boilerplate_recording_create_surface (const char *name,
|
||||
|
|
@ -301,7 +318,9 @@ static const cairo_boilerplate_target_t builtin_targets[] = {
|
|||
NULL, _cairo_boilerplate_image_create_surface,
|
||||
NULL, NULL,
|
||||
_cairo_boilerplate_get_image_surface,
|
||||
cairo_surface_write_to_png
|
||||
cairo_surface_write_to_png,
|
||||
NULL, NULL,
|
||||
TRUE, FALSE, FALSE
|
||||
},
|
||||
{
|
||||
"image", "image", NULL, NULL,
|
||||
|
|
@ -309,7 +328,19 @@ static const cairo_boilerplate_target_t builtin_targets[] = {
|
|||
NULL, _cairo_boilerplate_image_create_surface,
|
||||
NULL, NULL,
|
||||
_cairo_boilerplate_get_image_surface,
|
||||
cairo_surface_write_to_png
|
||||
cairo_surface_write_to_png,
|
||||
NULL, NULL,
|
||||
FALSE, FALSE, FALSE
|
||||
},
|
||||
{
|
||||
"image16", "image", NULL, NULL,
|
||||
CAIRO_SURFACE_TYPE_IMAGE, CAIRO_CONTENT_COLOR, 0,
|
||||
NULL, _cairo_boilerplate_image16_create_surface,
|
||||
NULL, NULL,
|
||||
_cairo_boilerplate_get_image_surface,
|
||||
cairo_surface_write_to_png,
|
||||
NULL, NULL,
|
||||
TRUE, FALSE, FALSE
|
||||
},
|
||||
#if CAIRO_HAS_RECORDING_SURFACE
|
||||
{
|
||||
|
|
@ -321,7 +352,7 @@ static const cairo_boilerplate_target_t builtin_targets[] = {
|
|||
_cairo_boilerplate_get_image_surface,
|
||||
cairo_surface_write_to_png,
|
||||
NULL, NULL,
|
||||
FALSE, TRUE
|
||||
FALSE, FALSE, TRUE
|
||||
},
|
||||
{
|
||||
"recording", "image", NULL, NULL,
|
||||
|
|
@ -332,7 +363,7 @@ static const cairo_boilerplate_target_t builtin_targets[] = {
|
|||
_cairo_boilerplate_get_image_surface,
|
||||
cairo_surface_write_to_png,
|
||||
NULL, NULL,
|
||||
FALSE, TRUE
|
||||
FALSE, FALSE, TRUE
|
||||
},
|
||||
#endif
|
||||
};
|
||||
|
|
|
|||
|
|
@ -165,6 +165,7 @@ typedef struct _cairo_boilerplate_target {
|
|||
cairo_boilerplate_write_to_png_t write_to_png;
|
||||
cairo_boilerplate_cleanup_t cleanup;
|
||||
cairo_boilerplate_wait_t synchronize;
|
||||
cairo_bool_t is_measurable;
|
||||
cairo_bool_t is_vector;
|
||||
cairo_bool_t is_recording;
|
||||
} cairo_boilerplate_target_t;
|
||||
|
|
|
|||
|
|
@ -62,63 +62,6 @@ typedef struct _cairo_perf_case {
|
|||
|
||||
const cairo_perf_case_t perf_cases[];
|
||||
|
||||
/* Some targets just aren't that interesting for performance testing,
|
||||
* (not least because many of these surface types use a recording-surface
|
||||
* and as such defer the "real" rendering to later, so our timing
|
||||
* loops wouldn't count the real work, just the recording by the
|
||||
* recording-surface. */
|
||||
static cairo_bool_t
|
||||
target_is_measurable (const cairo_boilerplate_target_t *target)
|
||||
{
|
||||
switch ((int) target->expected_type) {
|
||||
case CAIRO_SURFACE_TYPE_IMAGE:
|
||||
if (strcmp (target->name, "pdf") == 0 ||
|
||||
strcmp (target->name, "ps") == 0)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
case CAIRO_SURFACE_TYPE_XLIB:
|
||||
if (strcmp (target->name, "xlib-fallback") == 0 ||
|
||||
strcmp (target->name, "xlib-reference") == 0)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
case CAIRO_SURFACE_TYPE_XCB:
|
||||
case CAIRO_SURFACE_TYPE_GLITZ:
|
||||
case CAIRO_SURFACE_TYPE_QUARTZ:
|
||||
case CAIRO_SURFACE_TYPE_WIN32:
|
||||
case CAIRO_SURFACE_TYPE_BEOS:
|
||||
case CAIRO_SURFACE_TYPE_DIRECTFB:
|
||||
#if CAIRO_VERSION > CAIRO_VERSION_ENCODE(1,1,2)
|
||||
case CAIRO_SURFACE_TYPE_OS2:
|
||||
#endif
|
||||
#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1,9,4)
|
||||
case CAIRO_SURFACE_TYPE_QT:
|
||||
#endif
|
||||
#if CAIRO_HAS_GL_SURFACE
|
||||
case CAIRO_SURFACE_TYPE_GL:
|
||||
#endif
|
||||
#if CAIRO_HAS_DRM_SURFACE
|
||||
case CAIRO_SURFACE_TYPE_DRM:
|
||||
#endif
|
||||
#if CAIRO_HAS_SKIA_SURFACE
|
||||
case CAIRO_SURFACE_TYPE_SKIA:
|
||||
#endif
|
||||
return TRUE;
|
||||
|
||||
default:
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
static const char *
|
||||
_content_to_string (cairo_content_t content, cairo_bool_t similar)
|
||||
{
|
||||
|
|
@ -514,7 +457,7 @@ main (int argc, char *argv[])
|
|||
for (i = 0; i < perf.num_targets; i++) {
|
||||
const cairo_boilerplate_target_t *target = perf.targets[i];
|
||||
|
||||
if (! target_is_measurable (target))
|
||||
if (! target->is_measurable)
|
||||
continue;
|
||||
|
||||
perf.target = target;
|
||||
|
|
|
|||
|
|
@ -68,71 +68,6 @@
|
|||
#define CAIRO_PERF_MIN_STD_DEV_COUNT 3
|
||||
#define CAIRO_PERF_STABLE_STD_DEV_COUNT 3
|
||||
|
||||
/* Some targets just aren't that interesting for performance testing,
|
||||
* (not least because many of these surface types use a recording-surface
|
||||
* and as such defer the "real" rendering to later, so our timing
|
||||
* loops wouldn't count the real work, just the recording by the
|
||||
* recording-surface. */
|
||||
static cairo_bool_t
|
||||
target_is_measurable (const cairo_boilerplate_target_t *target)
|
||||
{
|
||||
if (target->content != CAIRO_CONTENT_COLOR_ALPHA)
|
||||
return FALSE;
|
||||
|
||||
switch ((int) target->expected_type) {
|
||||
case CAIRO_SURFACE_TYPE_IMAGE:
|
||||
if (strcmp (target->name, "pdf") == 0 ||
|
||||
strcmp (target->name, "ps") == 0)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
case CAIRO_SURFACE_TYPE_XLIB:
|
||||
if (strcmp (target->name, "xlib-fallback") == 0 ||
|
||||
strcmp (target->name, "xlib-reference") == 0)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
case CAIRO_SURFACE_TYPE_XCB:
|
||||
case CAIRO_SURFACE_TYPE_GLITZ:
|
||||
case CAIRO_SURFACE_TYPE_QUARTZ:
|
||||
case CAIRO_SURFACE_TYPE_WIN32:
|
||||
case CAIRO_SURFACE_TYPE_BEOS:
|
||||
case CAIRO_SURFACE_TYPE_DIRECTFB:
|
||||
#if CAIRO_VERSION > CAIRO_VERSION_ENCODE(1,1,2)
|
||||
case CAIRO_SURFACE_TYPE_OS2:
|
||||
#endif
|
||||
#if CAIRO_HAS_QT_SURFACE
|
||||
case CAIRO_SURFACE_TYPE_QT:
|
||||
#endif
|
||||
#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1,9,3)
|
||||
case CAIRO_INTERNAL_SURFACE_TYPE_NULL:
|
||||
#endif
|
||||
#if CAIRO_HAS_GL_SURFACE
|
||||
case CAIRO_SURFACE_TYPE_GL:
|
||||
#endif
|
||||
#if CAIRO_HAS_DRM_SURFACE
|
||||
case CAIRO_SURFACE_TYPE_DRM:
|
||||
#endif
|
||||
#if CAIRO_HAS_SKIA_SURFACE
|
||||
case CAIRO_SURFACE_TYPE_SKIA:
|
||||
#endif
|
||||
return TRUE;
|
||||
case CAIRO_SURFACE_TYPE_PDF:
|
||||
case CAIRO_SURFACE_TYPE_PS:
|
||||
case CAIRO_SURFACE_TYPE_SVG:
|
||||
default:
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
cairo_bool_t
|
||||
cairo_perf_can_run (cairo_perf_t *perf,
|
||||
const char *name,
|
||||
|
|
@ -848,7 +783,7 @@ main (int argc, char *argv[])
|
|||
for (i = 0; i < perf.num_targets; i++) {
|
||||
const cairo_boilerplate_target_t *target = perf.targets[i];
|
||||
|
||||
if (! perf.list_only && ! target_is_measurable (target))
|
||||
if (! perf.list_only && ! target->is_measurable)
|
||||
continue;
|
||||
|
||||
perf.target = target;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue