[cairo] API request: obtain the trapezoids that are outside of
cworth at east.isi.edu
Tue Aug 17 09:10:28 PDT 2004
On Tue, 17 Aug 2004 17:33:28 +0200, Jost Boekemeier wrote:
> On Mon, 2004-08-16 at 21:30, Carl Worth wrote:
> > So as you can see, there are probably some significant savings to be had
> > by adding some geometry culling to cairo.
> I think the best place to hook the code into is where the trapezoids are
> created. At this place we have all information, don't we?
Yes, and we can throw away trapezoids at that point. We could even do
stuff earlier if it makes sense, (ie. discarding sub-paths that are
entirely off the surface, etc.). We'll let the profiler be the guide.
> BTW (I don't have the code at the moment), is the clip surface an
> identifyable entity on the server-side which takes part in the
> composition process?
Yes, the cairo implementation currently has a surface to represent the
region enclosed by the current clip path.
> I assume that this is the case, so that there's a
> difference between the "parts i don't want to see" and the "parts that i
> don't want to have".
I don't understand the distinction here. Initially, the clip path is
(conceptually) the same as the boundary of the target surface. The user
can restrict the clip region to make cairo draw less, ("parts that I
don't want to see"). But I don't know what you mean by "parts that I
don't want to have". Cairo itself never "has" anything aside from the
current path and the image resulting from previous drawing operations,
(and multiples of those as may have been saved on cairo's stack of
> Essentially I need only the information if the stroke/fill'ed path has
> fit onto the surface or not.
It would certainly be easier to provide this information as opposed to a
list of trapezoids that were clipped.
But is it important to add an interface to cairo to provide this? You
gave cairo the bounds of the target surface and all of the data to
draw. So you already have all the necessary information you need to
determine if it fit fairly easily, no?
But perhaps I haven't yet understood exactly what it is you're trying to
More information about the cairo