[lazarus] CVS Updates

Marc Weustink marc at dommelstein.net
Fri Oct 3 20:17:33 EDT 2003


At 02:03 4-10-2003, Andrew Johnson wrote:
>On Fri, 2003-10-03 at 14:43, Micha Nelissen wrote:
> > Can you explain this a little more detailed? What is the cause of the
> > flickering exactly? The win32 interface also has this problem.
>
>I am not sure its quite the same issue though it might be.. basically
>SynEdit calls ExtTextOut on each block of text, for instance on a line
>with
>
>Procedure MyFunction(someclass : TBlah);
>
>would call ExtTextOut something like 8 times. Now since SynEdit supports
>using a different background colour for each block of text, then this
>means ExtTextOut will get called with ETO_OPAQUE.
>
>This means that most of the time a block of text calls ExtTextOut, that
>block of text will get filled with the current brush before drawing the
>text. This means the text essentially disapears from the screen and then
>reapears. Since there are so many blocks this results in constant
>flashing all over the place every time something is invalidated. So in
>this case there are 8 potential flashes any time invalidate/repaint etc.
>What I have done in the GTK interface, is if ETO_OPAQUE is passed, I
>create a buffer pixmap of the size of the passed rectangle, and perform
>actual filling and drawing of text on that offset, then draw pixmap,
>meaning the block is drawn in one step to the screen.
>
>I don't know how easily this could be done in win32 since you would have
>to create a buffer hdc and hbitmap, calculate relative offsets, based on
>whether it was buffering or not, then draw to it, which also means
>possibly a fair bit more amount of memory needed etc.

You won't need this on win32, since it supports ExtTextOut natively :-)
So it draws the text *with* background already.

Be aware that most win32 based interface calls don't need much translation.
Especially for synedit, since in it's origin it was pure win32 based.

So don't try to mimic draw functs on win32 which are win32 native.

Marc







More information about the Lazarus mailing list