[Cairo] Cairo on older X servers, (eg. with Render version 0.2)
cworth at east.isi.edu
Wed Oct 15 09:51:12 PDT 2003
Thanks for your careful feedback on these API suggestions. Some
On Oct 10, Bill Spitzak wrote:
> > void
> > cairo_erase (cairo_t *cr);
> I think it would be better to have all drawing operations be restricted to
> the clip region.
That's a good point. As per Keith's suggestion and my response, I'm
going to add an implicit erase at cairo_set_target_surface and delay
exposing any cairo_erase function for now.
> > void
> > cairo_flush (cairo_t *cr);
> Probably a good idea. This call can also be used to print a page in a cairo
> printer interface.
Actually, the "print a page" function may be slightly different. For
example, PostScript provides a showpage operator for which the
semantics would be equivalent to cairo_flush, "print a page", *and*
Note that PostScript also has a copypage operator that would be the
same as cairo_flush and "print a page" without the implicit erase.
> > void
> > cairo_mark_dirty (cairo_t *cr);
> It is possible this should be in the device-specific interface.
I like Keith's suggestion to make it surface-specific as
cairo_surface_mark_dirty. But yes, we may want to restrict it even
more to specific backends.
> First, you may want to pass device-specific arguments, for instance a
> rectangle or X region would be very useful for reducing the amount of data
> read from the server.
> Second, you may want to avoid having to implement this for every device. I'm
> pretty certain any OS will provide some other way than cairo to draw on
> things and thus in theory this should work for them. But it would be a real
> pain to, for instance, read back the current image from a Postscript printer.
> If you say "this only works for X windows", why not put it in the X-specific
The current plan is that the PostScript backend will always render to
a giant image. We have to do this in order to support drawing
operations with (alpha != 1) since PostScript doesn't have any support
for transparent rendering.
> Thus it may be a good idea to discourage use of this.
I'd be glad to tell users that they should do all drawing through
Cairo and not try to mix things. After all, why would you *want* to
try drawing something any other way? :-)
Miguel de Icaza did describe one rather involved, but real situation
in his work which it will be unavoidable to mix Cairo and non-Cairo
drawing to the same surface.
More information about the cairo