[cairo] Re: group/pattern API

Vladimir Vukicevic vladimirv at gmail.com
Mon Nov 28 11:12:16 PST 2005


Here's a first pass at this patch.  This adds the following public API:

cairo_public void
cairo_push_group (cairo_t *cr);

cairo_public void
cairo_pop_group (cairo_t *cr);

cairo_public void
cairo_pop_group_with_alpha (cairo_t *cr, double alpha);

cairo_public cairo_t *
cairo_pattern_begin (cairo_surface_t *ref_surf,
		     cairo_content_t  content_type,
		     int              width,
		     int              height);

cairo_public cairo_pattern_t *
cairo_pattern_end (cairo_t *pattern_cr);

There are also two small tests for both the push/pop group API and the
pattern_begin API.

The group API always creates a temporary surface the size of the
current clip's extents, and the width/height have to be explicitly
specified for cairo_pattern_begin.  I'm not sure whether
auto-extending surfaces would really be all that useful -- I think
that in most cases you know the size of the area you want to draw
into, and can clip() to the relevant region before calling push_group.

There are still some questions here, the main one is whether my usage
of the device offset is correct (whether the coordinate spaces are the
same as that returned by the _extents function).  Please let me know
what you think.

    - Vladimir
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cairo-groups-patterns.patch
Type: application/octet-stream
Size: 0 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/cairo/attachments/20051128/7079f5f2/cairo-groups-patterns.obj


More information about the cairo mailing list