[cairo] [RFC] Pixman & compositing with overlapping source and destination pixel data

Siarhei Siamashka siarhei.siamashka at gmail.com
Wed Jun 3 02:42:48 PDT 2009


What kind of guarantees (or the lack of) pixman and XRender are supposed to
provide when dealing with overlapping parts of images?

The practical use case could be scrolling of data inside of a single big
image. If rendering with overlapped source and destination areas is not
supported, a temporary image has to be created to achieve expected result
and this is an additional performance hit.

With the ongoing pixman refactoring and fixup for various inconsistencies, it
would be nice if the status of overlapped rendering could be clarified too.
The whole thing is kind of like memcpy vs. memove

The possible cases to handle are:
1. User provides the same destination and either source or mask images to some 
of the pixman functions with overlapping source and destination areas.
2. User provides same memory area, but wrapped into different pixman images
to pixman rendering function, so that source and destination pixel data still

Generic path in pixman fetches lines into a temporary buffer, so everything
should be fine in horizontal direction. For vertical direction, reversing the
order of handling lines (and using negative stride) could be also possible.
So if overlapped rendering is to be supported, technically there should not be
any big problems. Performance would be worse in the case when overlapped
rendering has to be sent to the generic path, but it would provide incorrect
(or unexpected) results in the fast path anyway. Overlapping-aware fast path
functions can be also created.

What do you think about the whole issue?

Best regards,
Siarhei Siamashka

More information about the cairo mailing list