[Date Prev][Date Next][Thread Prev][Thread Next][Thread Index]

Re: [XaraXtreme-dev] Cairo Port



On Tue, 08 May 2007 18:37:43 +0200, Jonas Diemer wrote:
> Luke Hart schrieb:
> > I've attached a couple of source files from a performance testing
> > application I wrote to compare CDraw and Cairo (amongst other vector
> > libraries).

Oh, cool. I'd always wanted to see the code behind those performance
charts, (the charts were always pretty meaningless to me without some
more details about what was actually being tested).

Luke, can you tell me if the work being performed in
CCairoPerf::GetBitmap was part of what was measured in those
benchmarks? If so, the gdk_pixbuf_new_from_data and gdk_draw_pixbuf
calls are definitely contributing a big slowdown to the cairo numbers,
(a well-written program using cairo to draw would never do that stuff,
for example).

> > The calls I used to setup the bitmap surface are cairo_create and
> > cairo_set_target_image.
>
> Hmm. In my cairo version, cairo_create wants a cairo_surface_t as an
> argument. Also, cairo_set_target_image is depricated in my cairo version.
>
> It looks like the current Cairo does not want the user to exchange the
> target surface of a cairo_t context.

Right. It's clear that Luke's code was targeting a *very* old snapshot
of cairo before the first API-stable 1.0 release.

But this should be quite easy to change. Instead of
cairo_create;cairo_set_target_image like Luke's code has, you would
instead use cairo_image_surface_create_for_data;cairo_create.

As you already noticed, this does mean that you can't create the
cairo_t until after you have the data to start rendering to.

> Actually, I am a bit confused now about the rendering process. What are
> the following two functions exactly used for and how do they relate?
>
> GDraw_GetChangedBBox
> GDraw_SetDIBitmap

Nothing I can help with. I hope someone with Xara expertise can help
here [*].

-Carl

[*] Perhaps it's not germane to the current situation, but I can't
help but point out that CDraw source code would help a _lot_ for
someone like Jonas to be able to figure stuff like this out on his
own. This "documentation in code" aspect of source is a salient
feature of source. And the benefit in this situation would be in
contrast to the argument that CDraw is unmaintainable, so nobody would
benefit from its source code anyway.

Attachment: pgpIJJuHN7ovi.pgp
Description: PGP signature