[Pixman] [PATCH 1/3] Add CLEAR and SRC linear interpolation operators

Bill Spitzak spitzak at gmail.com
Thu Sep 15 15:23:02 PDT 2011



Søren Sandmann wrote:
> Chris Wilson <chris at chris-wilson.co.uk> writes:
> 
>> Cairo, for instance, has a subtly different interpretation of how to use
>> the mask in combination with the Porter-Duff operators. In particular,
>> it has the notion of a clip mask, for which pixman has no parallel.
>>
>> Quoting Soeren:
>>
>>   Another aspect is that cairo uses a different rendering equation in some
>>   cases. The two equations used are:
>>
>> 	unbounded:   [(src IN shape) OP dest          ] LERP_clip dest
>>
>> 	bounded:     [(src OP dest) LERP_shape dest   ] LERP_clip dest
>>
>>   With shaped clips, the LERP_clip part is taken care of, and the first
>>   equation is already directly supported by pixman. The second one could
>>   be supported by adding new <op>_LERP operators that would use the
>>
>> 	(src OP dest) LERP_shape dest
>>
>>   equation. For cairo's purposes, all we need is CLEAR_LERP and SRC_LERP,
>>   but I think it could be useful to have the full set of LERP operators.
> 
> Did you see Taekyun Kim's reply to this? He proposes this API:
> 
>      pixman_image_composite_xrender(op, src, shape, clip, dst)
>      pixman_image_composite_bounded(op, src, shape, clip, dst)
>      pixman_image_composite_simple(op, src, shape, clip, dst)

For some ops such as OVER these all produce the same image.

I think it would work better to have a single function, but expand the 
op to include extra enumerations for the cases where the result is 
different and a choice has to be made between bounded and unbounded.


More information about the Pixman mailing list