[cairo] is self-copy supposed to work?
Robert O'Callahan
robert at ocallahan.org
Fri Apr 30 05:20:16 PDT 2010
On Fri, Apr 30, 2010 at 11:28 PM, Chris Wilson <chris at chris-wilson.co.uk>wrote:
> On Fri, 30 Apr 2010 22:36:56 +1200, "Robert O'Callahan" <
> robert at ocallahan.org> wrote:
> > Should self-copy --- i.e. using the same source as source and destination
> of
> > a composite --- be supported by cairo backends? I notice there are tests
> for
> > self-copy, but it looks like they are expected to fail. Is pixman
> expected
> > to cope with self-copies? I think I'm experiencing some bugs...
>
> Currently self-copy behaviour is underspecified. I think the consensus is
> that self-modification is undesired...
>
Maybe so. However, I am dealing with a case where it is desired. I am using
a surface as backing store, and the simplest way to implement scrolling is
to do a SOURCE self-copy. The alternative strategies all seem to require
using additional buffers, which uses more memory and probably isn't as fast
due to poorer memory locality.
Also I think it's generally a bad idea for an API to just do something
random in certain special cases.
I can't think of any reasonable behaviour other than to make self-copies
just work. It's not that hard for the general case; just detect the
self-copy and use a temporary buffer. Some simple cases (i.e., the cases I
care about!) can easily be optimized to avoid the temporary buffer.
Rob
--
"He was pierced for our transgressions, he was crushed for our iniquities;
the punishment that brought us peace was upon him, and by his wounds we are
healed. We all, like sheep, have gone astray, each of us has turned to his
own way; and the LORD has laid on him the iniquity of us all." [Isaiah
53:5-6]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cairographics.org/archives/cairo/attachments/20100501/9e7b87eb/attachment.html>
More information about the cairo
mailing list