[cairo] Should Cairo support non-bitmap memory surfaces?
Benjamin Otte
otte at redhat.com
Sun May 23 04:26:47 PDT 2010
On Sat, 2010-05-22 at 19:21 -0400, Adrian Lopez wrote:
> Just to clear up what I meant in the first part of my post: since fill
> and stroke are separate operations in Cairo, drawing a transparent
> border around a transparent filled shape will result in the fill
> showing through the stroke, which may or may not be what's actually
> desired. If you want to apply transparency to the whole (fill +
> stroke) rather than each part separately, your only option is to use
> an intermediate surface containing the opaque object (fill + stroke)
> and then draw this surface onto the target while applying the desired
> level of transparency. A similar logic applies to compositing.
>
Note that you can use code like:
cairo_push_group (cr);
/* do your drawing without alpha */
cairo_pop_group_to_soruce (cr);
cairo_paint_with_alpha (cr, alpha);
to achieve this effect with a minimal amount of code.
Benjamin
More information about the cairo
mailing list