diff options
Diffstat (limited to 'boilerplate')
21 files changed, 78 insertions, 3 deletions
diff --git a/boilerplate/Makefile.am b/boilerplate/Makefile.am index cb92c2bc..10fb6af3 100644 --- a/boilerplate/Makefile.am +++ b/boilerplate/Makefile.am @@ -23,6 +23,9 @@ libcairoboilerplate_la_SOURCES = \ cairo-boilerplate-constructors.c \ $(NULL) libcairoboilerplate_la_LIBADD = $(top_builddir)/src/libcairo.la +if CAIRO_HAS_DL +libcairoboilerplate_la_LIBADD += -ldl +endif if CAIRO_HAS_BEOS_SURFACE # BeOS system headers trigger this warning diff --git a/boilerplate/cairo-boilerplate-directfb.c b/boilerplate/cairo-boilerplate-directfb.c index f7be0307..6815dd1b 100644 --- a/boilerplate/cairo-boilerplate-directfb.c +++ b/boilerplate/cairo-boilerplate-directfb.c @@ -211,6 +211,7 @@ static const cairo_boilerplate_target_t targets[] = { { "directfb", "directfb", NULL, NULL, CAIRO_SURFACE_TYPE_DIRECTFB, CAIRO_CONTENT_COLOR, 0, + "cairo_directfb_surface_create", _cairo_boilerplate_directfb_create_surface, NULL, NULL, _cairo_boilerplate_get_image_surface, @@ -220,6 +221,7 @@ static const cairo_boilerplate_target_t targets[] = { { "directfb-bitmap", "directfb", NULL, NULL, CAIRO_SURFACE_TYPE_DIRECTFB, CAIRO_CONTENT_COLOR_ALPHA, 0, + "cairo_directfb_surface_create", _cairo_boilerplate_directfb_create_surface, NULL, NULL, _cairo_boilerplate_get_image_surface, diff --git a/boilerplate/cairo-boilerplate-drm.c b/boilerplate/cairo-boilerplate-drm.c index 23e601e8..34d67b54 100644 --- a/boilerplate/cairo-boilerplate-drm.c +++ b/boilerplate/cairo-boilerplate-drm.c @@ -70,6 +70,7 @@ static const cairo_boilerplate_target_t targets[] = { { "drm", "drm", NULL, NULL, CAIRO_SURFACE_TYPE_DRM, CAIRO_CONTENT_COLOR_ALPHA, 1, + "cairo_drm_surface_create", _cairo_boilerplate_drm_create_surface, NULL, NULL, _cairo_boilerplate_get_image_surface, @@ -80,6 +81,7 @@ static const cairo_boilerplate_target_t targets[] = { { "drm", "drm", NULL, NULL, CAIRO_SURFACE_TYPE_DRM, CAIRO_CONTENT_COLOR, 1, + "cairo_drm_surface_create", _cairo_boilerplate_drm_create_surface, NULL, NULL, _cairo_boilerplate_get_image_surface, diff --git a/boilerplate/cairo-boilerplate-gl.c b/boilerplate/cairo-boilerplate-gl.c index 940fd756..0facc5cb 100644 --- a/boilerplate/cairo-boilerplate-gl.c +++ b/boilerplate/cairo-boilerplate-gl.c @@ -141,6 +141,7 @@ static const cairo_boilerplate_target_t targets[] = { { "gl", "gl", NULL, NULL, CAIRO_SURFACE_TYPE_GL, CAIRO_CONTENT_COLOR_ALPHA, 1, + "cairo_gl_surface_create", _cairo_boilerplate_gl_create_surface, NULL, NULL, _cairo_boilerplate_get_image_surface, @@ -151,6 +152,7 @@ static const cairo_boilerplate_target_t targets[] = { { "gl", "gl", NULL, NULL, CAIRO_SURFACE_TYPE_GL, CAIRO_CONTENT_COLOR, 1, + "cairo_gl_surface_create", _cairo_boilerplate_gl_create_surface, NULL, NULL, _cairo_boilerplate_get_image_surface, diff --git a/boilerplate/cairo-boilerplate-glitz-agl.c b/boilerplate/cairo-boilerplate-glitz-agl.c index 61c43520..679593bc 100644 --- a/boilerplate/cairo-boilerplate-glitz-agl.c +++ b/boilerplate/cairo-boilerplate-glitz-agl.c @@ -169,6 +169,7 @@ static const cairo_boilerplate_target_t targets[] = { { "glitz-agl", "glitz", NULL, NULL, CAIRO_SURFACE_TYPE_GLITZ, CAIRO_CONTENT_COLOR_ALPHA, 0, + "cairo_glitz_surface_create", _cairo_boilerplate_glitz_agl_create_surface, NULL, NULL, _cairo_boilerplate_get_image_surface, @@ -178,6 +179,7 @@ static const cairo_boilerplate_target_t targets[] = { { "glitz-agl", "glitz", NULL, NULL, CAIRO_SURFACE_TYPE_GLITZ, CAIRO_CONTENT_COLOR, 0, + "cairo_glitz_surface_create", _cairo_boilerplate_glitz_agl_create_surface, NULL, NULL, _cairo_boilerplate_get_image_surface, diff --git a/boilerplate/cairo-boilerplate-glitz-glx.c b/boilerplate/cairo-boilerplate-glitz-glx.c index 6e3cfec3..d490aecb 100644 --- a/boilerplate/cairo-boilerplate-glitz-glx.c +++ b/boilerplate/cairo-boilerplate-glitz-glx.c @@ -243,6 +243,7 @@ static const cairo_boilerplate_target_t targets[] = { { "glitz-glx", "glitz", NULL, NULL, CAIRO_SURFACE_TYPE_GLITZ,CAIRO_CONTENT_COLOR_ALPHA, 0, + "cairo_glitz_surface_create", _cairo_boilerplate_glitz_glx_create_surface, NULL, NULL, _cairo_boilerplate_get_image_surface, @@ -252,6 +253,7 @@ static const cairo_boilerplate_target_t targets[] = { { "glitz-glx", "glitz", NULL, NULL, CAIRO_SURFACE_TYPE_GLITZ, CAIRO_CONTENT_COLOR, 0, + "cairo_glitz_surface_create", _cairo_boilerplate_glitz_glx_create_surface, NULL, NULL, _cairo_boilerplate_get_image_surface, diff --git a/boilerplate/cairo-boilerplate-glitz-wgl.c b/boilerplate/cairo-boilerplate-glitz-wgl.c index 3aeefdda..f50d68b7 100644 --- a/boilerplate/cairo-boilerplate-glitz-wgl.c +++ b/boilerplate/cairo-boilerplate-glitz-wgl.c @@ -166,6 +166,7 @@ static const cairo_boilerplate_target_t targets[] = { { "glitz-wgl", "glitz", NULL, NULL, CAIRO_SURFACE_TYPE_GLITZ, CAIRO_CONTENT_COLOR_ALPHA, 0, + "cairo_glitz_surface_create", _cairo_boilerplate_glitz_wgl_create_surface, NULL, NULL, _cairo_boilerplate_get_image_surface, @@ -175,6 +176,7 @@ static const cairo_boilerplate_target_t targets[] = { { "glitz-wgl", "glitz", NULL, NULL, CAIRO_SURFACE_TYPE_GLITZ, CAIRO_CONTENT_COLOR, 0, + "cairo_glitz_surface_create", _cairo_boilerplate_glitz_wgl_create_surface, NULL, NULL, _cairo_boilerplate_get_image_surface, diff --git a/boilerplate/cairo-boilerplate-pdf.c b/boilerplate/cairo-boilerplate-pdf.c index 838038af..591e16fd 100644 --- a/boilerplate/cairo-boilerplate-pdf.c +++ b/boilerplate/cairo-boilerplate-pdf.c @@ -229,6 +229,7 @@ static const cairo_boilerplate_target_t targets[] = { "pdf", "pdf", ".pdf", NULL, CAIRO_SURFACE_TYPE_PDF, CAIRO_TEST_CONTENT_COLOR_ALPHA_FLATTENED, 0, + "cairo_pdf_surface_create", _cairo_boilerplate_pdf_create_surface, _cairo_boilerplate_pdf_force_fallbacks, _cairo_boilerplate_pdf_finish_surface, @@ -240,6 +241,7 @@ static const cairo_boilerplate_target_t targets[] = { { "pdf", "pdf", ".pdf", NULL, CAIRO_SURFACE_TYPE_META, CAIRO_CONTENT_COLOR, 0, + "cairo_pdf_surface_create", _cairo_boilerplate_pdf_create_surface, _cairo_boilerplate_pdf_force_fallbacks, _cairo_boilerplate_pdf_finish_surface, diff --git a/boilerplate/cairo-boilerplate-ps.c b/boilerplate/cairo-boilerplate-ps.c index 8619e47f..53fecd6d 100644 --- a/boilerplate/cairo-boilerplate-ps.c +++ b/boilerplate/cairo-boilerplate-ps.c @@ -294,6 +294,7 @@ static const cairo_boilerplate_target_t targets[] = { "ps2", "ps", ".ps", NULL, CAIRO_SURFACE_TYPE_PS, CAIRO_TEST_CONTENT_COLOR_ALPHA_FLATTENED, 0, + "cairo_ps_surface_create", _cairo_boilerplate_ps2_create_surface, _cairo_boilerplate_ps_force_fallbacks, _cairo_boilerplate_ps_finish_surface, @@ -305,6 +306,7 @@ static const cairo_boilerplate_target_t targets[] = { { "ps2", "ps", ".ps", NULL, CAIRO_SURFACE_TYPE_META, CAIRO_CONTENT_COLOR, 0, + "cairo_ps_surface_create", _cairo_boilerplate_ps2_create_surface, _cairo_boilerplate_ps_force_fallbacks, _cairo_boilerplate_ps_finish_surface, @@ -317,6 +319,7 @@ static const cairo_boilerplate_target_t targets[] = { "ps3", "ps", ".ps", NULL, CAIRO_SURFACE_TYPE_PS, CAIRO_TEST_CONTENT_COLOR_ALPHA_FLATTENED, 0, + "cairo_ps_surface_create", _cairo_boilerplate_ps3_create_surface, _cairo_boilerplate_ps_force_fallbacks, _cairo_boilerplate_ps_finish_surface, @@ -328,6 +331,7 @@ static const cairo_boilerplate_target_t targets[] = { { "ps3", "ps", ".ps", NULL, CAIRO_SURFACE_TYPE_META, CAIRO_CONTENT_COLOR, 0, + "cairo_ps_surface_create", _cairo_boilerplate_ps3_create_surface, _cairo_boilerplate_ps_force_fallbacks, _cairo_boilerplate_ps_finish_surface, diff --git a/boilerplate/cairo-boilerplate-quartz.c b/boilerplate/cairo-boilerplate-quartz.c index 4c623581..1948d837 100644 --- a/boilerplate/cairo-boilerplate-quartz.c +++ b/boilerplate/cairo-boilerplate-quartz.c @@ -52,6 +52,7 @@ static const cairo_boilerplate_target_t targets[] = { { "quartz", "quartz", NULL, NULL, CAIRO_SURFACE_TYPE_QUARTZ, CAIRO_CONTENT_COLOR_ALPHA, 0, + "cairo_quartz_surface_create", _cairo_boilerplate_quartz_create_surface, NULL, NULL, _cairo_boilerplate_get_image_surface, @@ -60,6 +61,7 @@ static const cairo_boilerplate_target_t targets[] = { { "quartz", "quartz", NULL, NULL, CAIRO_SURFACE_TYPE_QUARTZ, CAIRO_CONTENT_COLOR, 0, + "cairo_quartz_surface_create", _cairo_boilerplate_quartz_create_surface, NULL, NULL, _cairo_boilerplate_get_image_surface, diff --git a/boilerplate/cairo-boilerplate-script.c b/boilerplate/cairo-boilerplate-script.c index d1d76b5c..e37fdf13 100644 --- a/boilerplate/cairo-boilerplate-script.c +++ b/boilerplate/cairo-boilerplate-script.c @@ -129,6 +129,7 @@ _cairo_boilerplate_script_cleanup (void *closure) static const cairo_boilerplate_target_t target[] = {{ "script", "script", ".cs", NULL, CAIRO_SURFACE_TYPE_SCRIPT, CAIRO_CONTENT_COLOR_ALPHA, 0, + "cairo_script_surface_create", _cairo_boilerplate_script_create_surface, NULL, _cairo_boilerplate_script_finish_surface, diff --git a/boilerplate/cairo-boilerplate-skia.c b/boilerplate/cairo-boilerplate-skia.c index e6364205..13ab00b7 100644 --- a/boilerplate/cairo-boilerplate-skia.c +++ b/boilerplate/cairo-boilerplate-skia.c @@ -33,6 +33,7 @@ static const cairo_boilerplate_target_t targets[] = { { "skia", "skia", NULL, NULL, CAIRO_SURFACE_TYPE_SKIA, CAIRO_CONTENT_COLOR_ALPHA, 0, + "cairo_skia_surface_create", _cairo_boilerplate_skia_create_surface, NULL, NULL, _cairo_boilerplate_get_image_surface, @@ -41,6 +42,7 @@ static const cairo_boilerplate_target_t targets[] = { { "skia", "skia", NULL, NULL, CAIRO_SURFACE_TYPE_SKIA, CAIRO_CONTENT_COLOR, 0, + "cairo_skia_surface_create", _cairo_boilerplate_skia_create_surface, NULL, NULL, _cairo_boilerplate_get_image_surface, diff --git a/boilerplate/cairo-boilerplate-svg.c b/boilerplate/cairo-boilerplate-svg.c index 56296f46..a8a4d8b9 100644 --- a/boilerplate/cairo-boilerplate-svg.c +++ b/boilerplate/cairo-boilerplate-svg.c @@ -274,6 +274,7 @@ static const cairo_boilerplate_target_t targets[] = { { "svg11", "svg", NULL, NULL, CAIRO_SURFACE_TYPE_SVG, CAIRO_CONTENT_COLOR_ALPHA, 1, + "cairo_svg_surface_create", _cairo_boilerplate_svg11_create_surface, _cairo_boilerplate_svg_force_fallbacks, _cairo_boilerplate_svg_finish_surface, @@ -285,6 +286,7 @@ static const cairo_boilerplate_target_t targets[] = { { "svg11", "svg", NULL, NULL, CAIRO_SURFACE_TYPE_META, CAIRO_CONTENT_COLOR, 1, + "cairo_svg_surface_create", _cairo_boilerplate_svg11_create_surface, _cairo_boilerplate_svg_force_fallbacks, _cairo_boilerplate_svg_finish_surface, @@ -296,6 +298,7 @@ static const cairo_boilerplate_target_t targets[] = { { "svg12", "svg", NULL, NULL, CAIRO_SURFACE_TYPE_SVG, CAIRO_CONTENT_COLOR_ALPHA, 1, + "cairo_svg_surface_create", _cairo_boilerplate_svg12_create_surface, _cairo_boilerplate_svg_force_fallbacks, _cairo_boilerplate_svg_finish_surface, @@ -307,6 +310,7 @@ static const cairo_boilerplate_target_t targets[] = { { "svg12", "svg", NULL, NULL, CAIRO_SURFACE_TYPE_META, CAIRO_CONTENT_COLOR, 1, + "cairo_svg_surface_create", _cairo_boilerplate_svg12_create_surface, _cairo_boilerplate_svg_force_fallbacks, _cairo_boilerplate_svg_finish_surface, diff --git a/boilerplate/cairo-boilerplate-test-surfaces.c b/boilerplate/cairo-boilerplate-test-surfaces.c index 3e7490ec..7a3a16b9 100644 --- a/boilerplate/cairo-boilerplate-test-surfaces.c +++ b/boilerplate/cairo-boilerplate-test-surfaces.c @@ -233,6 +233,7 @@ static const cairo_boilerplate_target_t targets[] = { "test-fallback", "image", NULL, NULL, CAIRO_INTERNAL_SURFACE_TYPE_TEST_FALLBACK, CAIRO_CONTENT_COLOR_ALPHA, 0, + "_cairo_test_fallback_surface_create", _cairo_boilerplate_test_fallback_create_surface, NULL, NULL, _cairo_boilerplate_get_image_surface, @@ -242,6 +243,7 @@ static const cairo_boilerplate_target_t targets[] = { "test-fallback", "image", NULL, NULL, CAIRO_INTERNAL_SURFACE_TYPE_TEST_FALLBACK, CAIRO_CONTENT_COLOR, 0, + "_cairo_test_fallback_surface_create", _cairo_boilerplate_test_fallback_create_surface, NULL, NULL, _cairo_boilerplate_get_image_surface, @@ -251,6 +253,7 @@ static const cairo_boilerplate_target_t targets[] = { "test-fallback16", "image", NULL, NULL, CAIRO_INTERNAL_SURFACE_TYPE_TEST_FALLBACK, CAIRO_CONTENT_COLOR_ALPHA, 0, + "_cairo_test_fallback16_surface_create", _cairo_boilerplate_test_fallback16_create_surface, NULL, NULL, NULL, /* _cairo_boilerplate_get_image_surface, */ @@ -260,6 +263,7 @@ static const cairo_boilerplate_target_t targets[] = { "test-fallback16", "image", NULL, NULL, CAIRO_INTERNAL_SURFACE_TYPE_TEST_FALLBACK, CAIRO_CONTENT_COLOR, 0, + "_cairo_test_fallback16_surface_create", _cairo_boilerplate_test_fallback16_create_surface, NULL, NULL, NULL, /* _cairo_boilerplate_get_image_surface, */ @@ -270,6 +274,7 @@ static const cairo_boilerplate_target_t targets[] = { "test-paginated", "image", NULL, NULL, CAIRO_INTERNAL_SURFACE_TYPE_TEST_PAGINATED, CAIRO_CONTENT_COLOR_ALPHA, 0, + "_cairo_test_paginated_surface_create", _cairo_boilerplate_test_paginated_create_surface, NULL, NULL, _cairo_boilerplate_test_paginated_get_image_surface, @@ -282,6 +287,7 @@ static const cairo_boilerplate_target_t targets[] = { "test-paginated", "image", NULL, NULL, CAIRO_INTERNAL_SURFACE_TYPE_TEST_PAGINATED, CAIRO_CONTENT_COLOR, 0, + "_cairo_test_paginated_surface_create", _cairo_boilerplate_test_paginated_create_surface, NULL, NULL, _cairo_boilerplate_test_paginated_get_image_surface, @@ -296,6 +302,7 @@ static const cairo_boilerplate_target_t targets[] = { "test-wrapping", "image", NULL, NULL, CAIRO_INTERNAL_SURFACE_TYPE_TEST_WRAPPING, CAIRO_CONTENT_COLOR_ALPHA, 0, + "_cairo_test_wrapping_surface_create", _cairo_boilerplate_test_wrapping_create_surface, NULL, NULL, _cairo_boilerplate_get_image_surface, @@ -307,6 +314,7 @@ static const cairo_boilerplate_target_t targets[] = { "null", "image", NULL, NULL, CAIRO_INTERNAL_SURFACE_TYPE_NULL, CAIRO_CONTENT_COLOR_ALPHA, 0, + "_cairo_test_null_surface_create", _cairo_boilerplate_test_null_create_surface, NULL, NULL, NULL, NULL, NULL, diff --git a/boilerplate/cairo-boilerplate-vg.c b/boilerplate/cairo-boilerplate-vg.c index 75756ddb..2ea1a07b 100644 --- a/boilerplate/cairo-boilerplate-vg.c +++ b/boilerplate/cairo-boilerplate-vg.c @@ -305,6 +305,7 @@ static const cairo_boilerplate_target_t targets[] = { { "vg-glx", "vg", NULL, NULL, CAIRO_SURFACE_TYPE_VG, CAIRO_CONTENT_COLOR_ALPHA, 1, + "cairo_vg_context_create_for_glx", _cairo_boilerplate_vg_create_surface_glx, NULL, NULL, _cairo_boilerplate_get_image_surface, @@ -315,6 +316,7 @@ static const cairo_boilerplate_target_t targets[] = { { "vg-glx", "vg", NULL, NULL, CAIRO_SURFACE_TYPE_VG, CAIRO_CONTENT_COLOR, 1, + "cairo_vg_context_create_for_glx", _cairo_boilerplate_vg_create_surface_glx, NULL, NULL, _cairo_boilerplate_get_image_surface, @@ -327,6 +329,7 @@ static const cairo_boilerplate_target_t targets[] = { { "vg-egl", "vg", NULL, NULL, CAIRO_SURFACE_TYPE_VG, CAIRO_CONTENT_COLOR_ALPHA, 1, + "cairo_vg_context_create_for_egl", _cairo_boilerplate_vg_create_surface_egl, NULL, NULL, _cairo_boilerplate_get_image_surface, @@ -337,6 +340,7 @@ static const cairo_boilerplate_target_t targets[] = { { "vg-egl", "vg", NULL, NULL, CAIRO_SURFACE_TYPE_VG, CAIRO_CONTENT_COLOR, 1, + "cairo_vg_context_create_for_egl", _cairo_boilerplate_vg_create_surface_egl, NULL, NULL, _cairo_boilerplate_get_image_surface, diff --git a/boilerplate/cairo-boilerplate-win32-printing.c b/boilerplate/cairo-boilerplate-win32-printing.c index 541401a0..ecaac5fe 100644 --- a/boilerplate/cairo-boilerplate-win32-printing.c +++ b/boilerplate/cairo-boilerplate-win32-printing.c @@ -347,6 +347,7 @@ static const cairo_boilerplate_target_t targets[] = { "win32-printing", "win32", ".ps", NULL, CAIRO_SURFACE_TYPE_WIN32_PRINTING, CAIRO_TEST_CONTENT_COLOR_ALPHA_FLATTENED, 0, + "cairo_win32_printing_surface_create", _cairo_boilerplate_win32_printing_create_surface, NULL, NULL, _cairo_boilerplate_win32_printing_get_image_surface, @@ -357,6 +358,7 @@ static const cairo_boilerplate_target_t targets[] = { { "win32-printing", "win32", ".ps", NULL, CAIRO_SURFACE_TYPE_META, CAIRO_CONTENT_COLOR, 0, + "cairo_win32_printing_surface_create", _cairo_boilerplate_win32_printing_create_surface, NULL, NULL, _cairo_boilerplate_win32_printing_get_image_surface, diff --git a/boilerplate/cairo-boilerplate-win32.c b/boilerplate/cairo-boilerplate-win32.c index 420989b2..2b3abb18 100644 --- a/boilerplate/cairo-boilerplate-win32.c +++ b/boilerplate/cairo-boilerplate-win32.c @@ -52,6 +52,7 @@ static const cairo_boilerplate_target_t targets[] = { { "win32", "win32", NULL, NULL, CAIRO_SURFACE_TYPE_WIN32, CAIRO_CONTENT_COLOR, 0, + "cairo_win32_surface_create_with_dib", _cairo_boilerplate_win32_create_surface, NULL, NULL, _cairo_boilerplate_get_image_surface, @@ -63,6 +64,7 @@ static const cairo_boilerplate_target_t targets[] = { { "win32", "win32", NULL, NULL, CAIRO_SURFACE_TYPE_WIN32, CAIRO_CONTENT_COLOR_ALPHA, 0, + "cairo_win32_surface_create_with_dib", _cairo_boilerplate_win32_create_surface, NULL, NULL, _cairo_boilerplate_get_image_surface, diff --git a/boilerplate/cairo-boilerplate-xcb.c b/boilerplate/cairo-boilerplate-xcb.c index 63c20e8a..0653d8ce 100644 --- a/boilerplate/cairo-boilerplate-xcb.c +++ b/boilerplate/cairo-boilerplate-xcb.c @@ -119,6 +119,7 @@ static const cairo_boilerplate_target_t targets[] = { { "xcb", "xcb", NULL, NULL, CAIRO_SURFACE_TYPE_XCB, CAIRO_CONTENT_COLOR_ALPHA, 1, + "cairo_xcb_surface_create_with_xrender_format", _cairo_boilerplate_xcb_create_surface, NULL, NULL, _cairo_boilerplate_get_image_surface, diff --git a/boilerplate/cairo-boilerplate-xlib.c b/boilerplate/cairo-boilerplate-xlib.c index d67a938f..fe54d988 100644 --- a/boilerplate/cairo-boilerplate-xlib.c +++ b/boilerplate/cairo-boilerplate-xlib.c @@ -439,6 +439,7 @@ static const cairo_boilerplate_target_t targets[] = { { "xlib", "xlib", NULL, "xlib-reference", CAIRO_SURFACE_TYPE_XLIB, CAIRO_CONTENT_COLOR_ALPHA, 1, + "cairo_xlib_surface_create_with_xrender_format", _cairo_boilerplate_xlib_create_surface, NULL, NULL, _cairo_boilerplate_get_image_surface, @@ -449,6 +450,7 @@ static const cairo_boilerplate_target_t targets[] = { { "xlib", "xlib", NULL, "xlib-reference", CAIRO_SURFACE_TYPE_XLIB, CAIRO_CONTENT_COLOR, 1, + "cairo_xlib_surface_create_with_xrender_format", _cairo_boilerplate_xlib_create_surface, NULL, NULL, _cairo_boilerplate_get_image_surface, @@ -459,6 +461,7 @@ static const cairo_boilerplate_target_t targets[] = { { "xlib-reference", "xlib", NULL, NULL, CAIRO_SURFACE_TYPE_XLIB, CAIRO_CONTENT_COLOR, 1, + "cairo_xlib_surface_create", _cairo_boilerplate_xlib_reference_create_surface, NULL, NULL, NULL, /* get_image */ @@ -473,6 +476,7 @@ static const cairo_boilerplate_target_t targets[] = { { "xlib-fallback", "xlib", NULL, NULL, CAIRO_SURFACE_TYPE_XLIB, CAIRO_CONTENT_COLOR, 1, + "cairo_xlib_surface_create", _cairo_boilerplate_xlib_fallback_create_surface, NULL, NULL, _cairo_boilerplate_get_image_surface, diff --git a/boilerplate/cairo-boilerplate.c b/boilerplate/cairo-boilerplate.c index 1abfe09e..ebbad458 100644 --- a/boilerplate/cairo-boilerplate.c +++ b/boilerplate/cairo-boilerplate.c @@ -45,6 +45,10 @@ #include <assert.h> #include <errno.h> +#if HAVE_DL +#include <dlfcn.h> +#endif + #if HAVE_UNISTD_H && HAVE_FCNTL_H && HAVE_SIGNAL_H && HAVE_SYS_STAT_H && HAVE_SYS_SOCKET_H && HAVE_SYS_UN_H #include <unistd.h> #include <fcntl.h> @@ -278,7 +282,7 @@ static const cairo_boilerplate_target_t builtin_targets[] = { { "image", "image", NULL, NULL, CAIRO_SURFACE_TYPE_IMAGE, CAIRO_CONTENT_COLOR_ALPHA, 0, - _cairo_boilerplate_image_create_surface, + NULL, _cairo_boilerplate_image_create_surface, NULL, NULL, _cairo_boilerplate_get_image_surface, cairo_surface_write_to_png @@ -286,7 +290,7 @@ static const cairo_boilerplate_target_t builtin_targets[] = { { "image", "image", NULL, NULL, CAIRO_SURFACE_TYPE_IMAGE, CAIRO_CONTENT_COLOR, 0, - _cairo_boilerplate_image_create_surface, + NULL, _cairo_boilerplate_image_create_surface, NULL, NULL, _cairo_boilerplate_get_image_surface, cairo_surface_write_to_png @@ -295,6 +299,7 @@ static const cairo_boilerplate_target_t builtin_targets[] = { { "meta", "image", NULL, NULL, CAIRO_SURFACE_TYPE_META, CAIRO_CONTENT_COLOR_ALPHA, 0, + "cairo_meta_surface_create", _cairo_boilerplate_meta_create_surface, NULL, NULL, _cairo_boilerplate_get_image_surface, @@ -305,6 +310,7 @@ static const cairo_boilerplate_target_t builtin_targets[] = { { "meta", "image", NULL, NULL, CAIRO_SURFACE_TYPE_META, CAIRO_CONTENT_COLOR, 0, + "cairo_meta_surface_create", _cairo_boilerplate_meta_create_surface, NULL, NULL, _cairo_boilerplate_get_image_surface, @@ -321,6 +327,19 @@ static struct cairo_boilerplate_target_list { const cairo_boilerplate_target_t *target; } *cairo_boilerplate_targets; +static cairo_bool_t +probe_target (const cairo_boilerplate_target_t *target) +{ + if (target->probe == NULL) + return TRUE; + +#if HAVE_DL + return dlsym (NULL, target->probe) != NULL; +#else + return TRUE; +#endif +} + void _cairo_boilerplate_register_backend (const cairo_boilerplate_target_t *targets, unsigned int count) @@ -329,9 +348,13 @@ _cairo_boilerplate_register_backend (const cairo_boilerplate_target_t *targets, while (count--) { struct cairo_boilerplate_target_list *list; + --targets; + if (! probe_target (targets)) + continue; + list = xmalloc (sizeof (*list)); list->next = cairo_boilerplate_targets; - list->target = --targets; + list->target = targets; cairo_boilerplate_targets = list; } } diff --git a/boilerplate/cairo-boilerplate.h b/boilerplate/cairo-boilerplate.h index 377d2f91..82d42e8c 100644 --- a/boilerplate/cairo-boilerplate.h +++ b/boilerplate/cairo-boilerplate.h @@ -157,6 +157,7 @@ typedef struct _cairo_boilerplate_target { cairo_surface_type_t expected_type; cairo_content_t content; unsigned int error_tolerance; + const char *probe; /* runtime dl check */ cairo_boilerplate_create_surface_t create_surface; cairo_boilerplate_force_fallbacks_t force_fallbacks; cairo_boilerplate_finish_surface_t finish_surface; |