[Lazarus] Optimize DBGrid speed

Hans-Peter Diettrich DrDiettrich1 at aol.com
Wed Jan 8 14:35:08 CET 2014


Petr Kristan schrieb:

> In the beginning of Grid paint is Canvas.GetClipRect called to obtain area
> which wee must redraw. This function directly calls WidgetSet.GetClipBox.
> I find out difference betwen Win32 and gtk2 bahaviour of this func.
> 
> In gtk2 TGtk2WidgetSet.GetClipBox returns previously Invalidated area
> (through DC.PaintRectangle = PS.rcPaint retrieved in BeginPaint)
> 
> But in win32 directly calls Windows.GetClipBox, but this func returns
> whole grid area. Do not takes account on invalidated area retrieved in
> BeginPaint.

It may be a bug in the Win32 widgetset, invalidating the entire control 
area instead of only the affected cell, *or* some special handling of 
invalidated areas by Windows. I remember that Windows used to extend the 
UpdateRect to include *all* invalidated parts of the DC. This can lead 
to a big update area, when a single bit at the top left and at the 
bottom right of the DC was invalidated. This may have changed in the 
meantime, though.

DoDi





More information about the Lazarus mailing list