[cairo] [Fwd: Re: performance difference between image and win32 surface?]

Danilo Gulamhussene danilo at impara.de
Fri Oct 19 02:38:10 PDT 2007


Oh, I accidentally did not responded to all...

-------- Original-Nachricht --------
Betreff: 	Re: [cairo] performance difference between image and win32 
surface?
Datum: 	Thu, 18 Oct 2007 18:22:47 +0200
Von: 	Danilo Gulamhussene <danilo at impara.de>
An: 	Owen Taylor <otaylor at redhat.com>
Referenzen: 	<471774AD.9000707 at impara.de> 
<1192721062.7271.5.camel at localhost.localdomain>



Owen Taylor schrieb:
> On Thu, 2007-10-18 at 16:58 +0200, Danilo Gulamhussene wrote:
>   
>> Hi,
>>
>> i have experimented a little with Cairo, cause we plan to use it for 
>> rendering in a larger project.
>> Some performance tests stated, that using a Win32 Surface is about 5 
>> times slower than using an Image Surface on my system (Windows XP).
>> (I wrote the small tests on my own, cause I did not manage yet to build 
>> the performance tests included in Cairo.)
>>
>> Could these results be correct, or am I doing something wrong?
>> When yes, what is the reason for this performance difference? I would 
>> find it much more straight forward to render directly into a Win32 
>> Surface instead of rendering in an Image Surface and then copying it 
>> into the window.
>>     
>
> Many sorts of rendering in cairo needs to be done in software instead of
> through the Windows API. So, to operate on a surface where
> the pixels aren't directly accessible (a Window or a DDB), cairo needs
> to copy data from the surface, operate it, and copy it back. This 
> will be very slow if you are making lots of small operations.
>
> You may find cairo_push_group() to be a convenient way to get good
> performance without manually having to manipulate extra surfaces.
>
> - Owen
>
>   
Thank you very much, for the advice!
I now reach a performance in a window similar to using an image surface.

Danilo



-- 
Impara GmbH
Firmensitz: Listemannstr. 10, 39104 Magdeburg
Registergericht: Amtsgericht Magdeburg, HRB 13839
Geschäftsführer: Michael Rüger 



More information about the cairo mailing list