summaryrefslogtreecommitdiff
path: root/include/vcl/opengl
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2016-07-25 13:58:44 +0900
committerTomaž Vajngerl <quikee@gmail.com>2016-07-25 14:35:15 +0000
commit1b7ef90fba218b27f3757d117f5e2d3c872c5da8 (patch)
tree9eca8f1004f64ee61d35f13fd129e35d8b3598cb /include/vcl/opengl
parenteb09e512ae8283f52114c29f4a7d481fa82ab372 (diff)
opengl: add VCL_GL_WARN to write warnings into api trace file
Change-Id: I416de926a769dccdf1c53072c1f7dda817c5402a Reviewed-on: https://gerrit.libreoffice.org/27496 Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> Tested-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'include/vcl/opengl')
-rw-r--r--include/vcl/opengl/OpenGLHelper.hxx14
1 files changed, 13 insertions, 1 deletions
diff --git a/include/vcl/opengl/OpenGLHelper.hxx b/include/vcl/opengl/OpenGLHelper.hxx
index b2989b82de75..97db306bb5d3 100644
--- a/include/vcl/opengl/OpenGLHelper.hxx
+++ b/include/vcl/opengl/OpenGLHelper.hxx
@@ -28,6 +28,17 @@
} \
} while (false)
+/// Helper to do a SAL_WARN as well as a GL log.
+#define VCL_GL_WARN(stream) \
+ do { \
+ if (SAL_DETAIL_ENABLE_LOG_INFO && OpenGLHelper::isVCLOpenGLEnabled()) \
+ { \
+ ::std::ostringstream detail_stream; \
+ detail_stream << stream; \
+ OpenGLHelper::debugMsgStreamWarn(detail_stream); \
+ } \
+ } while (false)
+
// All member functions static and VCL_DLLPUBLIC. Basically a glorified namespace.
struct VCL_DLLPUBLIC OpenGLHelper
{
@@ -77,8 +88,9 @@ public:
* Insert a glDebugMessage into the queue - helpful for debugging
* with apitrace to annotate the output and correlate it with code.
*/
- static void debugMsgPrint(const char *pFormat, ...);
+ static void debugMsgPrint(const int nType, const char *pFormat, ...);
static void debugMsgStream(std::ostringstream const &pStream);
+ static void debugMsgStreamWarn(std::ostringstream const &pStream);
/**
* checks if the device/driver pair is on our OpenGL blacklist