[cairo] A hidden offset for the Xlib backend

Owen Taylor otaylor at redhat.com
Sat Mar 12 06:22:31 PST 2005


On Sat, 2005-03-12 at 13:36 +0100, Jost Boekemeier wrote:
> On Sat, 2005-03-12 at 02:21, Peter Dennis Bartok wrote:
> > We could use the device offset for Mono, too, [...]
> > because we have to expose the matrix through System.Drawing, and the 
> 
> This is a little bit different from gdk. If I understand it correctly,
> you hide the cairo api through system.drawing, so you have (or could
> have) complete control.
> 
> Imagine a library which accepts surfaces and then draws to them.  What
> should the library do if the user has changed the offset since the last
> time the library had access to it?  

Why would that matter? The only case I could imagine is if the library
is mixing Cairo and xlib drawing to a surface. But we have no way
of extracting the Xlib drawable from a cairo_surface_t.

> Even worse: The library already maintains an offset, outside of cairo.

That doesn't seem to change anything

> Or imagine a surface cache (glyphs for example); what should it do if
> one surface suddenly has an offset?

If someone pulls a surface out of shared glyph cache and sets an
offset on it, they get what they deserve, just as if they drew to it.
(Not that the Xlib device offset affects using the surface as a source)

> No, I think the right answer is to create a gdk surface. Its constructor
> could take the width, height and x/y offset as arguments.

We don't expose the backend interface, and at the current time it isn't
even *close* to API stable.

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/20050312/eadf9dbb/attachment.pgp


More information about the cairo mailing list