[cairo] Re: drawlist type functionality?
Mike Emmel
mike.emmel at gmail.com
Tue Apr 5 06:23:49 PDT 2005
On Apr 5, 2005 3:52 AM, Jost Boekemeier <jost2345 at yahoo.de> wrote:
> > # create a "bowtie" context
> > ctx = cairo.Context()
> > drawlist = cairo.Drawlist()
> > ctx.set_target_drawlist(drawlist)
> > ctx.move_to(0, 0)
> > ctx.line_to(1, 1)
> > ctx.line_to(1, 0)
> > ctx.line_to(0, 1)
> > ctx.close_path()
>
> Why don't you simply use a surface and then compose it
> onto the target drawable?
>
You can quickly use gobs of memory with that approach.
One advanatage of a asychronous api is you can deal with lists of
drawing commands at a higher level which gives you the chance to apply
"meta" state or high level composition commands to a group of drawing
primitives.
The drawing primitives can be decomposed into optimized drawlists that
are fast yet use significanltly less memory then maintaing buffers.
It gives you a chance to edit and existing list to generate a similar
list without going through the whole decompsition process agian i.e
you have the concept of a 2d scene.
Generally surfaces are scrollable and extend well past the size of the
viewport the buffer approach does not handle this case well.
> BTW: Comparing GL with Cairo is like comparing apples
> with oranges ... Except for point/path animations the
> animations work pretty well on a level above cairo.
The comparision was one at a high level since were talking about
drawLists and second GL had 2D primitives and next the discussion was
specific to the glitz backend which would want to control a lot more
of the drawing code to leverage the GL drawlists than most of the
other backends. This makes it the key one to get right.
> But at some point in the future one probably has to
> pass additional information to the backends.
>
>
> Jost
>
>
> ___________________________________________________________
> Gesendet von Yahoo! Mail - Jetzt mit 250MB Speicher kostenlos - Hier anmelden: http://mail.yahoo.de
>
More information about the cairo
mailing list