[Lazarus] Unneeded Paint calls from LCL

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

[Lazarus] Unneeded Paint calls from LCL

Free Pascal - Lazarus mailing list
ATSynEdit has such debug define
//{$define debug_show_fps}
I enabled it to see why editor shows 20-30ms (Form1.OnShow with editor).

a) editor shows 5 (repaint counter) on show. i put breakpoint in
TATSynEdit.DoPaintEx and saw that unneeded paints were from DoOnResize()
before calling Paint(). ok, i added flag FPaintStarted and filtered them.
b) editor still shows 3 (repaint counter) on show. breakpoint shows that
Paint is called 3 times by LCL. I cannot filter these calls at all. Can
you reduce these calls?

--
Regards,
Alexey

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Unneeded Paint calls from LCL

Free Pascal - Lazarus mailing list
Linux gtk2.

> reduce these calls?

--
Regards,
Alexey

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Unneeded Paint calls from LCL

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list
Details:
Linux gtk2: LCL calls Paint 5 times for ATSynEdit on FormCreate/FormShow:

1- DoOnResize - i filtered it out
2- DoOnResize - i filtered it out
3- Paint - it's ok
4- Paint again - i cannot filter it out
5- Paint again

Win32: LCL calls Paint 3 times:

1- Paint - it's ok
2- DoOnResize - i cannot filter it out
3- DoOnResize again

Can you optimize it to call Paint once, and DoOnResize BEFORE Paint?

Alexey T.


--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Unneeded Paint calls from LCL

Free Pascal - Lazarus mailing list
AlexeyT via lazarus wrote:

> Details:
> Linux gtk2: LCL calls Paint 5 times for ATSynEdit on FormCreate/FormShow:
>
> 1- DoOnResize - i filtered it out
> 2- DoOnResize - i filtered it out
> 3- Paint - it's ok
> 4- Paint again - i cannot filter it out
> 5- Paint again
>
> Win32: LCL calls Paint 3 times:
>
> 1- Paint - it's ok
> 2- DoOnResize - i cannot filter it out
> 3- DoOnResize again
>
> Can you optimize it to call Paint once, and DoOnResize BEFORE Paint?

IMO paint should be never called directly. When resizing, invalidate
should be called (so one pain message is issued after the resize)

Marc
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Unneeded Paint calls from LCL

Free Pascal - Lazarus mailing list
On Mon, Jan 13, 2020 at 10:51 AM Marc Weustink via lazarus
<[hidden email]> wrote:
> IMO paint should be never called directly. When resizing, invalidate
> should be called (so one pain message is issued after the resize)

I understood that Paint gets called by LCL excessively when a form is
created or shown. Yes, I guess it should be optimized.
Debugging the events flowing back and forth is challenging. Placing
DebugLn() lines into relevant event handlers is the best way. And yes,
it partly happens in widgetset code.

Juha
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Unneeded Paint calls from LCL

Free Pascal - Lazarus mailing list
On 15/01/2020 12:02, Juha Manninen via lazarus wrote:
> I understood that Paint gets called by LCL excessively when a form is
> created or shown. Yes, I guess it should be optimized.
> Debugging the events flowing back and forth is challenging. Placing
> DebugLn() lines into relevant event handlers is the best way. And yes,
> it partly happens in widgetset code.
>

It should be possible to use "none breaking" breakpoints (without
causing extra paint or focus events) and then go through the debug
history to see stackframes.
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Unneeded Paint calls from LCL

Free Pascal - Lazarus mailing list
 Seems I posted too pessimistic analysis. Too many repaints are caused by atsynedit, and with an empty control (which only has overridden Paint to show counter) it’s not so bad— counter is 1, only on few WS it’s 2. Sorry

Alexey
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus