[cairo] set_source_rgb vs set_source_rgba [Performance]

Behdad Esfahbod behdad at behdad.org
Fri Aug 15 11:21:28 PDT 2008


Chris Wilson wrote:
> On Fri, 2008-08-15 at 13:45 -0400, Behdad Esfahbod wrote:
>> Nicholas Allen wrote:
>>> I would hope that this makes absolutely no difference if the alpha is
>>> 1.0. If it does then it is definately Cairo's fault IMHO.
>> I agree.  I have a vague memoy that we did that at some point, but the code
>> doesn't show that.  Chris may know?
> 
> I did add a check at the entry point to convert a call to set_rgba into
> set_rgb if opaque. Behdad chose to move the check down to the
> _cairo_pattern_init_solid() so that it covered all paths, as part of his
> work into supporting dithering.

Right.  I see it now.  So yeah, there's absolutely no perf hit in using rgba
with alpha 1.0

behdad


More information about the cairo mailing list