[cairo] Musings on the default of EXTEND_NONE for surfacepatterns

Carl Worth cworth at cworth.org
Mon Apr 7 11:56:27 PDT 2008


On Mon, 07 Apr 2008 14:43:58 -0400, Antoine Azar wrote:
> Oops I sent my previous mail from the wrong address and it landed only in
> Carl's mailbox instead of the Cairo mailing list. Thanks Carl for inlining
> and replying.

No worries.

> So not mathematically impossible, no. But it's not "just an extend mode" in
> any sense that we've seen before. And there are lots of opportunities for a
> fix like this to accidentally add a repeated border of extra pixels when
> doing CAIRO_FILTER_NEAREST.
>
> Why?

Antoine, your mail user agent is sending out plain-text email with no
indication as to which parts you are quoting, (like my "So not
mathematically impossible..." paragraph above), and which parts you
typed, (like "Why?").

I notice there's a separate HTML rendering of the message as well, but
I'm not looking at that to try to figure out which parts you
added. Can you find a way to send plain-text email with quoting
indicated? Otherwise, I'm very likely to miss things you're saying.

> And that has implications down into pixman, the Render extension, the X
> server, X server drivers, etc. So I don't think it's a good idea. Already,
> we know that the X server and drivers don't have event EXTEND_REPEAT,
> EXTEND_PAD, and EXTEND_REFLECT working reliably. I would not expect
> EXTEND_PAD_OR_NONE_DEPENDING_ON_FILTER_BOX_SIZE to be much more reliable.
>
> Again it shouldn't be dependent at all on the filter box size. There might
> effectively be no support in drivers, but I'm pretty sure we can implement
> it in pixman.

It does depend on the filter's size. If the filter is going to read
sample N pixels away from the destination pixel, then your magic
extend mode needs to do padding out to N pixels.

Oh, but you also want the NONE behavior as soon as the destination
pixel is effectively outside the image, (even for samples within N
pixels of the destination).

OK, so now I understand your "why?" and why you didn't expect the
approach to depend on the filter's size. You want the sampling to
receive not just a sample coordinate, but also another destination
coordinate, and the sampling mode would be determined by effectively
testing the destination coordinate against the image. So that's even
more of an entanglement of the extend mode and the filter than I had
proposed before. So this just keeps getting worse.

And "implement it [only] in pixman" is really worthless. If we can't
support this in X drivers, then we don't want anyone using it, (or
else we can never get good performance out of any program that uses
it).

-Carl
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.cairographics.org/archives/cairo/attachments/20080407/91c2da4b/attachment.pgp 


More information about the cairo mailing list