[cairo] Hit detect surface?
cworth at cworth.org
Fri Mar 3 14:51:54 PST 2006
On Tue, 28 Feb 2006 14:07:12 -0800, Bill Spitzak wrote:
> 4. All attempts to modify the one pixel do the callback function, giving
> it the source color, the mask, and the op used, and possibly other
If we were going to do that, then we might as well specify the drawing
operation being performed, (paint, mask, stroke, fill, or
show_glyphs). And then we might as well specify the operation-specific
parameters, (path, fill rules, stroke parameters, etc.).
And at that point, we'd have support for new backends to be
implemented outside of cairo.
This is something that I've always been willing to consider adding,
but I wanted to wait until we felt very good about the backend
interface. Delaying this has proven valuable as we have basically two
sets of backend interfaces in cairo right now, (the old one with lots
of junk, and the new one with little more than paint, mask, stroke,
fill, and show_glyphs).
The other prerequisite I've put before exporting a backend interface
is that we must have good printing support, (that is, cairo 1.2 at
least must be out the door). If we've got a backend interface that can
handle X, Win32, OpenGL, as well as PS and PDF quite well, then I
think we'll be able to feel confident about exporting it.
Then, with an exported backend interface, the only other thing that
this proposed new "hit detect" surface would require is aggressive
culling of drawing operations that are outside the current clip
region. (This is so that the hit detect surface could just set a clip
and "know" it wouldn't see anything outside its region of interest.)
At that point, it would be easy to implement this hit detect surface,
as well as any number of other kinds of ways to analyze rendering code
without having to instrument that rendering code at all. And that
would be a powerful thing to be able to do.
> I'm not sure when exactly it should do the callback function.
This is a tricky kind of question to answer. The approach I've
outlined above would allow the application to answer it in any way
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 189 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/cairo/attachments/20060303/bce7d3e9/attachment.pgp
More information about the cairo