summaryrefslogtreecommitdiff
path: root/vcl/source/opengl
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2015-12-31 22:12:59 +0000
committerMichael Meeks <michael.meeks@collabora.com>2016-01-01 10:07:06 +0000
commit370199fa0f92f29cb75ad50705c71cd871abb2d9 (patch)
tree3e3f22784f85f5f85962d4f691bd838504f4216b /vcl/source/opengl
parent38e6383009aba9ff779ad9d0b4d9c94ed2bce347 (diff)
vcl: improve OpenGL debugging variously.
Change-Id: I097f1c1fb7fb505b6859289997bff3562fc06ba6 Reviewed-on: https://gerrit.libreoffice.org/21027 Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'vcl/source/opengl')
-rw-r--r--vcl/source/opengl/OpenGLContext.cxx21
-rw-r--r--vcl/source/opengl/OpenGLHelper.cxx3
2 files changed, 23 insertions, 1 deletions
diff --git a/vcl/source/opengl/OpenGLContext.cxx b/vcl/source/opengl/OpenGLContext.cxx
index 36ede4264cbf..d4397a130d24 100644
--- a/vcl/source/opengl/OpenGLContext.cxx
+++ b/vcl/source/opengl/OpenGLContext.cxx
@@ -1647,6 +1647,27 @@ void OpenGLContext::UnbindTextureFromFramebuffers( GLuint nTexture )
}
pFramebuffer = pFramebuffer->mpPrevFramebuffer;
}
+
+ // Lets just check that no other context has a framebuffer
+ // with this texture - that would be bad ...
+ assert( !IsTextureAttachedAnywhere( nTexture ) );
+}
+
+/// Method for debugging; check texture is not already attached.
+bool OpenGLContext::IsTextureAttachedAnywhere( GLuint nTexture )
+{
+ ImplSVData* pSVData = ImplGetSVData();
+ for( auto *pCheck = pSVData->maGDIData.mpLastContext; pCheck;
+ pCheck = pCheck->mpPrevContext )
+ {
+ for( auto pBuffer = pCheck->mpLastFramebuffer; pBuffer;
+ pBuffer = pBuffer->mpPrevFramebuffer )
+ {
+ if( pBuffer->IsAttached( nTexture ) )
+ return true;
+ }
+ }
+ return false;
}
void OpenGLContext::ReleaseFramebuffer( OpenGLFramebuffer* pFramebuffer )
diff --git a/vcl/source/opengl/OpenGLHelper.cxx b/vcl/source/opengl/OpenGLHelper.cxx
index bfd811001926..32f299434e39 100644
--- a/vcl/source/opengl/OpenGLHelper.cxx
+++ b/vcl/source/opengl/OpenGLHelper.cxx
@@ -1012,7 +1012,8 @@ bool OpenGLWrapper::isVCLOpenGLEnabled()
void OpenGLHelper::debugMsgStream(std::ostringstream const &pStream)
{
- debugMsgPrint("%s", pStream.str().c_str());
+ debugMsgPrint ("%x: %s", osl_getThreadIdentifier(nullptr),
+ pStream.str().c_str());
}
void OpenGLHelper::debugMsgPrint(const char *pFormat, ...)