mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-01-08 01:20:19 +01:00
The PS/PDF backends don't allow a content to be passed in right now, so they fail against the rgb24 tests, but the trivial addition to the constructors will allow them to pass all tests with both content values. And new constructors (currently internal only) to create an image surface with a cairo_content_t rather than a cairo_format_t. Add a cairo_content_t argument to the constructor. Add a cairo_content_t to the constructor and use this content value when constructing intermediate image surfaces in acquire_source, show_page, copy_page, and snapshot. Add image flattening by compositing over white, as is done in cairo-ps-surface.c. Track changes to cairo-paginates-surface which now requires a cairo_content_t value (no change to public PS/PDF constructors yet). Track change in meta-surface and paginated-surface interfaces by now accepting a cairo_content_t rather than a cairo_format_t. Ignore new output files (argb32 from pdf and ps as well as rgb24 from test-fallback, test-meta, and test-paginated). Add new utility for flattening PNG images in order to generate the -argbf-ref.png images. Add image_diff_flattened for comparing flattened output from PS and PDF backend with ARGB reference images by first blending the reference images over white. Get rid of conditional, format-specific background-color initialization before running tests. Now uses ARGB(0,0,0,0) in all cases. Switch from specifying tests with a format value to specifying tests with a content value. Add support for a 'fake' COLOR_ALPHA_FLATTENED content for testing the PS and PDF output against a flattened version of the argb32 reference images (first blended over white). Track change in cairo_ps_surface_create (now requires cairo_content_t value). Adjust tests that draw in default (black) to first paint white so that the results are visible. Adjust ARGB32 reference images for new white background for changed tests. Adjust RGB24 reference images for new black background due to changed initialization (and the tests themselves being unchanged).
378 lines
10 KiB
Makefile
378 lines
10 KiB
Makefile
# All test cases go here
|
|
TESTS = \
|
|
a8-mask \
|
|
caps-joins \
|
|
caps-sub-paths \
|
|
clip-all \
|
|
clip-fill-rule \
|
|
clip-fill-rule-pixel-aligned \
|
|
clip-nesting \
|
|
clip-operator \
|
|
clip-twice \
|
|
composite-integer-translate-source \
|
|
composite-integer-translate-over \
|
|
composite-integer-translate-over-repeat \
|
|
create-from-png \
|
|
create-from-png-stream \
|
|
dash-caps-joins \
|
|
dash-offset-negative \
|
|
extend-reflect \
|
|
fill-and-stroke \
|
|
fill-rule \
|
|
filter-nearest-offset \
|
|
get-and-set \
|
|
gradient-alpha \
|
|
leaky-polygon \
|
|
line-width \
|
|
linear-gradient \
|
|
mask \
|
|
mask-ctm \
|
|
mask-surface-ctm \
|
|
move-to-show-surface \
|
|
nil-surface \
|
|
operator-clear \
|
|
operator-source \
|
|
paint \
|
|
paint-with-alpha \
|
|
path-data \
|
|
pixman-rotate \
|
|
rectangle-rounding-error \
|
|
scale-source-surface-paint \
|
|
select-font-no-show-text \
|
|
self-copy \
|
|
self-intersecting \
|
|
set-source \
|
|
show-text-current-point \
|
|
source-clip \
|
|
source-surface-scale-paint \
|
|
surface-finish-twice \
|
|
surface-pattern \
|
|
text-antialias-gray \
|
|
text-antialias-none \
|
|
text-antialias-subpixel \
|
|
text-cache-crash \
|
|
text-pattern \
|
|
text-rotate \
|
|
transforms \
|
|
translate-show-surface \
|
|
trap-clip \
|
|
unantialiased-shapes \
|
|
unbounded-operator \
|
|
user-data \
|
|
rel-path
|
|
|
|
if HAVE_PTHREAD
|
|
TESTS += pthread-show-text
|
|
endif
|
|
|
|
if CAIRO_HAS_FT_FONT
|
|
TESTS += ft-font-create-for-ft-face
|
|
endif
|
|
|
|
if CAIRO_HAS_SVG_SURFACE
|
|
TESTS += svg-surface svg-clip
|
|
endif
|
|
|
|
if CAIRO_HAS_XLIB_SURFACE
|
|
TESTS += xlib-surface
|
|
endif
|
|
|
|
if CAIRO_HAS_MULTI_PAGE_SURFACES
|
|
TESTS += multi-page
|
|
endif
|
|
|
|
# All tests which have a reference image go here.
|
|
# I really don't like having to repeat this list. Anyone know a good
|
|
# way to avoid it? Can I use a wildcard here?
|
|
EXTRA_DIST = \
|
|
a8-mask-ref.png \
|
|
a8-mask-rgb24-ref.png \
|
|
caps-joins-ps-rgb24-ref.png \
|
|
caps-joins-ref.png \
|
|
caps-joins-rgb24-ref.png \
|
|
caps-sub-paths-ref.png \
|
|
caps-sub-paths-rgb24-ref.png \
|
|
clip-all-ref.png \
|
|
clip-all-rgb24-ref.png \
|
|
clip-fill-rule-ref.png \
|
|
clip-fill-rule-pixel-aligned-ref.png \
|
|
clip-nesting-ps-rgb24-ref.png \
|
|
clip-nesting-ref.png \
|
|
clip-nesting-rgb24-ref.png \
|
|
clip-operator-ref.png \
|
|
clip-operator-rgb24-ref.png \
|
|
clip-twice-ps-rgb24-ref.png \
|
|
clip-twice-ref.png \
|
|
clip-twice-rgb24-ref.png \
|
|
composite-integer-translate-over-ref.png \
|
|
composite-integer-translate-over-repeat-ref.png \
|
|
composite-integer-translate-over-repeat-rgb24-ref.png \
|
|
composite-integer-translate-over-rgb24-ref.png \
|
|
composite-integer-translate-source-ref.png \
|
|
composite-integer-translate-source-rgb24-ref.png \
|
|
create-from-png-ref.png \
|
|
create-from-png-rgb24-ref.png \
|
|
create-from-png-stream-ref.png \
|
|
create-from-png-stream-rgb24-ref.png \
|
|
dash-caps-joins-ref.png \
|
|
dash-caps-joins-rgb24-ref.png \
|
|
dash-offset-negative-ref.png \
|
|
dash-offset-negative-rgb24-ref.png \
|
|
dash-offset-negative-ps-rgb24-ref.png \
|
|
extend-reflect-ref.png \
|
|
extend-reflect-rgb24-ref.png \
|
|
fill-and-stroke-ref.png \
|
|
fill-and-stroke-rgb24-ref.png \
|
|
fill-rule-ref.png \
|
|
fill-rule-rgb24-ref.png \
|
|
filter-nearest-offset-ref.png \
|
|
filter-nearest-offset-rgb24-ref.png \
|
|
gradient-alpha-ref.png \
|
|
gradient-alpha-rgb24-ref.png \
|
|
leaky-polygon-ref.png \
|
|
leaky-polygon-rgb24-ref.png \
|
|
linear-gradient-ref.png \
|
|
linear-gradient-rgb24-ref.png \
|
|
line-width-ref.png \
|
|
line-width-rgb24-ref.png \
|
|
mask-ctm-ref.png \
|
|
mask-ctm-rgb24-ref.png \
|
|
mask-ref.png \
|
|
mask-rgb24-ref.png \
|
|
mask-surface-ctm-ref.png \
|
|
mask-surface-ctm-rgb24-ref.png \
|
|
move-to-show-surface-ref.png \
|
|
move-to-show-surface-rgb24-ref.png \
|
|
nil-surface-ref.png \
|
|
nil-surface-rgb24-ref.png \
|
|
operator-clear-ref.png \
|
|
operator-clear-rgb24-ref.png \
|
|
operator-source-ref.png \
|
|
operator-source-rgb24-ref.png \
|
|
paint-ref.png \
|
|
paint-rgb24-ref.png \
|
|
paint-with-alpha-ref.png \
|
|
paint-with-alpha-rgb24-ref.png \
|
|
path-data-ref.png \
|
|
path-data-rgb24-ref.png \
|
|
pixman-rotate-ref.png \
|
|
pixman-rotate-rgb24-ref.png \
|
|
rectangle-rounding-error-ref.png \
|
|
rectangle-rounding-error-rgb24-ref.png \
|
|
rel-path-ref.png \
|
|
rel-path-rgb24-ref.png \
|
|
romedalen.png \
|
|
scale-source-surface-paint-ref.png \
|
|
scale-source-surface-paint-rgb24-ref.png \
|
|
self-copy-ref.png \
|
|
self-copy-rgb24-ref.png \
|
|
self-intersecting-ref.png \
|
|
self-intersecting-rgb24-ref.png \
|
|
set-source-ref.png \
|
|
set-source-rgb24-ref.png \
|
|
show-text-current-point-ref.png \
|
|
show-text-current-point-rgb24-ref.png \
|
|
source-clip-ref.png \
|
|
source-clip-rgb24-ref.png \
|
|
source-surface-scale-paint-ref.png \
|
|
source-surface-scale-paint-rgb24-ref.png \
|
|
surface-pattern-ref.png \
|
|
surface-pattern-rgb24-ref.png \
|
|
text-antialias-gray-ref.png \
|
|
text-antialias-gray-rgb24-ref.png \
|
|
text-antialias-none-ref.png \
|
|
text-antialias-none-rgb24-ref.png \
|
|
text-antialias-subpixel-ref.png \
|
|
text-antialias-subpixel-rgb24-ref.png \
|
|
text-pattern-ref.png \
|
|
text-pattern-rgb24-ref.png \
|
|
text-rotate-rgb24-ref.png \
|
|
transforms-ref.png \
|
|
transforms-rgb24-ref.png \
|
|
translate-show-surface-ref.png \
|
|
translate-show-surface-rgb24-ref.png \
|
|
trap-clip-ref.png \
|
|
trap-clip-rgb24-ref.png \
|
|
unantialiased-shapes-ps-rgb24-ref.png \
|
|
unantialiased-shapes-ref.png \
|
|
unantialiased-shapes-rgb24-ref.png \
|
|
unbounded-operator-ref.png \
|
|
unbounded-operator-rgb24-ref.png
|
|
|
|
# Any test for which the code committed to CVS is expected to fail
|
|
# should be listed here.
|
|
#
|
|
# This way, we can avoid being bothered by reports of bugs we are
|
|
# aware of, but users can still report when tests start behaving in
|
|
# unexpected ways on their system.
|
|
#
|
|
# Of course, before any "release" of cairo we should eliminate
|
|
# everything from this list by fixing the bugs. (We don't necessarily
|
|
# have to be that strict for "snapshots" though.)
|
|
#
|
|
# Also, any test listed here should call cairo_test_expect_failure and
|
|
# provide an explanation for the expected failure.
|
|
XFAIL_TESTS = \
|
|
a8-mask \
|
|
extend-reflect \
|
|
filter-nearest-offset \
|
|
pixman-rotate \
|
|
self-intersecting \
|
|
text-rotate
|
|
|
|
check_PROGRAMS = $(TESTS)
|
|
|
|
# We're using _GNU_SOURCE to get the prototype for asprintf. This may
|
|
# not be the most portable approach, but it is pragmatic and I'm
|
|
# willing to do something cleaner as soon as it causes someone a
|
|
# problem.
|
|
INCLUDES = \
|
|
-D_GNU_SOURCE \
|
|
-I$(srcdir) \
|
|
-I$(top_srcdir)/pixman/src \
|
|
-I$(top_builddir)/src \
|
|
-I$(top_srcdir)/src \
|
|
$(CAIRO_CFLAGS)
|
|
|
|
noinst_LTLIBRARIES = libcairotest.la
|
|
|
|
libcairotest_la_SOURCES =\
|
|
buffer-diff.c \
|
|
buffer-diff.h \
|
|
cairo-test.c \
|
|
cairo-test.h \
|
|
read-png.c \
|
|
read-png.h \
|
|
write-png.c \
|
|
write-png.h \
|
|
xmalloc.c \
|
|
xmalloc.h
|
|
|
|
if CAIRO_HAS_BEOS_SURFACE
|
|
libcairotest_la_SOURCES += cairo-test-beos.cpp cairo-test-beos.h
|
|
# BeOS system headers trigger this warning
|
|
libcairotest_la_CXXFLAGS = -Wno-multichar
|
|
endif
|
|
|
|
if CAIRO_HAS_DIRECTFB_SURFACE
|
|
libcairotest_la_SOURCES += cairo-test-directfb.c cairo-test-directfb.h
|
|
endif
|
|
|
|
LDADDS = libcairotest.la $(top_builddir)/src/libcairo.la
|
|
|
|
if CAIRO_CAN_TEST_GLITZ_AGL_SURFACE
|
|
LDADDS += $(GLITZ_AGL_LIBS)
|
|
endif
|
|
if CAIRO_CAN_TEST_GLITZ_EGL_SURFACE
|
|
LDADDS += $(GLITZ_EGL_LIBS)
|
|
endif
|
|
if CAIRO_CAN_TEST_GLITZ_GLX_SURFACE
|
|
LDADDS += $(GLITZ_GLX_LIBS)
|
|
endif
|
|
if CAIRO_CAN_TEST_GLITZ_WGL_SURFACE
|
|
LDADDS += $(GLITZ_WGL_LIBS)
|
|
endif
|
|
|
|
if HAVE_PTHREAD
|
|
LDADDS += -lpthread
|
|
endif
|
|
|
|
# ARGH! I have to repeat the list of tests a third time. Maybe it's
|
|
# time to break down and auto-generate the Makefile.am or something
|
|
# from autogen.sh. My, but this is painful...
|
|
a8_mask_LDADD = $(LDADDS)
|
|
caps_joins_LDADD = $(LDADDS)
|
|
caps_sub_paths_LDADD = $(LDADDS)
|
|
clip_all_LDADD = $(LDADDS)
|
|
clip_fill_rule_LDADD = $(LDADDS)
|
|
clip_fill_rule_pixel_aligned_LDADD = $(LDADDS)
|
|
clip_nesting_LDADD = $(LDADDS)
|
|
clip_operator_LDADD = $(LDADDS)
|
|
clip_twice_LDADD = $(LDADDS)
|
|
composite_integer_translate_source_LDADD = $(LDADDS)
|
|
composite_integer_translate_over_LDADD = $(LDADDS)
|
|
composite_integer_translate_over_repeat_LDADD = $(LDADDS)
|
|
create_from_png_LDADD = $(LDADDS)
|
|
create_from_png_stream_LDADD = $(LDADDS)
|
|
dash_caps_joins_LDADD = $(LDADDS)
|
|
dash_offset_negative_LDADD = $(LDADDS)
|
|
extend_reflect_LDADD = $(LDADDS)
|
|
fill_and_stroke_LDADD = $(LDADDS)
|
|
fill_rule_LDADD = $(LDADDS)
|
|
filter_nearest_offset_LDADD = $(LDADDS)
|
|
ft_font_create_for_ft_face_LDADD = $(LDADDS)
|
|
get_and_set_LDADD = $(LDADDS)
|
|
gradient_alpha_LDADD = $(LDADDS)
|
|
leaky_polygon_LDADD = $(LDADDS)
|
|
line_width_LDADD = $(LDADDS)
|
|
linear_gradient_LDADD = $(LDADDS)
|
|
mask_LDADD = $(LDADDS)
|
|
mask_ctm_LDADD = $(LDADDS)
|
|
mask_surface_ctm_LDADD = $(LDADDS)
|
|
multi_page_LDADD = $(LDADDS)
|
|
move_to_show_surface_LDADD = $(LDADDS)
|
|
nil_surface_LDADD = $(LDADDS)
|
|
operator_clear_LDADD = $(LDADDS)
|
|
operator_source_LDADD = $(LDADDS)
|
|
paint_LDADD = $(LDADDS)
|
|
paint_with_alpha_LDADD = $(LDADDS)
|
|
path_data_LDADD = $(LDADDS)
|
|
svg_surface_LDADD = $(LDADDS)
|
|
svg_clip_LDADD = $(LDADDS)
|
|
pixman_rotate_LDADD = $(LDADDS)
|
|
pthread_show_text_LDADD = $(LDADDS)
|
|
rectangle_rounding_error_LDADD = $(LDADDS)
|
|
scale_source_surface_paint_LDADD = $(LDADDS)
|
|
select_font_no_show_text_LDADD = $(LDADDS)
|
|
self_copy_LDADD = $(LDADDS)
|
|
self_intersecting_LDADD = $(LDADDS)
|
|
set_source_LDADD = $(LDADDS)
|
|
show_text_current_point_LDADD = $(LDADDS)
|
|
source_clip_LDADD = $(LDADDS)
|
|
source_surface_scale_paint_LDADD = $(LDADDS)
|
|
surface_finish_twice_LDADD = $(LDADDS)
|
|
surface_pattern_LDADD = $(LDADDS)
|
|
text_antialias_gray_LDADD = $(LDADDS)
|
|
text_antialias_none_LDADD = $(LDADDS)
|
|
text_antialias_subpixel_LDADD = $(LDADDS)
|
|
text_cache_crash_LDADD = $(LDADDS)
|
|
text_pattern_LDADD = $(LDADDS)
|
|
text_rotate_LDADD = $(LDADDS)
|
|
transforms_LDADD = $(LDADDS)
|
|
translate_show_surface_LDADD = $(LDADDS)
|
|
trap_clip_LDADD = $(LDADDS)
|
|
unantialiased_shapes_LDADD = $(LDADDS)
|
|
unbounded_operator_LDADD = $(LDADDS)
|
|
user_data_LDADD = $(LDADDS)
|
|
rel_path_LDADD = $(LDADDS)
|
|
xlib_surface_LDADD = $(LDADDS)
|
|
|
|
noinst_PROGRAMS = imagediff png-flatten
|
|
imagediff_LDADD = $(LDADDS)
|
|
png_flatten_LDADD = $(LDADDS)
|
|
|
|
if CAIRO_CAN_TEST_PDF_SURFACE
|
|
noinst_PROGRAMS += pdf2png
|
|
pdf2png_CFLAGS = $(POPPLER_CFLAGS)
|
|
pdf2png_LDADD = $(LDADDS) $(POPPLER_LIBS)
|
|
endif
|
|
|
|
if CAIRO_CAN_TEST_SVG_SURFACE
|
|
noinst_PROGRAMS += svg2png
|
|
svg2png_CFLAGS = $(LIBRSVG_CFLAGS)
|
|
svg2png_LDADD = $(LIBRSVG_LIBS)
|
|
endif
|
|
|
|
CLEANFILES = \
|
|
*.ps \
|
|
*.svg \
|
|
*-out.png \
|
|
*-diff.png \
|
|
*.log \
|
|
multi-page.ps \
|
|
multi-page.pdf \
|
|
svg-surface.svg \
|
|
svg-clip.svg
|
|
|
|
check-valgrind:
|
|
TESTS_ENVIRONMENT="libtool --mode=execute valgrind --tool=memcheck --suppressions=./.valgrind-suppressions --leak-check=yes --show-reachable=yes" $(MAKE) check 2>&1 | tee valgrind.log
|