Libui: Master issue for Windows redraw performance woes

Created on 23 Mar 2018  路  11Comments  路  Source: andlabs/libui

Currently libui on Windows fakes transparency by drawing the parent control onto each child control as a background each time, resulting in awful performance. Not doing this with the current implementation of uiControl and control hierarchies results in controls indiscriminately having a default background color. I have two options: flatten the control hierarchy or split the work between WM_ERASEBKGND and WM_CTLCOLOR*. @lxn figured a lot of this out.

This issue will combine all existing issues on the matter.

This issue includes and continues the discussion of andlabs/ui#184

Most helpful comment

So now - after 0.4 - most annoying is this issue.

Sometimes window opening takes 5 and more seconds, as in StapleButter/melonDS#220

All 11 comments

Huh, that was fewer issues than I thought there were...

I tried libui a year ago on win10 64bit and had flickering issues. Seems to still be the case.

flicker

Yes, that is what we are trying to resolve here. The question is how, and then I need to actually implement the fixes. lxn had a suggestion in the issue I linked in the first post, but I have yet to try it.

So now - after 0.4 - most annoying is this issue.

Sometimes window opening takes 5 and more seconds, as in StapleButter/melonDS#220

Yes, and addressing this issue is what's in store for Alpha 5's changes. I still need to figure out what that simpler solution lxn used was first, but there are several other advantages to just flattening the control hierarchy.

If it should be almost fully rewritten anyway - maybe not invent a wheel and use Yoga as layout engine?
Is it possible?

@msink coming from a C# perspective, the C# bindings for yoga are very hacky, requiring (at least) 2 extra libraries on top of the actual Yoga library, plus a whole separate framework (Xamarin) for it to be used on macOS and Linux platforms. I think it would be more or a hinder than a help for alot of the bindings, though I can't speak for the others.

Well - I mean not adding it as dependency, but include in libui as library.
Or at least implement similar interface and borrow some code.
Because there are WYSIWYG editors for it - would be great to reuse existing tools and infrastructure.

Well - I mean not adding it as dependency, but include in libui as library.

My apologies. I get your point now :)

Or at least implement similar interface and borrow some code.
Because there are WYSIWYG editors for it - would be great to reuse existing tools and infrastructure.

I agree that it would be great to reuse existing tools and code to accomplish this.

This should get a very high priority.
I noticed this again during development in the tester. Moving (or even worse resizing) the window with page 1 open gives me the feeling that my PC is potato.

I didn't realize performance could be an issue with a toolkit using native widgets. Best of luck with the solution! I see WM_PRINTCLIENT was already tried and @lxn seems confident that a more performant solution can be implemented.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

zevv picture zevv  路  9Comments

ctoth picture ctoth  路  9Comments

flying-sheep picture flying-sheep  路  16Comments

parro-it picture parro-it  路  6Comments

andlabs picture andlabs  路  7Comments