diff options
author | Bastien Bouclet | 2016-10-03 07:16:22 +0200 |
---|---|---|
committer | Bastien Bouclet | 2016-10-03 07:31:18 +0200 |
commit | 7941e5d530430d07204384f7994efbe17dc9a8f5 (patch) | |
tree | ad218c66720b44952c5a4ef7303ce8b67315676f /backends/graphics | |
parent | 3f6ca96c5b4d7c083e6d60db617bb4b13c90e1b4 (diff) | |
download | scummvm-rg350-7941e5d530430d07204384f7994efbe17dc9a8f5.tar.gz scummvm-rg350-7941e5d530430d07204384f7994efbe17dc9a8f5.tar.bz2 scummvm-rg350-7941e5d530430d07204384f7994efbe17dc9a8f5.zip |
SDL: Switch to full screen updates when the OSD is transparent
Previous releases also did full screen updates for transparent OSD messages.
There should be no performance regression with that regard.
Computing smaller update rects is non trivial, but should be looked into if
performance is an issue for OSD icons.
Fixes #9598
Diffstat (limited to 'backends/graphics')
-rw-r--r-- | backends/graphics/surfacesdl/surfacesdl-graphics.cpp | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/backends/graphics/surfacesdl/surfacesdl-graphics.cpp b/backends/graphics/surfacesdl/surfacesdl-graphics.cpp index adb84bfb24..46e243c945 100644 --- a/backends/graphics/surfacesdl/surfacesdl-graphics.cpp +++ b/backends/graphics/surfacesdl/surfacesdl-graphics.cpp @@ -2176,9 +2176,8 @@ void SurfaceSdlGraphicsManager::displayActivityIconOnOSD(const Graphics::Surface Common::StackLock lock(_graphicsMutex); // Lock the mutex until this function ends if (_osdIconSurface && !icon) { - // Add a dirty rect to clear the icon on the next update - SDL_Rect dstRect = getOSDIconRect(); - addDirtyRect(dstRect.x, dstRect.y, dstRect.w, dstRect.h, true); + // Force a redraw to clear the icon on the next update + _forceFull = true; } if (_osdIconSurface) { @@ -2249,6 +2248,7 @@ void SurfaceSdlGraphicsManager::updateOSD() { _osdMessageAlpha = startAlpha + diff * (SDL_ALPHA_TRANSPARENT - startAlpha) / kOSDFadeOutDuration; } SDL_SetAlpha(_osdMessageSurface, SDL_RLEACCEL | SDL_SRCCOLORKEY | SDL_SRCALPHA, _osdMessageAlpha); + _forceFull = true; } if (_osdMessageAlpha == SDL_ALPHA_TRANSPARENT) { @@ -2256,14 +2256,9 @@ void SurfaceSdlGraphicsManager::updateOSD() { } } - if (_osdMessageSurface) { - SDL_Rect dstRect = getOSDMessageRect(); - addDirtyRect(dstRect.x, dstRect.y, dstRect.w, dstRect.h, true); - } - if (_osdIconSurface) { - SDL_Rect dstRect = getOSDIconRect(); - addDirtyRect(dstRect.x, dstRect.y, dstRect.w, dstRect.h, true); + // Redraw the area below the icon for the transparent blit to give correct results. + _forceFull = true; } } |