diff options
Diffstat (limited to 'vcl/source/opengl')
-rw-r--r-- | vcl/source/opengl/OpenGLContext.cxx | 14 | ||||
-rw-r--r-- | vcl/source/opengl/OpenGLHelper.cxx | 2 |
2 files changed, 15 insertions, 1 deletions
diff --git a/vcl/source/opengl/OpenGLContext.cxx b/vcl/source/opengl/OpenGLContext.cxx index 49feb75368b4..3c305d523d98 100644 --- a/vcl/source/opengl/OpenGLContext.cxx +++ b/vcl/source/opengl/OpenGLContext.cxx @@ -1336,6 +1336,20 @@ void OpenGLContext::clearCurrent() pCurrentCtx->ReleaseFramebuffers(); } +void OpenGLContext::prepareForYield() +{ + ImplSVData* pSVData = ImplGetSVData(); + + SAL_INFO("vcl.opengl", "Unbinding contexts in preparation for yield"); + // release all framebuffers from the old context so we can re-attach the + // texture in the new context + OpenGLContext* pCurrentCtx = pSVData->maGDIData.mpLastContext; + if( pCurrentCtx && pCurrentCtx->isCurrent() ) + pCurrentCtx->resetCurrent(); + + assert (!hasCurrent()); +} + void OpenGLContext::makeCurrent() { ImplSVData* pSVData = ImplGetSVData(); diff --git a/vcl/source/opengl/OpenGLHelper.cxx b/vcl/source/opengl/OpenGLHelper.cxx index 6019850c88fe..62cb91887d4e 100644 --- a/vcl/source/opengl/OpenGLHelper.cxx +++ b/vcl/source/opengl/OpenGLHelper.cxx @@ -694,7 +694,7 @@ void OpenGLHelper::debugMsgPrint(const char *pArea, const char *pFormat, ...) vsnprintf(pStr, sizeof(pStr), pFormat, aArgs); pStr[sizeof(pStr)-20] = '\0'; - bool bHasContext = !OpenGLContext::hasCurrent(); + bool bHasContext = OpenGLContext::hasCurrent(); if (!bHasContext) strcat(pStr, "- no GL context"); |