slint-ui / slint

Slint is a declarative GUI toolkit to build native user interfaces for Rust, C++, or JavaScript apps.
https://slint.dev
Other
17.54k stars 600 forks source link

FemtoVG / Windows: Window content lag when resizing window #5563

Open teknalb opened 4 months ago

teknalb commented 4 months ago

Slint v1.6.0 Rust v1.79.0

https://github.com/slint-ui/slint/assets/174643755/3efcbefb-5444-4e25-93ba-1ba425a65b3b

tronical commented 4 months ago

I can't quite reproduce this, but I guess the way the GL driver handles surface resizing depends also on the driver here.

I'm curious, is this the same if you do a release build?

teknalb commented 4 months ago

Yes, exactly the same on --release build

teknalb commented 4 months ago

Just wild guess, maybe this reference from iced is related to this issue: https://github.com/iced-rs/iced/issues/1203

ogoffart commented 2 months ago

is the problem hapenning with both the femtovg and skia renderer?

tronical commented 2 months ago

If this also happens with renderer-skia as well as renderer-skia-opengl, then perhaps this is similar to #5791.

teknalb commented 2 months ago

Tests using Slint v1.7.2

renderer-femtovg ------> lags like shown in video renderer-software ------> no lag renderer-skia-opengl --> no lag renderer-skia -----------> weird subtle scaling issue when resizing renderer-vulkan --------> (panic) windows.rs:32:13: Unable to locate LLVM installation

tronical commented 2 months ago

Thank you for testing. Interesting that this is specific to FemtoVG then - hard to image why... unless this is "simply" a performance issue. When resizing the window with femtovg, do you see also a spike in CPU usage compared to Skia?

teknalb commented 2 months ago

I did a test here: https://uploadnow.io/f/Gc8790p Looks like femtovg uses a bit more CPU than other ones

tronical commented 2 months ago

True, that's a little higher, but not by that much. I looked at the code I don't failing to find a good explanation here. When resizing with FemtoVG and with Skia OpenGL, we call exactly the same code to resize the surface.

Enyium commented 2 months ago

@teknalb:

renderer-skia -----------> weird subtle scaling issue when resizing

Maybe like in #5765?

lmaxyz commented 2 months ago

@teknalb Is it still reproduces if you add some real-time animation (for example permanent boxes background changing)?

I ran into strange things, that have led me maybe there is something like slint's eco mode, and window resizing not captured as some interaction with window content, so call for screen update is not invoked in time. For example, in some environment "real-time" animation has lags if you don't interact with window content, but if you do flicking or scrolling lags disappears.