[cairo] Alpha masks

Owen Taylor otaylor at redhat.com
Thu Jan 6 13:08:35 PST 2005


On Thu, 2005-01-06 at 12:43 -0800, Keith Packard wrote:
> Around 15 o'clock on Jan 6, Owen Taylor wrote:
> 
> > I think in terms of the original requested operation (basically, use
> > an A8 surface in place of a polygon or set of glyphs), this doesn't
> > fit very will.
> 
> In Twin (a tiny window system), I provide two levels in the API; the low 
> level 'Composite' api which performs basic image compositing upon which 
> the geometry is built, following the Plan 9 architecture which makes paths 
> just an implicit mask to the path compositing operation.  In cairo, we 
> would then have something like:
> 
> 	cairo_composite (cairo_t	 dst, 
> 			 cairo_pattern_t src, 
> 			 cairo_pattern_t msk);
> 
> (this is not a formal proposal; I realize the confusion in having a 
> pattern in dst).
> 
> We would then formally define cairo_fill and cairo_stroke in terms of this 
> primitive -- the msk operand is build from the provided geometry.
> 
> And, your cairo_show_surface_mask becomes a simple wrapper around the 
> above general compositing function.
> 
> I guess what I'm trying to avoid is having a collection of useful but not
> obviously related rendering operations.

I agree in the overall vision here ... that there should be drawing
equation. Otherwise, we'll get into the current situation where unusual
combinations do arbitrary weird things.

I don't think implies that we have to have some generic operator that 
exposes the drawing equation directly; backends need higher level access
so they can avoid generating a million temporary surfaces and treating
everything as an image.

And I don't think we have to have expose full generality in every
operand of the drawing equation. What does it mean to have a gradient
as a mask?

fill(), stroke(), show_text(), show_surface_mask() strike me as very
consistent operations. The mask is explicit, the other arguments
implicit. show_surface() is an oddball operation, but almost certainly
necessary.

Regards,
					Owen

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.freedesktop.org/archives/cairo/attachments/20050106/5d12586c/attachment.pgp


More information about the cairo mailing list