[Lazarus] Fast drawing to canvas

Hans-Peter Diettrich DrDiettrich1 at aol.com
Thu Feb 9 12:31:50 CET 2012


Graeme Geldenhuys schrieb:

> A quick test on my system, using my own "animation" images.
> 
>   * using the fpGUI toolkit
>   * Each BMP image is 140kb (fpGUI doesn't have PNG support yet)
>   * each image is loaded one-by-one. No images are cached.
>   * just before a new image is loaded, the old image is freed.
>   * Partition has the ReiserFS filesystem under Linux 64-bit
>   * hard drive is an avg Seagate 250GB sata drive.
> 
> Initial framerate was 1500 fps.  I couldn't actually see any animation
> at that speed, and had to add writeln(i) statements to make sure I am
> loading all images - which it did. :-)

This may be the problem: you should force the display of every loaded 
image. Only then it's guaranteed that all conversions are performed, 
required to show the images on screen.


> I'll wait for your sample images before I take another look. But from
> my initial testing, there is something seriously screwy in your case
> to get only 11fps. I can't imagine loading a 40kb PNG vs a 140kb BMP
> can make up that a huge difference in framerate.

Hardware support may be a bottleneck. Can you disable graphics hardware 
acceleration on your system?

Many graphics adapters require proprietary drivers for hardware 
acceleration, which are not installed by default on Linux systems.

DoDi





More information about the Lazarus mailing list