[cairo] Xlib/Xcb and EXTEND_PAD

Bill Spitzak spitzak at thefoundry.co.uk
Tue Jan 20 13:14:26 PST 2009


The problem really is that people thought that REPEAT_NONE was something 
that was wanted. They should have talked to programmers who have worked 
with image processing and texture mapping and we would have told them 
that REPEAT_PAD is the most important thing to support. REPEAT_NONE is 
trivially supported by adding a black pixel all around the edge and 
doing REPEAT_PAD.

REPEAT_TILE and so on appeals to some programmers, but it seems to me 
that in the real world nobody uses repeating tiled backgrounds, or the 
backgrounds are so large that there probably is no loss in having the 
program itself draw the image repeatedly to fill it. Small repeating 
backgrounds are not used because they look very old-fashioned.

I still think Cairo should be altered so that drawing images does "what 
the user expects". This is to do REPEAT_PAD and then clip it with a 
*sharp* anti-aliased rectangle that is the image rectangle transformed 
to output space. Nobody wants fuzzy black edges, and again it is trivial 
to make them atop this by adding a black pixel to the edge of your 
picture. I don't think any other mode is needed.

Removing the need to check the padding type from the backends would help 
a lot to force them to update to correct behavior.

Clemens Eisserer wrote:
>> I just looked at the source of all the video drivers that are currently
>> in Ubuntu jaunty.  There are 7 drivers that accelerate Composite in one
>> form or another.  Except for the intel driver, none of them even access
>> the repeatType field, so it's not much of a surprise that we get bad
>> results.  Here's the breakdown (take this with a grain of salt, I didn't
>> spend a lot of time looking at the individual packages):
> 
> Thanks for looking at it.
> 
> I've also create a backend for something similar to cairo, and it also
> relies on REPEAT_PAD a lot.
> If mozilla would use it, I don't doubt it wouldn't take long for the
> drivers to accalerate it properly.
> As always, it seems to be the usual chicken-egg problem render has
> since its birth somewhere in 2001.
> 
> - Clemens
> _______________________________________________
> cairo mailing list
> cairo at cairographics.org
> http://lists.cairographics.org/mailman/listinfo/cairo


-- 
Bill Spitzak, Senior Software Engineer
The Foundry, 618 Hampton Drive, Venice, CA, 90291, USA
Tel: +1 310 399-4555 * Fax: +1 310 450-4516 * Web: www.thefoundry.co.uk
The Foundry Visionmongers Ltd * Registered in England and Wales No: 4642027


More information about the cairo mailing list