[Lazarus] Fast drawing to canvas

Felipe Monteiro de Carvalho felipemonteiro.carvalho at gmail.com
Fri Feb 10 11:32:32 CET 2012


On Fri, Feb 10, 2012 at 11:13 AM, Sven Barth
<pascaldragon at googlemail.com> wrote:
> But why does the canvas of a TGraphic descendant (TBitmap,
> TPortableNetworkGraphic, etc.) need to store the data on the X-Server?
> Wouldn't it be enough to transport that only when it's displayed?

But then it would not a Gtk native bitmap and would not be a native X
image. Remember, existing widgetsets try to be as native as possible
and TBitmap has a Handle property to access the native Handle.

In LCL-CustomDrawn I went on the opposite direction. There
TCanvas.Pixels[] is just a front end to TLazIntfImage.Colors[] so
Pixels[] is fast and executes no X11 operations. On each OnPaint event
only 1 single X11 operation is executed: upload the final form image.
But of course it still has a huge way to go before getting usable in
desktop applications.

-- 
Felipe Monteiro de Carvalho




More information about the Lazarus mailing list