On Tue, 28 Oct 2025 15:55:09 GMT, Andy Goryachev <[email protected]> wrote:

> > That fulfills the main goal (correct rendering, perhaps after a number of 
> > pulses, leading to flickering), but it makes the second goal 
> > (top-efficiency) really hard.
> 
> I might be way off, but I wanted to ask you this:
> 
> How many pulses are needed to finish the layout? If we ignore for a second 
> some pathological cases when the layout process never ends causing continuous 
> flicker, is there a safe upper limit?
> 
> What I am getting at is - what if we run more than one layout pass 
> (`Scene::doLayoutPass`) per pulse? In other words, if the layout is still 
> dirty, we keep doing the layout until it's settled, without the associated 
> re-rendering and flicker, and if it's still dirty after N cycles we print a 
> warning (if said warning is enabled)?
> 
> What do you think?

It's not a bad idea to just run layout again if after running layout the root 
is still dirty.  That would kill the flicker, but would just reinforce bad 
patterns.  Also, the CPU cost is still there (ie. if you resize a Window with 
say a large complex tableview, then it will still have to do a whole lot of 
calculations twice, while the 2nd run basically changes nothing).

-------------

PR Comment: https://git.openjdk.org/jfx/pull/1945#issuecomment-3457492519

Reply via email to