diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2015-01-06 16:09:09 +0000 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2015-01-06 16:13:30 +0000 |
commit | 0bea1d80d10a1e3e9bebf958d622ff2fb480e886 (patch) | |
tree | bea0a6365d149abb5c37b4baaa6ae128b4e9da32 /vcl/osx | |
parent | 3b52c4492c468ee5dfbb97382f53a28bdf8c0f4c (diff) |
vcl: reset OpenGLContext(s) when yielding the last SolarMutex.
This should make OpenGL thread-safe to allow multiple threads to
render using VCL's OpenGL backend, and fix misc. associated driver
horrors, will give some performance cost for tight Yield loops.
Change-Id: Ib23702262fd9f0925a5ed8c642d0a26e92136b37
Diffstat (limited to 'vcl/osx')
-rw-r--r-- | vcl/osx/salinst.cxx | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/vcl/osx/salinst.cxx b/vcl/osx/salinst.cxx index 99798425502b..411cfba81586 100644 --- a/vcl/osx/salinst.cxx +++ b/vcl/osx/salinst.cxx @@ -31,6 +31,7 @@ #include "vcl/window.hxx" #include "vcl/timer.hxx" #include "vcl/svmain.hxx" +#include "vcl/opengl/OpenGLContext.hxx" #include "osx/saldata.hxx" #include "osx/salinst.h" @@ -269,7 +270,10 @@ void SalYieldMutex::release() if ( mnThreadId == osl::Thread::getCurrentIdentifier() ) { if ( mnCount == 1 ) + { + OpenGLContext::resetAllContexts(); mnThreadId = 0; + } mnCount--; } m_mutex.release(); |