summaryrefslogtreecommitdiff
path: root/vcl/source/opengl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-11-25 20:25:27 +0000
committerCaolán McNamara <caolanm@redhat.com>2016-12-13 11:33:18 +0000
commit482d7ce61b423600b41b459eb26a2cc221cd0acf (patch)
tree8da6edb8200889d93f0b344e61ed779c037a590f /vcl/source/opengl
parent178e38dd82a2cffb2db747c7be82ba7a48338968 (diff)
change from glew to epoxy
because that works under wayland out of the box and gtk3 uses it already Change-Id: Iefaac31e325534a81a5389f752804af917c1baef Reviewed-on: https://gerrit.libreoffice.org/31213 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl/source/opengl')
-rw-r--r--vcl/source/opengl/OpenGLContext.cxx34
-rw-r--r--vcl/source/opengl/OpenGLHelper.cxx8
2 files changed, 10 insertions, 32 deletions
diff --git a/vcl/source/opengl/OpenGLContext.cxx b/vcl/source/opengl/OpenGLContext.cxx
index 93bde70bcdf7..c04a0cf0c7fc 100644
--- a/vcl/source/opengl/OpenGLContext.cxx
+++ b/vcl/source/opengl/OpenGLContext.cxx
@@ -7,7 +7,6 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-#include <config_opengl.h>
#include <chrono>
#include <vcl/opengl/OpenGLContext.hxx>
@@ -205,13 +204,8 @@ extern "C" void
APIENTRY
#endif
debug_callback(GLenum source, GLenum type, GLuint id,
- GLenum severity, GLsizei , const GLchar* message,
-#if HAVE_GLEW_1_12
- const GLvoid*
-#else
- GLvoid*
-#endif
- )
+ GLenum severity, GLsizei , const GLchar* message,
+ const GLvoid*)
{
// ignore Nvidia's 131218: "Program/shader state performance warning: Fragment Shader is going to be recompiled because the shader key based on GL state mismatches."
// the GLSL compiler is a bit too aggressive in optimizing the state based on the current OpenGL state
@@ -280,30 +274,14 @@ OUString getGLString(GLenum eGlEnum)
return sString;
}
-bool OpenGLContext::InitGLEW()
+bool OpenGLContext::InitGL()
{
- static bool bGlewInit = false;
- if(!bGlewInit)
- {
- OpenGLZone aZone;
-
- glewExperimental = GL_TRUE;
- GLenum err = glewInit();
- if (err != GLEW_OK)
- {
- SAL_WARN("vcl.opengl", "Failed to initialize GLEW: " << glewGetErrorString(err));
- return false;
- }
- else
- bGlewInit = true;
- }
-
VCL_GL_INFO("OpenGLContext::ImplInit----end");
VCL_GL_INFO("Vendor: " << getGLString(GL_VENDOR) << " Renderer: " << getGLString(GL_RENDERER) << " GL version: " << OpenGLHelper::getGLVersion());
mbInitialized = true;
// I think we need at least GL 3.0
- if (!GLEW_VERSION_3_0)
+ if (epoxy_gl_version() < 30)
{
SAL_WARN("vcl.opengl", "We don't have at least OpenGL 3.0");
return false;
@@ -319,11 +297,11 @@ bool OpenGLContext::InitGLEW()
return true;
}
-void OpenGLContext::InitGLEWDebugging()
+void OpenGLContext::InitGLDebugging()
{
#ifdef DBG_UTIL
// only enable debug output in dbgutil build
- if( GLEW_ARB_debug_output)
+ if (epoxy_has_gl_extension("GL_ARB_debug_output"))
{
OpenGLZone aZone;
diff --git a/vcl/source/opengl/OpenGLHelper.cxx b/vcl/source/opengl/OpenGLHelper.cxx
index f07e7dcbfa8e..9b91415d2392 100644
--- a/vcl/source/opengl/OpenGLHelper.cxx
+++ b/vcl/source/opengl/OpenGLHelper.cxx
@@ -401,7 +401,7 @@ GLint OpenGLHelper::LoadShaders(const OUString& rVertexShaderName,
aGeometryShaderSource = getShaderSource(rGeometryShaderName);
GLint bBinaryResult = GL_FALSE;
- if( GLEW_ARB_get_program_binary && !rDigest.isEmpty() )
+ if (epoxy_has_gl_extension("GL_ARB_get_program_binary") && !rDigest.isEmpty())
{
OString aFileName =
createFileName(rVertexShaderName, rFragmentShaderName, rGeometryShaderName, rDigest);
@@ -473,7 +473,7 @@ GLint OpenGLHelper::LoadShaders(const OUString& rVertexShaderName,
if (bHasGeometryShader)
glAttachShader(ProgramID, GeometryShaderID);
- if( GLEW_ARB_get_program_binary && !rDigest.isEmpty() )
+ if (epoxy_has_gl_extension("GL_ARB_get_program_binary") && !rDigest.isEmpty())
{
glProgramParameteri(ProgramID, GL_PROGRAM_BINARY_RETRIEVABLE_HINT, GL_TRUE);
glLinkProgram(ProgramID);
@@ -1085,14 +1085,14 @@ void OpenGLHelper::debugMsgPrint(const int nType, const char *pFormat, ...)
{
OpenGLZone aZone;
- if (GLEW_KHR_debug)
+ if (epoxy_has_gl_extension("GL_KHR_debug"))
glDebugMessageInsert(GL_DEBUG_SOURCE_APPLICATION,
GL_DEBUG_TYPE_OTHER,
1, // one[sic] id is as good as another ?
// GL_DEBUG_SEVERITY_NOTIFICATION for >= GL4.3 ?
GL_DEBUG_SEVERITY_LOW,
strlen(pStr), pStr);
- else if (GLEW_AMD_debug_output)
+ else if (epoxy_has_gl_extension("GL_AMD_debug_output"))
glDebugMessageInsertAMD(GL_DEBUG_CATEGORY_APPLICATION_AMD,
GL_DEBUG_SEVERITY_LOW_AMD,
1, // one[sic] id is as good as another ?