[cairo] Transparent pattern may be wrong

Bill Spitzak spitzak at d2.com
Tue Mar 1 11:03:49 PST 2005


David Reveman wrote:

>>I am unaware of any way to accelerate TRANSPARENT_OUTSIDE that produces 
>>an *antialiased* result other than to pad the image with a pixel of 
>>black and then loading it as a texture. Can you explain what you are 
>>doing? In the pad-the-image solution it is trivial to make that edge be 
>>any color or alpha wanted.
> 
> Wrap mode GL_CLAMP_TO_BORDER and transformation using the texture
> matrix.

Looks right. My documentation was old.

> Yes, I know it will be double-premultiplied, but even though this might
> not be the expected behavior, it's still the correct result for when
> using EXTEND_TRANSPARENT. The question is if this unexpected behavior is
> such a big problem that we should avoid EXTEND_TRANSPARENT as default? I
> don't have enough experience with writing applications that expose this
> problem to answer it. 

I don't think it is actually the "correct" behavior because the 
resulting image is different than if it was drawn the same way at a 
higher resolution and then filtered down to the current resolution. I 
think Cairo should try as much as possible to produce the best 
approximation to an infinite-resolution picture it can. The only 
practical way I can see to do this with transparent pattern edges is to 
depreciate the use of them by not making it the default.



More information about the cairo mailing list