[cairo] Path as a resource
zengyongjoy at gmail.com
Thu Nov 9 21:00:31 PST 2006
You mean set path as stroke for annother path ?
This is what I think now.
but I don't know how to implement that.
2006/11/10, Mike Emmel <mike.emmel at gmail.com>:
> On 11/9/06, Behdad Esfahbod <behdad at behdad.org> wrote:
> > On Thu, 2006-11-09 at 12:49 -0500, Mike Emmel wrote:
> > > I've been thinking about the concept of having paths as resource like
> > > patterns or fonts.
> > What is the problem you are trying to solve?
> The basic problem is that I need to create and manipulate paths before
> I know the
> destination surface.
> Cairo does not really support paths outside of a cairo_t structure.
> And there is no way to transfer a path between cairo_t's except to
> export it to a floating point format.
> If you build paths up outside cairo_t your forced into a floating
> point format. If you don't have a fpu this means redeveloping all of
> the fixed point logic.
> Most graphics systems treat paths as first class objects cairo does not.
> This means paths are created and manipulated before the destination
> surface is known.
> Cairo does not support the concept.
> SVG postscript etc all support paths as standalone objects.
> For example
> To me the problem the developer is facing in this example is the lack
> of ability to save
> path information in a optimized format. If he had a handle to the
> internal path structure it would help.
> Right now my approach is to create a cairo_t with a one pixel surface
> to serve as a proxy for a path. The problem is that to transfer this
> path to the real surface for rendering requires that I copy out the
> path in floating point format then reapply it to the destination. Also
> of course I can't freadily flatten the path or perform other
> operations to optimize drawing of known paths.
> To flatten a path now requires.
> p = cairo_copy_path_flat()
> So even if you have the right cairo_t you have to do a copy just to
> flatten a path.
> By having paths only exist in a cairo_t your tying paths to the
> destination I don't believe this tie is required.
> > --
> > behdad
> > http://behdad.org/
> > "Commandment Three says Do Not Kill, Amendment Two says Blood Will
> > -- Dan Bern, "New American Language"
> cairo mailing list
> cairo at cairographics.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the cairo