aboutsummaryrefslogtreecommitdiff
path: root/backends
diff options
context:
space:
mode:
authorBastien Bouclet2016-09-18 13:20:25 +0200
committerBastien Bouclet2016-09-18 17:55:09 +0200
commit75599a4c25ae4d56a86c42f890c378223d6935a1 (patch)
tree05b700bfed7423c1698e57be80da60ee43c55afc /backends
parent1a1a5b5f692ac74e25b03ba2bdc09e0af3606a4a (diff)
downloadscummvm-rg350-75599a4c25ae4d56a86c42f890c378223d6935a1.tar.gz
scummvm-rg350-75599a4c25ae4d56a86c42f890c378223d6935a1.tar.bz2
scummvm-rg350-75599a4c25ae4d56a86c42f890c378223d6935a1.zip
OPENGL: Remove multithread support from displayActivityIconOnOSD
It is no longer being called by another thread.
Diffstat (limited to 'backends')
-rw-r--r--backends/graphics/opengl/opengl-graphics.cpp39
-rw-r--r--backends/graphics/opengl/opengl-graphics.h18
2 files changed, 7 insertions, 50 deletions
diff --git a/backends/graphics/opengl/opengl-graphics.cpp b/backends/graphics/opengl/opengl-graphics.cpp
index e4df94c52d..4c74b7780d 100644
--- a/backends/graphics/opengl/opengl-graphics.cpp
+++ b/backends/graphics/opengl/opengl-graphics.cpp
@@ -58,7 +58,7 @@ OpenGLGraphicsManager::OpenGLGraphicsManager()
_forceRedraw(false), _scissorOverride(3)
#ifdef USE_OSD
, _osdMessageChangeRequest(false), _osdMessageAlpha(0), _osdMessageFadeStartTime(0), _osdMessageSurface(nullptr),
- _osdIconChangeRequest(false), _osdIconSurface(nullptr)
+ _osdIconSurface(nullptr)
#endif
{
memset(_gamePalette, 0, sizeof(_gamePalette));
@@ -72,7 +72,6 @@ OpenGLGraphicsManager::~OpenGLGraphicsManager() {
#ifdef USE_OSD
delete _osdMessageSurface;
delete _osdIconSurface;
- _osdIconNextData.free();
#endif
#if !USE_FORCED_GLES
ShaderManager::destroy();
@@ -368,14 +367,13 @@ void OpenGLGraphicsManager::updateScreen() {
#ifdef USE_OSD
{
Common::StackLock lock(_osdMutex);
-
if (_osdMessageChangeRequest) {
osdMessageUpdateSurface();
}
+ }
- if (_osdIconChangeRequest) {
- osdIconUpdateSurface();
- }
+ if (_osdIconSurface) {
+ _osdIconSurface->updateGLTexture();
}
#endif
@@ -810,30 +808,11 @@ void OpenGLGraphicsManager::osdMessageUpdateSurface() {
void OpenGLGraphicsManager::displayActivityIconOnOSD(const Graphics::Surface *icon) {
#ifdef USE_OSD
- // HACK: Actually no client code should use graphics functions from
- // another thread. But the MT-32 emulator and network synchronization still do,
- // thus we need to make sure this doesn't happen while a updateScreen call is done.
- // HACK: We can't make OpenGL calls outside of the main thread. This method
- // stores a copy of the icon. The main thread will pick up the changed icon,
- // and copy it to an OpenGL texture.
- Common::StackLock lock(_osdMutex);
-
- _osdIconChangeRequest = true;
-
- _osdIconNextData.free();
- if (icon)
- _osdIconNextData.copyFrom(*icon);
-#endif
-}
-
-#ifdef USE_OSD
-void OpenGLGraphicsManager::osdIconUpdateSurface() {
delete _osdIconSurface;
_osdIconSurface = nullptr;
- if (_osdIconNextData.getPixels()) {
- Graphics::Surface *converted = _osdIconNextData.convertTo(_defaultFormatAlpha);
- _osdIconNextData.free();
+ if (icon) {
+ Graphics::Surface *converted = icon->convertTo(_defaultFormatAlpha);
_osdIconSurface = createSurface(_defaultFormatAlpha);
assert(_osdIconSurface);
@@ -851,13 +830,9 @@ void OpenGLGraphicsManager::osdIconUpdateSurface() {
converted->free();
delete converted;
-
- _osdIconSurface->updateGLTexture();
}
-
- _osdIconChangeRequest = false;
-}
#endif
+}
void OpenGLGraphicsManager::setPalette(const byte *colors, uint start, uint num) {
assert(_gameScreen->hasPalette());
diff --git a/backends/graphics/opengl/opengl-graphics.h b/backends/graphics/opengl/opengl-graphics.h
index 366ad48fad..7900f06fb7 100644
--- a/backends/graphics/opengl/opengl-graphics.h
+++ b/backends/graphics/opengl/opengl-graphics.h
@@ -587,24 +587,6 @@ private:
};
/**
- * Request for the OSD icon surface to be updated.
- */
- bool _osdIconChangeRequest;
-
- /**
- * The next OSD background activity icon.
- *
- * The OSD icon will be updated with this data on the next frame.
- * Can be an unallocated surface if the OSD icon should not be displayed.
- */
- Graphics::Surface _osdIconNextData;
-
- /**
- * Set the OSD icon surface with the value of the next OSD icon.
- */
- void osdIconUpdateSurface();
-
- /**
* The OSD background activity icon's contents.
*/
Surface *_osdIconSurface;