cairo-x11 ignores pattern surface matrix when showing text with CAIRO_EXTEND_REPEAT on the pattern
The attached program draws some text with a source like cairo_set_source_surface(cr, source, 42, 42)
, i.e. with non-zero translation. The result is saved via cairo_surface_write_to_png
. One can see that the translation is ignored by cairo-x11's traps compositor.
The source surface here is a linear pattern that goes from blue in the top left corner to red in the bottom right corner. The translation moves these so that the corners are in the middle (note that CAIRO_EXTEND_REPEAT
is used for the pattern).
Output with cairo's image backend:
Output with cairo's xlib backend and CAIRO_DEBUG=xrender-version=0.3
in the environment (so that the traps compositor is not used):
Output with cairo's xlib backend and no $CAIRO_DEBUG
:
If one removes cairo_pattern_set_extend(cairo_get_source(cr), CAIRO_EXTEND_REPEAT)
, then the output between image and x11 backends becomes identical and everything is fine, so this must be related to REPEAT
: