Re: best approach to fast display of images?

On Wed, 8 Dec 2004 11:22:54 +0000, John Cupitt <jcupitt gmail com> wrote:
Have you tried running gtk+-2.4.x/tests/testrgb? This benchmarks the
gdk_draw_gray_image() function:

This is the fastest way to draw a buffer of pixels to the screen in
plain gdk. On my very modest machine I get about 30 Mpixels/sec, fast
enough to draw a 1,000 by 1,000 pixel image at 30 fps.

    All of these are good solutions, you just want to choose the solution that
suits your app most, the slow part about drawing a GdkImage is uploading
the image to the X server.

    Just to point out another possible solution; the approach that I take for 
animations is to do any scaling and compositing in some initialization or 
checkpoint code and render all my frames to GdkPixmaps before displaying them.

I'm sure that the GdkPixmap --> GdkWindow transfer is hands down the fastest
excluding OpenGL/DRI (because you are copying server memory to server memory),
but it takes alot more resources in memory to store pre-rendered frames, 
another downside is that you have to actualy create the pixmaps, impying a 
server upload which takes time that you might not have.


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