diff options
author | Markus Mohrhard <markus.mohrhard@collabora.co.uk> | 2014-02-23 04:46:25 +0100 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2014-02-23 06:42:00 +0100 |
commit | 1be2b63b64eba60b5397c20006f669019fe8a8e7 (patch) | |
tree | 8b684ddaaa96ad3436d3e0257924fd8b19d1c39d /chart2 | |
parent | Advertise the new PythonTest_pytests addition. (diff) | |
download | core-1be2b63b64eba60b5397c20006f669019fe8a8e7.tar.gz core-1be2b63b64eba60b5397c20006f669019fe8a8e7.zip |
make OpenGL debug messages more readable
Change-Id: I2e90acaa0fe1fb47559ddd7b898874e12f494a9a
Diffstat (limited to 'chart2')
-rw-r--r-- | chart2/source/view/main/DummyXShape.cxx | 73 |
1 files changed, 69 insertions, 4 deletions
diff --git a/chart2/source/view/main/DummyXShape.cxx b/chart2/source/view/main/DummyXShape.cxx index 986589d9f898..199193b71000 100644 --- a/chart2/source/view/main/DummyXShape.cxx +++ b/chart2/source/view/main/DummyXShape.cxx @@ -897,8 +897,6 @@ DummyFormattedText::DummyFormattedText(uno::Sequence< uno::Reference< { } - - DummyGroup3D::DummyGroup3D(const OUString& rName) { setName(rName); @@ -1252,6 +1250,73 @@ int oglErrorHandler( Display* /*dpy*/, XErrorEvent* /*evnt*/ ) namespace { +const char* getSeverityString(GLenum severity) +{ + switch(severity) + { + case GL_DEBUG_SEVERITY_LOW: + return "low"; + case GL_DEBUG_SEVERITY_MEDIUM: + return "medium"; + case GL_DEBUG_SEVERITY_HIGH: + return "high"; + default: + ; + } + + return "unknown"; +} + +const char* getSourceString(GLenum source) +{ + switch(source) + { + case GL_DEBUG_SOURCE_API: + return "API"; + case GL_DEBUG_SOURCE_SHADER_COMPILER: + return "shader compiler"; + case GL_DEBUG_SOURCE_WINDOW_SYSTEM: + return "window system"; + case GL_DEBUG_SOURCE_THIRD_PARTY: + return "third party"; + case GL_DEBUG_SOURCE_APPLICATION: + return "Libreoffice"; + case GL_DEBUG_SOURCE_OTHER: + return "unknown"; + default: + ; + } + + return "unknown"; +} + +const char* getTypeString(GLenum type) +{ + switch(type) + { + case GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR: + return "deprecated behavior"; + case GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR: + return "undefined behavior"; + case GL_DEBUG_TYPE_PERFORMANCE: + return "performance"; + case GL_DEBUG_TYPE_PORTABILITY: + return "portability"; + case GL_DEBUG_TYPE_MARKER: + return "marker"; + case GL_DEBUG_TYPE_PUSH_GROUP: + return "push group"; + case GL_DEBUG_TYPE_POP_GROUP: + return "pop group"; + case GL_DEBUG_TYPE_OTHER: + return "other"; + default: + ; + } + + return "unkown"; +} + extern "C" void #if defined _WIN32 APIENTRY @@ -1259,8 +1324,8 @@ APIENTRY debug_callback(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei , const GLchar* message, GLvoid* ) { - SAL_WARN("chart2.opengl", "OpenGL debug message: source: " << source << ", type: " - << type << ", id: " << id << ", severity: " << severity << " with message: " << message); + SAL_WARN("chart2.opengl", "OpenGL debug message: source: " << getSourceString(source) << ", type: " + << type << ", id: " << id << ", severity: " << getSeverityString(severity) << " with message: " << message); } } |