[cairo] Hit detect surface?

Bill Spitzak spitzak at d2.com
Mon Mar 6 14:20:19 PST 2006


Carl Worth wrote:

 > 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.

You are absolutely correct. My hit-detect-surface was quickly 
approaching a complete interface for the backend. Making the backend 
available, with perhaps a demo hit-detect backend, is the way to go.

> 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 can be done by the backend, though I would certainly not complain 
if Cairo did not call the backend with anything it is certain is not 
going to affect anything, such as when the bounding box of the drawing 
does not intersect the surface's bounding box. "agressive culling" in my 
proposal would be done by acting like a one-pixel surface and seeing 
whether the drawing tries to modify that pixel.


More information about the cairo mailing list