[cairo] Performance difference between rgb and rgba with alpha 1.0 ?

Stuart Axon stuaxo2 at yahoo.com
Wed May 12 11:37:30 PDT 2010


Is it worth me doing this:
    if self._strokecolor[3] == 1:
        cairo_ctx.set_source_rgb(*self._strokecolor[0:3])
    else:
        cairo_ctx.set_source_rgba(*self._strokecolor)

or is it a waste of python cycles because set_source_rgba will notice that alpha is set to 1.0
and run the faster path anyway ?

 S++



      


More information about the cairo mailing list