Opened 4 years ago

Last modified 16 months ago

#6941 new defect

GUI: Performance issues in higher resolutions

Reported by: SF/rootfather Owned by:
Priority: normal Component: GUI
Keywords: Cc: raziel_nosgoth@…


I noticed some performance issues within the GUI when running ScummVM in higher resolution fullscreen mode (e.g. 1680x1050).

When running ScummVM in this high resolution and in fullscreen mode, the GUI stops responding for a few seconds each time I click on a button in the GUI. The mouse cursor is also quite laggy in all resolutions and even in windowed mode. The problem only occurs using the modern theme, not when using the classic built-in theme.

The problem occurs on my (weak) laptop running Windows 7, 8(.1) and Windows 10 as well as on my quite powerful Intel Quad-Core with nVidia 9600GT graphics card. Performance in the games itself is great, so no general performance issue. Affected versions are at least 1.6.0, 1.7.0 and current git versions.

For me as a non-developer, it seems that there's some optimization potential for the GUI renderer? There's also no difference whether I select the anti-aliased gui renderer or the standard one.

Best regards

Ticket imported from: bugs/6941.

Change History (11)

comment:1 Changed 4 years ago by Kirben

Try switching SDL to the DirectX video driver:
Add the environment variable SDL_VIDEODRIVER, with a value of "directx".

comment:2 Changed 4 years ago by SF/rootfather

Hi kirben, unfortunately, setting the environment variable had no effect on the performance issues within the GUI.

comment:3 Changed 4 years ago by SF/rootfather

Hi kirben, just for clarification: Do you mean setting the environment variable in Windows or somewhere in the code? Setting the environment variable in Windows has no positive effect to the issue.

I also wonder why performance in the old, built-in GUI and within games is perfectly fine, even on my weak AMD E450 powered laptop. The modern GUI has quite a lot of lag when running in OpenGL mode and on the screen's native resolution.

comment:4 Changed 4 years ago by Kirben

That change will effect all SDL 1.x based programs, if you set the enviromental variable via the Enviromnetal Variables section on the Advanced tab of the System control panel in Windows. SDL 1.x defaults to windib by default, which can be slower, since Windows Vista onwards lacks GDI hardware acceleration.

If you are using OpenGL, then performance depends completely on your display drivers.

comment:5 Changed 4 years ago by raziel-

Same performance problems on AmigaOS4.
It doesn't matter if i choose normal or OpenGL.

comment:6 Changed 4 years ago by lordhoto

Summary: GUI: Performance issues in higher resolutions [Win32]GUI: Performance issues in higher resolutions

comment:7 Changed 4 years ago by lordhoto

Yes, this should be a performance issue in our GUI (renderer). It's not the fastest. I have a Core 2 Q9550, but the GUI was never really unresponsive for more than a second or so.

comment:8 Changed 4 years ago by SF/rootfather

I'm currently kind of tracking down the issue, but it's not that easy with my limited knowledge of how the GUI renderer exactly works.

Because in-game performance is just great on both of my machines, I focused my search on gui-manager.cpp.

I tracked down the rather laggy mouse cursor to 2 commented lines in gui-manager.cpp:
Have a look at lines 301 and 302:

// _theme->updateScreen();
// _system->updateScreen();

When I remove the comment marks and recompile, the mouse cursor is perfectly smooth. But I don't think thats really a fix, because someone must have commented out those lines on purpose, right? The GUI becomes as unresposive as before as soon as I click a button or a tab in a dialog.

The problem does not occur when using the old built in theme, so maybe something in the theme engine is the culprit?

Best regards

comment:9 Changed 4 years ago by raziel-

Maybe it's because of the images?
Maybe the loading isn't optimized/buffered/whatever?

The classic theme doesn't use any images, not even for the logo and it's lightning fast.

comment:10 Changed 3 years ago by sev-

Component: GUI

comment:11 Changed 16 months ago by raziel-

Cc: raziel_nosgoth@… added
Note: See TracTickets for help on using tickets.