SDL: Avoiding pathological screen updates
|Reported by:||eriktorbjorn||Owned by:|
Current ScummVM SVN
This is more of a request for comments than a final patch
Currently, the SDL backend isn't particularly smart about screen updates. It will redraw all dirty rectangles (unless there are too many of them, in which case it forces a fullscreen redraw). Ideally, it might be nice if it could eliminate overlapping updates, but that sort of things is a bit outside my domain. This patch is much simpler than that: If the total area of the dirty rectangles exceeds the total area of the screen, it forces a fullscreen update.
This was prompted by the SCI engine which currently chokes badly on my computer when scrolling, unless I use the 1x scaler. I've talked to m_kiewitz about it and he said he'll try to fix it, but the patch might still be a good safety valve. Though perhaps we should wait until the OpenGL backend hits the trunk before making changes to that part of the code?
(The SCI scrolling transition currently spams the backend with lots and lots of almost fullscreen dirty rectangles, to the point where a single screen update could take 0.25 seconds for me before it finally reached the "too many; let's do a fullscreen update" theshold. Once it starts missing frames, it deteriorates quickly. I got perhaps a dozen scrolling frames, out of the desired 180, for a sideways scroll.)
Ticket imported from: #3054614. Ticket imported from: patches/1308.