[cairo] set_source_rgb vs set_source_rgba [Performance]

Charles Doutriaux doutriaux1 at llnl.gov
Fri Aug 15 09:13:59 PDT 2008


One thing I noticed with postscript output,
Say you're using a ppattern of stripes to fill a region
Once converted to postscript if you used rgb, you'll have black stripes 
where there's "no" data (i.e the empty stripe part)
whereas if you really use rgba you do obtain the transparency effect. 
And it DOES also affect the size of the postscript of course.

By the way I always wondered why the black stripes? I can understand 
that it's not transparent, but i would have guess for white stripes 
instead of black.

C.


Nicholas Allen wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>  
> 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.
>
> Nick
>
> Ian Britten wrote:
>   
>> Hi all, When drawing solid colours (Alpha=1.0), is there any
>> performance benefit to using set_source_rgb() as opposed to
>> set_source_rgba()?
>>
>> I'm wondering whether to add the complexity to my code to
>> distinguish the two cases and make the appropriate calls, or
>> whether simply calling set_source_rgba() all the time will
>> automatically fall back to same behaviour? [ Obviously, rendering
>> speed is a concern, and I'll add the complexity to our code, if
>> there's a benefit ]
>>
>> Thanks! Ian _______________________________________________ cairo
>> mailing list cairo at cairographics.org
>> http:// lists.cairographics.org/mailman/listinfo/cairo
>>     
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.7 (MingW32)
> Comment: Using GnuPG with Mozilla - http:// enigmail.mozdev.org
>  
> iD8DBQFIpaOCbpmWsXfOU58RAr4OAKCntsAmvDNAt6qC0eA10/9x5CYnMQCfT/OV
> l1ODOteb1Sa/nV0VvjxHRTk=
> =h/FW
> -----END PGP SIGNATURE-----
>
> _______________________________________________
> cairo mailing list
> cairo at cairographics.org
> http:// lists.cairographics.org/mailman/listinfo/cairo
>
>
>   


More information about the cairo mailing list