[cairo] OPERATOR_SRC and no input
Owen Taylor
otaylor at redhat.com
Sun Jan 9 14:38:39 PST 2005
On Sun, 2005-01-09 at 13:33 +0100, Stefan Krause wrote:
> When I'm rendering a path that doesn't fill its bounding box completely
> the image and xrender backend produces different output than the glitz
> backend, e.g:
>
> // fill background with white color
> cairo_set_rgb_color (cr, 1.0, 1.0, 1.0);
> cairo_set_alpha (cr, 1.0);
> cairo_set_operator (cr, CAIRO_OPERATOR_SRC);
> cairo_rectangle (cr, 0, 0, w, h);
> cairo_fill (cr);
>
> // now paint my path
> cairo_set_operator (cr, CAIRO_OPERATOR_SRC);
> cairo_set_alpha (cr, 1.0);
> cairo_set_rgb_color (cr, 1.0, 0.0, 1.0);
> cairo_move_to (cr, 100, 0);
> cairo_line_to (cr, 200, 100);
> cairo_line_to (cr, 100, 200);
> cairo_line_to (cr, 0, 100);
> cairo_close_path(cr);
> cairo_fill(cr);
>
> This will fill a path in a purple color and lets the background shine
> through for the glitz backend. For the image and xrender backend the
> bounding box of the path is filled black. I'd say glitz interpretation
> of "no input" is correct, but you'll certainly know the Porter and Duff
> rules better than I do.
What actually *should* have happened is for the entire surface to be
filled with black except for the path. The appearance of the bounding
box is a bug. Though that probably wasn't what you were looking for.
See the recent discussion on "non-clipping clips" for a lot more detail
on problems with operators like SRC.
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/20050109/7b7e4515/attachment.pgp
More information about the cairo
mailing list