xcb: Remove _cairo_xcb_picture_copy

All cairo_xcb_picture_t now get their own, private Picture instead of possibly
sharing it with a cairo_xcb_surface_t.

This solves a cyclic dependency which caused cairo_xcb_picture_t to be leaked
until their device was finished.

When an xcb surface was used as a source, a cairo_xcb_picture_t was created
which kept a reference to the surface. This picture was then added as a snapshot
to the surface which caused the surface to own a reference to the picture.

As a result, the Picture and possibly its associated Pixmap were not freed on
the X11 server which could thus run out of memory.

This change causes more Pictures to be created which could possibly slow down
cairo-xcb. There seems to be no measurable difference with cairo-perf-trace. For
the micro benchmarks, this has the most impact on paint_similar-rgba_source.512:

       min(ticks)  min(ms) median(ms) stddev. iterations overhead
before     158732    0.159    0.159  0.11%   4: 1651.49
after      162579    0.163    0.163  0.18%   4: 1612.41

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=34912

Signed-off-by: Uli Schlachter <psychon@znc.in>
1 file changed