change from glew to epoxy
authorCaolán McNamara <caolanm@redhat.com>
Fri, 25 Nov 2016 20:25:27 +0000 (20:25 +0000)
committerRene Engelhard <rene@debian.org>
Fri, 21 Jul 2017 09:17:32 +0000 (10:17 +0100)
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>
Gbp-Pq: Name change-from-glew-to-epoxy.diff

80 files changed:
Makefile.fetch
RepositoryExternal.mk
avmedia/Library_avmedia.mk
avmedia/Library_avmediaogl.mk
bin/check-elf-dynamic-objects
bin/lo-all-static-libs
canvas/Library_oglcanvas.mk
canvas/source/opengl/ogl_buffercontext.hxx
canvas/source/opengl/ogl_canvascustomsprite.cxx
canvas/source/opengl/ogl_canvashelper.cxx
canvas/source/opengl/ogl_canvastools.cxx
canvas/source/opengl/ogl_texturecache.cxx
canvas/source/opengl/ogl_tools.hxx
chart2/Library_chartcore.mk
chart2/Library_chartopengl.mk
chart2/inc/pch/precompiled_chartcore.hxx
chart2/source/view/charttypes/GL3DBarChart.cxx
chart2/source/view/main/GL3DRenderer.cxx
chart2/source/view/main/OpenGLRender.cxx
config_host.mk.in
config_host/config_opengl.h.in [deleted file]
configure.ac
cui/Library_cui.mk
distro-configs/LibreOfficeFlatpak.conf
download.lst
external/Module_external.mk
external/epoxy/Library_epoxy.mk [new file with mode: 0644]
external/epoxy/Makefile [new file with mode: 0644]
external/epoxy/Module_epoxy.mk [new file with mode: 0644]
external/epoxy/README [new file with mode: 0644]
external/epoxy/UnpackedTarball_epoxy.mk [new file with mode: 0644]
external/epoxy/epoxy.noegl.by.default.patch [new file with mode: 0644]
external/epoxy/epoxy.windows.api.patch [new file with mode: 0644]
external/glew/ExternalPackage_glew.mk [deleted file]
external/glew/ExternalProject_glew.mk [deleted file]
external/glew/Makefile [deleted file]
external/glew/Module_glew.mk [deleted file]
external/glew/README [deleted file]
external/glew/UnpackedTarball_glew.mk [deleted file]
external/glew/glew-macosx-install-name.patch.1 [deleted file]
external/glew/glew-msvc-disable-sse2.patch.1 [deleted file]
external/glew/glew-static-only.patch.1 [deleted file]
external/glew/glew-tmpdir.patch.1 [deleted file]
external/glew/glew_use_CC_variable.patch.1 [deleted file]
external/libgltf/ExternalProject_libgltf.mk
external/libgltf/libgltf-msvc-x64.patch.1
include/vcl/opengl/OpenGLContext.hxx
include/vcl/opengl/OpenGLHelper.hxx
include/vcl/opengl/OpenGLWrapper.hxx
slideshow/Library_OGLTrans.mk
slideshow/Library_slideshow.mk
slideshow/source/engine/opengl/TransitionImpl.cxx
slideshow/source/engine/opengl/TransitionImpl.hxx
slideshow/source/engine/opengl/TransitionerImpl.cxx
svx/Library_svxcore.mk
toolkit/Library_tk.mk
vcl/CppunitTest_vcl_bitmap_test.mk
vcl/CppunitTest_vcl_wmf_test.mk
vcl/Executable_icontest.mk
vcl/Executable_vcldemo.mk
vcl/Executable_visualbackendtest.mk
vcl/Library_vcl.mk
vcl/Library_vclplug_gen.mk
vcl/Library_vclplug_gtk.mk
vcl/Library_vclplug_gtk3.mk
vcl/Library_vclplug_kde4.mk
vcl/inc/opengl/LineRenderUtils.hxx
vcl/inc/opengl/VertexUtils.hxx
vcl/inc/opengl/framebuffer.hxx
vcl/inc/opengl/program.hxx
vcl/inc/opengl/texture.hxx
vcl/inc/pch/precompiled_vcl.hxx
vcl/inc/unx/saldisp.hxx
vcl/opengl/win/gdiimpl.cxx
vcl/opengl/x11/gdiimpl.cxx
vcl/osx/salobj.cxx
vcl/source/opengl/OpenGLContext.cxx
vcl/source/opengl/OpenGLHelper.cxx
vcl/unx/generic/app/saldisp.cxx
vcl/workben/icontest.cxx

index 3e21be38685efa9079aa6a6490deb9cfabc22b0c..cf31e5b3bfc0448b8380e72520c6ac45f0ac1057 100644 (file)
@@ -129,7 +129,7 @@ $(WORKDIR)/download: $(BUILDDIR)/config_host.mk $(SRCDIR)/download.lst $(SRCDIR)
                $(call fetch_Optional,FONTCONFIG,FONTCONFIG_TARBALL) \
                $(call fetch_Optional,FREEHAND,FREEHAND_TARBALL) \
                $(call fetch_Optional,FREETYPE,FREETYPE_TARBALL) \
-               $(call fetch_Optional,GLEW,GLEW_TARBALL) \
+               $(call fetch_Optional,EPOXY,EPOXY_TARBALL) \
                $(call fetch_Optional,GLM,GLM_TARBALL) \
                $(call fetch_Optional_pack,GOOGLE_DOCS_EXTENSION_PACK) \
                $(call fetch_Optional,GRAPHITE,GRAPHITE_TARBALL) \
index cc50b73761e3d57127d93c929d2521133747945d..61c00055fc29e6c619a7ffc6afa082866a4ab004 100644 (file)
@@ -183,51 +183,43 @@ endef
 
 endif # SYSTEM_CPPUNIT
 
-ifneq ($(SYSTEM_GLEW),)
+ifneq ($(SYSTEM_EPOXY),)
 
-define gb_LinkTarget__use_glew
+define gb_LinkTarget__use_epoxy
 $(call gb_LinkTarget_set_include,$(1),\
        $$(INCLUDE) \
-    $(GLEW_CFLAGS) \
+    $(EPOXY_CFLAGS) \
 )
-$(call gb_LinkTarget_add_libs,$(1),$(GLEW_LIBS))
+$(call gb_LinkTarget_add_libs,$(1),$(EPOXY_LIBS))
 
 endef
 
-gb_ExternalProject__use_glew :=
+gb_ExternalProject__use_epoxy :=
 
-else # !SYSTEM_GLEW
+else # !SYSTEM_EPOXY
 
-$(eval $(call gb_Helper_register_packages_for_install,ooo,\
-       glew \
-))
-
-define gb_LinkTarget__use_glew
-$(call gb_LinkTarget_use_package,$(1),glew)
+define gb_LinkTarget__use_epoxy
 $(call gb_LinkTarget_set_include,$(1),\
-       -I$(call gb_UnpackedTarball_get_dir,glew/include) \
-       -DGLEW_NO_GLU \
-       $$(INCLUDE) \
+       -I$(call gb_UnpackedTarball_get_dir,epoxy/include) \
+       $$(INCLUDE) \
 )
 
-ifeq ($(COM),MSC)
-$(call gb_LinkTarget_add_libs,$(1),\
-       $(call gb_UnpackedTarball_get_dir,glew)/lib/$(if $(MSVC_USE_DEBUG_RUNTIME),Debug/$(wnt_arch_subdir_mandatory)/glew32d.lib,Release/$(wnt_arch_subdir_mandatory)/glew32.lib) \
-)
-else
-$(call gb_LinkTarget_add_libs,$(1),\
-       -L$(call gb_UnpackedTarball_get_dir,glew)/lib/ -lGLEW \
+$(call gb_LinkTarget_use_libraries,$(1),\
+    epoxy \
 )
-endif
 
 endef
 
-define gb_ExternalProject__use_glew
-$(call gb_ExternalProject_use_external_project,$(1),glew)
+$(eval $(call gb_Helper_register_libraries_for_install,PLAINLIBS_OOO,ooo,\
+       epoxy \
+))
+
+define gb_ExternalProject__use_epoxy
+$(call gb_ExternalProject_use_external_project,$(1),epoxy)
 
 endef
 
-endif # SYSTEM_GLEW
+endif # SYSTEM_EPOXY
 
 define gb_LinkTarget__use_iconv
 $(call gb_LinkTarget_add_libs,$(1),-liconv)
@@ -3382,7 +3374,7 @@ $(call gb_LinkTarget_add_libs,$(1),\
 )
 else
 $(call gb_LinkTarget_add_libs,$(1),\
-       $(call gb_UnpackedTarball_get_dir,libgltf)/src/.libs/libgltf-0.0$(gb_StaticLibrary_PLAINEXT) \
+       $(call gb_UnpackedTarball_get_dir,libgltf)/src/.libs/libgltf-0.1$(gb_StaticLibrary_PLAINEXT) \
 )
 endif
 
index 4e8f3b1aecb4562772fbb9bd45b6be2d0530e1b0..e662fc379382644240769129dcd2ecab77072c59 100644 (file)
@@ -29,7 +29,7 @@ $(eval $(call gb_Library_use_externals,avmedia,\
 
 ifeq ($(ENABLE_HEADLESS),)
 $(eval $(call gb_Library_use_externals,avmedia,\
-    glew \
+    epoxy \
 ))
 endif
 
index b7498bfb1a1598affa21874586e8d4db01c95ded..191fb75bc6dd5b3c9998e15ab00946168d6fb6b1 100644 (file)
@@ -16,7 +16,7 @@ $(eval $(call gb_Library_use_sdk_api,avmediaogl))
 $(eval $(call gb_Library_use_externals,avmediaogl, \
     boost_headers \
     libgltf \
-    glew \
+    epoxy \
     glm_headers \
 ))
 
@@ -51,10 +51,6 @@ else ifeq ($(OS),MACOSX)
 $(eval $(call gb_Library_use_system_darwin_frameworks,avmediaogl,\
        OpenGL \
 ))
-else ifeq ($(OS), $(filter LINUX %BSD SOLARIS, $(OS)))
-$(eval $(call gb_Library_add_libs,avmediaogl,\
-    -lGL \
-))
 endif
 
 # vim: set noet sw=4 ts=4:
index f05d513bad94c9f1540af38d7e44cc2718156231..d189c1be4c9350b02ed832a8d3f0bbd28cd26c8a 100755 (executable)
@@ -110,7 +110,7 @@ local file="$1"
         */libdesktop_detectorlo.so|*/ui-previewer|*/oosplash|*/gengal.bin)
             whitelist="${whitelist} ${x11whitelist}"
         ;;
-        */libvclplug_genlo.so|*/libGLEW.so.*|*/libchartcorelo.so|*/libavmediaogl.so|*/libOGLTranslo.so|*/liboglcanvaslo.so|*/libchartopengllo.so)
+        */libvclplug_genlo.so|*/libchartcorelo.so|*/libavmediaogl.so|*/libOGLTranslo.so|*/liboglcanvaslo.so|*/libchartopengllo.so)
             whitelist="${whitelist} ${x11whitelist} ${openglwhitelist}"
         ;;
         */libvcllo.so|*/libsofficeapp.so)
index 813241eede65baba1e26e94e767f3df684078826..9faa042bbf3e8a15623ec620f870105b1b9f1eeb 100755 (executable)
@@ -63,7 +63,7 @@ echo $INSTDIR/$LIBO_LIB_FOLDER/lib*.a \
      $WORKDIR/UnpackedTarball/coinmp/CoinMP/src/.libs/*.a \
      $WORKDIR/UnpackedTarball/coinmp/CoinUtils/src/.libs/*.a \
      $WORKDIR/UnpackedTarball/coinmp/Osi/src/Osi/.libs/*.a \
-     $WORKDIR/UnpackedTarball/glew/lib/*.a \
+     $WORKDIR/UnpackedTarball/epoxy/lib/*.a \
      $WORKDIR/UnpackedTarball/icu/source/lib/*.a \
      $WORKDIR/UnpackedTarball/langtag/liblangtag/.libs/*.a \
      $WORKDIR/UnpackedTarball/lcms2/src/.libs/*.a \
index 0118eb118db15b020a2d1ef81d1f980873be28dc..9d1042dda8d2e5df9889af01ee50e156a402a609 100644 (file)
@@ -42,7 +42,7 @@ $(eval $(call gb_Library_add_exception_objects,oglcanvas,\
 
 $(eval $(call gb_Library_use_externals,oglcanvas,\
        boost_headers \
-       glew \
+       epoxy \
 ))
 
 ifeq ($(strip $(OS)),MACOSX)
@@ -58,11 +58,6 @@ $(eval $(call gb_Library_use_system_win32_libs,oglcanvas,\
     opengl32 \
 ))
 
-else
-$(eval $(call gb_Library_add_libs,oglcanvas,\
-    -lGL \
-    -lX11 \
-))
 endif
 
 # vim: set noet sw=4 ts=4:
index 202e0634dbade791d455397c2ee964b71043e922..7f2066a0e07590ce9ef495b8d239d719246c2cae 100644 (file)
@@ -10,7 +10,7 @@
 #ifndef INCLUDED_CANVAS_SOURCE_OPENGL_OGL_BUFFERCONTEXT_HXX
 #define INCLUDED_CANVAS_SOURCE_OPENGL_OGL_BUFFERCONTEXT_HXX
 
-#include <GL/glew.h>
+#include <epoxy/gl.h>
 
 #include <sal/config.h>
 #include <memory>
index 8d38177be946cde18d05a89c6cbf1e00a5a7dba2..6b23d45047408af74101ec7ea2f7119d50e3c779 100644 (file)
@@ -9,7 +9,7 @@
 
 #include <sal/config.h>
 
-#include <GL/glew.h>
+#include <epoxy/gl.h>
 
 #include <basegfx/matrix/b2dhommatrix.hxx>
 #include <basegfx/point/b2dpoint.hxx>
index 84a96cedf86a82fb44ae78561480225de7603166..175a02bc4df0477c07f34ccaab0efee96e91e357 100644 (file)
@@ -11,7 +11,7 @@
 
 #include <memory>
 #include <functional>
-#include <GL/glew.h>
+#include <epoxy/gl.h>
 
 #include <basegfx/polygon/b2dpolygontriangulator.hxx>
 #include <basegfx/polygon/b2dpolypolygon.hxx>
index 657a22027ba7a57c0e2885dda6469e65b8088d8b..3d9448b367bf3ea5946a4c408ed19ebe2491e23c 100644 (file)
@@ -9,7 +9,7 @@
 
 #include <sal/config.h>
 
-#include <GL/glew.h>
+#include <epoxy/gl.h>
 
 #include <basegfx/matrix/b2dhommatrix.hxx>
 #include <basegfx/polygon/b2dpolygontriangulator.hxx>
index 08cdd2f3b0a2251728bb900dc9bcced5aa93a692..43fb7d8e2e25049e74722585bb7b3b4957e6361c 100644 (file)
@@ -9,7 +9,7 @@
 
 #include <sal/config.h>
 
-#include <GL/glew.h>
+#include <epoxy/gl.h>
 
 #include <com/sun/star/geometry/IntegerSize2D.hpp>
 
index 8133212e8e81f7a69ee08832174a73fcc6365eed..469a5be7874b932737cc432c482bb5f594601d61 100644 (file)
@@ -11,8 +11,7 @@
 #define INCLUDED_CANVAS_SOURCE_OPENGL_OGL_TOOLS_HXX
 
 #include <sal/config.h>
-#include <GL/glew.h>
-
+#include <epoxy/gl.h>
 
 namespace oglcanvas
 {
index b15f6349e17d0f0fbac1e50b5544bd7281dcaf54..cc06fbddb6e6a3faabc6a7380e57370056b25696 100644 (file)
@@ -32,7 +32,7 @@ $(eval $(call gb_Library_use_externals,chartcore,\
 
 ifeq ($(ENABLE_HEADLESS),)
 $(eval $(call gb_Library_use_externals,chartcore,\
-    glew \
+    epoxy \
 ))
 endif
 
@@ -264,13 +264,6 @@ else ifeq ($(OS), $(filter LINUX %BSD SOLARIS, $(OS)))
 $(eval $(call gb_Library_add_libs,chartcore,\
        $(DLOPEN_LIBS) \
 ))
-ifeq ($(ENABLE_HEADLESS),)
-$(eval $(call gb_Library_add_libs,chartcore,\
-    -lGL \
-    -lX11 \
-))
-endif #!ENABLE_HEADLESS
-
 endif
 
 # vim: set noet sw=4 ts=4:
index 95ea58d8562ada99c46a659c81d562e8f8d2d03c..53056aafe0e018572585e23c3b5689a25dff212c 100644 (file)
@@ -22,7 +22,7 @@ $(eval $(call gb_Library_set_precompiled_header,chartopengl,$(SRCDIR)/chart2/inc
 $(eval $(call gb_Library_use_externals,chartopengl,\
        boost_headers \
        glm_headers \
-       glew \
+       epoxy \
 ))
 
 $(eval $(call gb_Library_use_sdk_api,chartopengl))
@@ -68,8 +68,6 @@ $(eval $(call gb_Library_use_system_darwin_frameworks,chartopengl,\
 else ifeq ($(OS), $(filter LINUX %BSD SOLARIS, $(OS)))
 $(eval $(call gb_Library_add_libs,chartopengl,\
        $(DLOPEN_LIBS) \
-       -lGL \
-       -lX11 \
 ))
 endif
  
index 8d024511efc3d03e850149b41330517933cae286..908d7acb4216297cec6db6f5ce38867266a1b949 100644 (file)
@@ -73,7 +73,6 @@
 #include <vcl/virdev.hxx>
 #include <vcl/wall.hxx>
 #include <ChartModel.hxx>
-#include <GL/glew.h>
 #include <basegfx/basegfxdllapi.h>
 #include <basegfx/matrix/b3dhommatrix.hxx>
 #include <basegfx/numeric/ftools.hxx>
 #include <cppuhelper/weak.hxx>
 #include <editeng/editengdllapi.h>
 #include <editeng/unoprnms.hxx>
+#include <epoxy/gl.h>
 #include <i18nlangtag/i18nlangtagdllapi.h>
 #include <i18nlangtag/lang.h>
 #include <i18nlangtag/languagetag.hxx>
index a4193da2e1ac7924f3e494d5cd82f00db9ea6f7f..401b664288054f710379e943340898c1f8fcd30a 100644 (file)
@@ -9,7 +9,7 @@
 
 #include <GL3DBarChart.hxx>
 
-#include <GL/glew.h>
+#include <epoxy/gl.h>
 
 #include <glm/glm.hpp>
 #include <glm/gtx/transform.hpp>
index fb4fb137c929b5f4735e3ef6f77815c0058691fc..e1e4c01673e81c171c7c1d20c8c1639208f9269b 100644 (file)
@@ -7,7 +7,7 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#include <GL/glew.h>
+#include <epoxy/gl.h>
 
 #include "GL3DRenderer.hxx"
 
@@ -244,8 +244,8 @@ void OpenGL3DRenderer::ShaderResources::LoadShaders()
         m_3DBatchNormalID = glGetAttribLocation(m_3DBatchProID, "vertexNormalModelspace");
         m_3DBatchColorID = glGetAttribLocation(m_3DBatchProID, "barColor");
 #if !defined MACOSX
-        //check whether the texture array is support
-        mbTexBatchSupport = GLEW_EXT_texture_array;
+        //check whether the texture array is supported
+        mbTexBatchSupport = epoxy_has_gl_extension("GL_EXT_texture_array");
 #endif
         CHECK_GL_ERROR();
         if (mbTexBatchSupport)
@@ -401,7 +401,7 @@ void OpenGL3DRenderer::init()
     m_fViewAngle = 30.0f;
     m_3DProjection = glm::perspective(m_fViewAngle, (float)m_iWidth / (float)m_iHeight, 0.01f, 6000.0f);
 
-    maResources.m_b330Support = GLEW_VERSION_3_3;
+    maResources.m_b330Support = epoxy_gl_version() >= 33;
     CHECK_GL_ERROR();
     maResources.LoadShaders();
     maPickingResources.LoadShaders();
index 3182e66de40a27c148c7a42b96845f978395308a..91a3763ae64009400ba1921b168ae2e5547973fb 100644 (file)
@@ -7,7 +7,7 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#include <GL/glew.h>
+#include <epoxy/gl.h>
 #include <vector>
 #include "OpenGLRender.hxx"
 #include <vcl/graph.hxx>
index df1d88042f6affb3fe03bbbc3b07cf50b5cf3c47..4078445c4a64d2ec25be6c0d10563bfc892adefd 100644 (file)
@@ -203,8 +203,8 @@ export GIO_LIBS=$(gb_SPACE)@GIO_LIBS@
 export GIT_REFERENCE_SRC=@GIT_REFERENCE_SRC@
 export GIT_LINK_SRC=@GIT_LINK_SRC@
 export GIT_NEEDED_SUBMODULES=@GIT_NEEDED_SUBMODULES@
-export GLEW_CFLAGS=$(gb_SPACE)@GLEW_CFLAGS@
-export GLEW_LIBS=$(gb_SPACE)@GLEW_LIBS@
+export EPOXY_CFLAGS=$(gb_SPACE)@EPOXY_CFLAGS@
+export EPOXY_LIBS=$(gb_SPACE)@EPOXY_LIBS@
 export GLM_CFLAGS=$(gb_SPACE)@GLM_CFLAGS@
 export GNOMEVFS_CFLAGS=$(gb_SPACE)@GNOMEVFS_CFLAGS@
 export GNOMEVFS_LIBS=$(gb_SPACE)@GNOMEVFS_LIBS@
@@ -513,7 +513,7 @@ export SYSTEM_FIREBIRD=@SYSTEM_FIREBIRD@
 export SYSTEM_GENBRK=@SYSTEM_GENBRK@
 export SYSTEM_GENCCODE=@SYSTEM_GENCCODE@
 export SYSTEM_GENCMN=@SYSTEM_GENCMN@
-export SYSTEM_GLEW=@SYSTEM_GLEW@
+export SYSTEM_EPOXY=@SYSTEM_EPOXY@
 export SYSTEM_GLM=@SYSTEM_GLM@
 export SYSTEM_GRAPHITE=@SYSTEM_GRAPHITE@
 export SYSTEM_HARFBUZZ=@SYSTEM_HARFBUZZ@
diff --git a/config_host/config_opengl.h.in b/config_host/config_opengl.h.in
deleted file mode 100644 (file)
index 67b9e47..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-/*
-Settings for OpenGL
-*/
-
-#ifndef CONFIG_OPENGL_H
-#define CONFIG_OPENGL_H
-
-#define HAVE_GLEW_1_12 0
-
-#endif
index 4b44d6ad12a490cc69443a76875637ece6723f7a..7f940def08c37f9009bd556bc8f152ab6cfad51c 100644 (file)
Binary files a/configure.ac and b/configure.ac differ
index 6a63a1d8d8b9afcb674586b0b78848292d96f4ae..64f7844e8ecdaedeb039383b1fee1b7bcbd106c4 100644 (file)
@@ -72,7 +72,7 @@ $(eval $(call gb_Library_use_externals,cui,\
 ))
 ifeq ($(ENABLE_HEADLESS),)
 $(eval $(call gb_Library_use_externals,cui,\
-     glew \
+     epoxy \
  ))
 endif
 
index a7a0c73d013110bc49121ae066265c544ef48bb0..d85e8ea59bf10b4a9a34e011ff293c9ad795d877 100644 (file)
@@ -11,7 +11,6 @@
 --without-system-coinmp
 --without-system-cppunit
 --without-system-firebird
---without-system-glew
 --without-system-glm
 --without-system-libabw
 --without-system-libcdr
index 4c6761285841f2a6fb6a052a3c2feeec32c200a0..49d659a214d94f0c2234b76733cbc0452374aea2 100644 (file)
@@ -29,6 +29,8 @@ export CURL_TARBALL := curl-7.52.1.tar.gz
 export DBGHELP_DLL := 13fbc2e8b37ddf28181dd6d8081c2b8e-dbghelp.dll
 export EBOOK_MD5SUM := 6b48eda57914e6343efebc9381027b78
 export EBOOK_TARBALL := libe-book-0.1.2.tar.bz2
+export EPOXY_MD5SUM := 96f6620a9b005a503e7b44b0b528287d
+export EPOXY_TARBALL := libepoxy-1.3.1.tar.bz2
 export EPM_TARBALL := 3ade8cfe7e59ca8e65052644fed9fca4-epm-3.7.tar.gz
 export ETONYEK_MD5SUM := 77ff46936dcc83670557274e7dd2aa33
 export ETONYEK_VERSION_MICRO := 6
@@ -54,7 +56,6 @@ export FONT_EMOJIONE_COLOR_TARBALL := EmojiOneColor-SVGinOT-1.3.tar.gz
 export FREEHAND_MD5SUM := 8cf70c5dc4d24d2dc4a107f509d2d6d7
 export FREEHAND_TARBALL := libfreehand-0.1.1.tar.bz2
 export FREETYPE_TARBALL := dbf2caca1d3afd410a29217a9809d397-freetype-2.4.8.tar.bz2
-export GLEW_TARBALL := 3941e9cab2f4f9d8faee3e8d57ae7664-glew-1.12.0.zip
 export GLM_TARBALL := bae83fa5dc7f081768daace6e199adc3-glm-0.9.4.6-libreoffice.zip
 export GRAPHITE_MD5SUM := 9c499b8ec9f1b81fd0bb6a3b986f4b0f
 export GRAPHITE_TARBALL := graphite2-minimal-1.3.10.tgz
@@ -89,8 +90,8 @@ export LIBATOMIC_OPS_TARBALL := libatomic_ops-7_2d.zip
 export LIBEOT_MD5SUM := aa24f5dd2a2992f4a116aa72af817548
 export LIBEOT_TARBALL := libeot-0.01.tar.bz2
 export LIBEXTTEXTCAT_TARBALL := 10d61fbaa6a06348823651b1bd7940fe-libexttextcat-3.4.4.tar.bz2
-export LIBGLTF_MD5SUM := d63a9f47ab048f5009d90693d6aa6424
-export LIBGLTF_TARBALL := libgltf-0.0.2.tar.bz2
+export LIBGLTF_MD5SUM := 63ae962d0c436909979826fce0fca2fd
+export LIBGLTF_TARBALL := libgltf-0.1.0.tar.gz
 export LIBLANGTAG_MD5SUM := 284f120247323a35122ab32b4b359c45
 export LIBLANGTAG_TARBALL := liblangtag-0.6.2.tar.bz2
 export LIBTOMMATH_MD5SUM := da283d2e3e72137d0c600ac36b991c9d
index 5d536cdab2171ab021a11438d3990b7a80ad4091..30eab6c81b481108e876b3bb51a9e08fa037afc0 100644 (file)
@@ -38,13 +38,13 @@ $(eval $(call gb_Module_add_moduledirs,external,\
        $(call gb_Helper_optional,CURL,curl) \
        $(call gb_Helper_optional,EBOOK,libebook) \
        $(call gb_Helper_optional,EPM,epm) \
+       $(call gb_Helper_optional,EPOXY,epoxy) \
        $(call gb_Helper_optional,ETONYEK,libetonyek) \
        $(call gb_Helper_optional,EXPAT,expat) \
        $(call gb_Helper_optional,FIREBIRD,firebird) \
        $(call gb_Helper_optional,FONTCONFIG,fontconfig) \
        $(call gb_Helper_optional,FREEHAND,libfreehand) \
        $(call gb_Helper_optional,FREETYPE,freetype) \
-       $(call gb_Helper_optional,GLEW,glew) \
        $(call gb_Helper_optional,GLM,glm) \
        $(call gb_Helper_optional,GRAPHITE,graphite) \
        $(call gb_Helper_optional,HARFBUZZ,harfbuzz) \
diff --git a/external/epoxy/Library_epoxy.mk b/external/epoxy/Library_epoxy.mk
new file mode 100644 (file)
index 0000000..10be001
--- /dev/null
@@ -0,0 +1,74 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Library_Library,epoxy))
+
+$(eval $(call gb_Library_use_unpacked,epoxy,epoxy))
+
+$(eval $(call gb_Library_set_warnings_not_errors,epoxy))
+
+$(eval $(call gb_Library_set_include,epoxy,\
+       -I$(WORKDIR)/UnpackedTarball/epoxy/include \
+       -I$(WORKDIR)/UnpackedTarball/epoxy/src \
+       $$(INCLUDE) \
+))
+
+# epoxy is riddled with warnings... let's spare use
+# the pointless spamming
+$(eval $(call gb_Library_add_cxxflags,epoxy,\
+       -w \
+))
+$(eval $(call gb_Library_add_cflags,epoxy,\
+       -w \
+))
+
+ifeq ($(OS),LINUX)
+$(eval $(call gb_Library_add_libs,epoxy,\
+       -ldl \
+))
+endif
+
+$(eval $(call gb_Library_add_generated_cobjects,epoxy,\
+       UnpackedTarball/epoxy/src/dispatch_common \
+       UnpackedTarball/epoxy/src/gl_generated_dispatch \
+))
+
+ifeq ($(OS),WNT)
+$(eval $(call gb_Library_add_generated_cobjects,epoxy,\
+       UnpackedTarball/epoxy/src/dispatch_wgl \
+       UnpackedTarball/epoxy/src/wgl_generated_dispatch \
+))
+else ifeq ($(OS),MACOSX)
+# nothing
+else ifeq ($(OS),ANDROID)
+$(eval $(call gb_Library_add_generated_cobjects,epoxy,\
+       UnpackedTarball/epoxy/src/dispatch_egl \
+       UnpackedTarball/epoxy/src/egl_generated_dispatch \
+))
+else
+$(eval $(call gb_Library_add_generated_cobjects,epoxy,\
+       UnpackedTarball/epoxy/src/dispatch_glx \
+       UnpackedTarball/epoxy/src/glx_generated_dispatch \
+))
+ifeq ($(ENABLE_GTK3),TRUE)
+$(eval $(call gb_Library_add_cflags,epoxy,\
+       -DPLATFORM_HAS_EGL=1 \
+))
+$(eval $(call gb_Library_add_generated_cobjects,epoxy,\
+       UnpackedTarball/epoxy/src/dispatch_egl \
+       UnpackedTarball/epoxy/src/egl_generated_dispatch \
+))
+else
+$(eval $(call gb_Library_add_cflags,epoxy,\
+       -DPLATFORM_HAS_EGL=0 \
+))
+endif
+endif
+
+# vim: set noet sw=4 ts=4:
diff --git a/external/epoxy/Makefile b/external/epoxy/Makefile
new file mode 100644 (file)
index 0000000..e4968cf
--- /dev/null
@@ -0,0 +1,7 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
diff --git a/external/epoxy/Module_epoxy.mk b/external/epoxy/Module_epoxy.mk
new file mode 100644 (file)
index 0000000..ea65176
--- /dev/null
@@ -0,0 +1,17 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,epoxy))
+
+$(eval $(call gb_Module_add_targets,epoxy,\
+       Library_epoxy \
+       UnpackedTarball_epoxy \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/external/epoxy/README b/external/epoxy/README
new file mode 100644 (file)
index 0000000..8bd467a
--- /dev/null
@@ -0,0 +1,5 @@
+Epoxy is an OpenGL Extension Wrangler
+
+Epoxy is a library for handling OpenGL function pointer management for you
+
+https://github.com/anholt/libepoxy
diff --git a/external/epoxy/UnpackedTarball_epoxy.mk b/external/epoxy/UnpackedTarball_epoxy.mk
new file mode 100644 (file)
index 0000000..0d51548
--- /dev/null
@@ -0,0 +1,21 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,epoxy))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,epoxy,$(EPOXY_TARBALL)))
+
+$(eval $(call gb_UnpackedTarball_set_patchlevel,epoxy,0))
+
+$(eval $(call gb_UnpackedTarball_add_patches,epoxy, \
+    external/epoxy/epoxy.windows.api.patch \
+    external/epoxy/epoxy.noegl.by.default.patch \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/external/epoxy/epoxy.noegl.by.default.patch b/external/epoxy/epoxy.noegl.by.default.patch
new file mode 100644 (file)
index 0000000..d80a3b9
--- /dev/null
@@ -0,0 +1,11 @@
+--- src/dispatch_common.h
++++ src/dispatch_common.h
+@@ -39,7 +39,7 @@
+ #define PLATFORM_HAS_WGL 0
+ #define EPOXY_IMPORTEXPORT
+ #else
+-#define PLATFORM_HAS_EGL 1
++
+ #define PLATFORM_HAS_GLX 1
+ #define PLATFORM_HAS_WGL 0
+ #define EPOXY_IMPORTEXPORT
diff --git a/external/epoxy/epoxy.windows.api.patch b/external/epoxy/epoxy.windows.api.patch
new file mode 100644 (file)
index 0000000..12d2afb
--- /dev/null
@@ -0,0 +1,90 @@
+--- include/epoxy/gl.h
++++ include/epoxy/gl.h
+@@ -59,7 +59,8 @@
+ #else
+ #ifndef APIENTRY
+-#define APIENTRY __stdcall
++#define WINAPI __stdcall
++#define APIENTRY WINAPI
+ #endif
+ #ifndef GLAPIENTRY
+--- src/egl_generated_dispatch.c
++++ src/egl_generated_dispatch.c
+@@ -128,7 +128,11 @@
+ };
+ #if USING_DISPATCH_TABLE
++#if defined (_MSC_VER)
++static __inline struct dispatch_table *
++#else
+ static inline struct dispatch_table *
++#endif
+ get_dispatch_table(void);
+ #endif
+@@ -1642,7 +1646,11 @@
+ uint32_t egl_tls_index;
+ uint32_t egl_tls_size = sizeof(struct dispatch_table);
++#if defined (_MSC_VER)
++static __inline struct dispatch_table *
++#else
+ static inline struct dispatch_table *
++#endif
+ get_dispatch_table(void)
+ {
+       return TlsGetValue(egl_tls_index);
+--- src/gl_generated_dispatch.c
++++ src/gl_generated_dispatch.c
+@@ -3122,7 +3122,11 @@
+ };
+ #if USING_DISPATCH_TABLE
++#if defined (_MSC_VER)
++static __inline struct dispatch_table *
++#else
+ static inline struct dispatch_table *
++#endif
+ get_dispatch_table(void);
+ #endif
+@@ -51507,7 +51511,11 @@
+ uint32_t gl_tls_index;
+ uint32_t gl_tls_size = sizeof(struct dispatch_table);
++#if defined (_MSC_VER)
++static __inline struct dispatch_table *
++#else
+ static inline struct dispatch_table *
++#endif
+ get_dispatch_table(void)
+ {
+       return TlsGetValue(gl_tls_index);
+--- src/wgl_generated_dispatch.c
++++ src/wgl_generated_dispatch.c
+@@ -157,7 +157,11 @@
+ };
+ #if USING_DISPATCH_TABLE
++#if defined (_MSC_VER)
++static __inline struct dispatch_table *
++#else
+ static inline struct dispatch_table *
++#endif
+ get_dispatch_table(void);
+ #endif
+@@ -1701,7 +1705,11 @@
+ uint32_t wgl_tls_index;
+ uint32_t wgl_tls_size = sizeof(struct dispatch_table);
++#if defined (_MSC_VER)
++static __inline struct dispatch_table *
++#else
+ static inline struct dispatch_table *
++#endif
+ get_dispatch_table(void)
+ {
+       return TlsGetValue(wgl_tls_index);
diff --git a/external/glew/ExternalPackage_glew.mk b/external/glew/ExternalPackage_glew.mk
deleted file mode 100644 (file)
index e6adc8b..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-
-$(eval $(call gb_ExternalPackage_ExternalPackage,glew,glew))
-
-$(eval $(call gb_ExternalPackage_use_external_project,glew,glew))
-
-ifeq ($(OS)-$(COM),WNT-MSC)
-ifeq ($(CPUNAME),INTEL)
-glew_arch_subdir=Win32
-else ifeq ($(CPUNAME),X86_64)
-glew_arch_subdir=x64
-endif
-endif
-
-ifeq ($(OS),MACOSX)
-$(eval $(call gb_ExternalPackage_add_file,glew,$(LIBO_LIB_FOLDER)/libGLEW.1.12.0.dylib,lib/libGLEW.1.12.0.dylib))
-else ifeq ($(OS)-$(COM),WNT-GCC)
-else ifeq ($(COM),MSC)
-$(eval $(call gb_ExternalPackage_add_files,glew,$(LIBO_LIB_FOLDER), \
-       bin/$(if $(MSVC_USE_DEBUG_RUNTIME),Debug/$(glew_arch_subdir)/glew32d.dll,Release/$(glew_arch_subdir)/glew32.dll) \
-))
-else ifeq ($(DISABLE_DYNLOADING),)
-$(eval $(call gb_ExternalPackage_add_file,glew,$(LIBO_LIB_FOLDER)/libGLEW.so.1.12,lib/libGLEW.so.1.12.0))
-endif
-
-# vim: set noet sw=4 ts=4:
diff --git a/external/glew/ExternalProject_glew.mk b/external/glew/ExternalProject_glew.mk
deleted file mode 100644 (file)
index 0d80cd0..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-
-$(eval $(call gb_ExternalProject_ExternalProject,glew))
-
-$(eval $(call gb_ExternalProject_register_targets,glew,\
-       build \
-))
-
-ifeq ($(COM),MSC)
-$(call gb_ExternalProject_get_state_target,glew,build) :
-       $(call gb_ExternalProject_run,build,\
-               $(if $(filter 140,$(VCVER)),$(DEVENV) /Upgrade glew.sln,echo up-to-date) && \
-               msbuild.exe glew_shared.vcxproj /p:Platform=$(if $(filter INTEL,$(CPUNAME)),Win32,x64) /p:Configuration=$(if $(MSVC_USE_DEBUG_RUNTIME),Debug,Release) $(if $(filter 140,$(VCVER)),/p:PlatformToolset=v140,/p:PlatformToolset=v120) \
-       ,build/vc12) \
-       $(call gb_ExternalProject_run,build,\
-               msbuild.exe glewinfo.vcxproj /p:Platform=$(if $(filter INTEL,$(CPUNAME)),Win32,x64) /p:Configuration=Release $(if $(filter 140,$(VCVER)),/p:PlatformToolset=v140,/p:PlatformToolset=v120) \
-       ,build/vc12)
-
-else
-
-$(call gb_ExternalProject_get_state_target,glew,build) :
-       $(call gb_ExternalProject_run,glew,\
-               $(if $(ENABLE_DEBUG),STRIP=) LD="$(CC)" \
-                       $(MAKE) STRIP= glew.lib $(if $(filter DESKTOP,$(BUILD_TYPE)),$(if $(ENABLE_DEBUG),debug)) \
-       )
-
-endif
-
-# vim: set noet sw=4 ts=4:
diff --git a/external/glew/Makefile b/external/glew/Makefile
deleted file mode 100644 (file)
index e4968cf..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
-
-module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
-
-include $(module_directory)/../../solenv/gbuild/partial_build.mk
-
-# vim: set noet sw=4 ts=4:
diff --git a/external/glew/Module_glew.mk b/external/glew/Module_glew.mk
deleted file mode 100644 (file)
index 1d1b9a7..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-
-$(eval $(call gb_Module_Module,glew))
-
-$(eval $(call gb_Module_add_targets,glew,\
-       ExternalProject_glew \
-       UnpackedTarball_glew \
-       ExternalPackage_glew \
-))
-
-# vim: set noet sw=4 ts=4:
diff --git a/external/glew/README b/external/glew/README
deleted file mode 100644 (file)
index 34b2d24..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-GLEW is the OpenGL Extension Wrangler
-
-GLEW provides efficient run-time mechanisms for determining which OpenGL
-extensions are supported on the target platform.
-
-http://glew.sourceforge.net/
diff --git a/external/glew/UnpackedTarball_glew.mk b/external/glew/UnpackedTarball_glew.mk
deleted file mode 100644 (file)
index c47b7a0..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-
-$(eval $(call gb_UnpackedTarball_UnpackedTarball,glew))
-
-$(eval $(call gb_UnpackedTarball_set_tarball,glew,$(GLEW_TARBALL)))
-
-$(eval $(call gb_UnpackedTarball_set_patchlevel,glew,0))
-
-$(eval $(call gb_UnpackedTarball_fix_end_of_line,glew,\
-       Makefile \
-       include/GL/glew.h \
-))
-
-ifeq ($(OS)$(COM),WNTMSC)
-$(eval $(call gb_UnpackedTarball_set_patchflags,glew,--binary))
-$(eval $(call gb_UnpackedTarball_add_patches,glew,\
-       external/glew/glew-msvc-disable-sse2.patch.1 \
-))
-else
-$(eval $(call gb_UnpackedTarball_add_patches,glew,\
-       external/glew/glew_use_CC_variable.patch.1 \
-))
-endif
-
-ifeq ($(OS),MACOSX)
-$(eval $(call gb_UnpackedTarball_add_patches,glew,\
-       external/glew/glew-macosx-install-name.patch.1 \
-))
-endif
-
-ifeq ($(DISABLE_DYNLOADING),TRUE)
-$(eval $(call gb_UnpackedTarball_add_patches,glew,\
-       external/glew/glew-static-only.patch.1 \
-))
-endif
-
-$(eval $(call gb_UnpackedTarball_add_patches,glew,\
-       external/glew/glew-tmpdir.patch.1 \
-))
-
-# vim: set noet sw=4 ts=4:
diff --git a/external/glew/glew-macosx-install-name.patch.1 b/external/glew/glew-macosx-install-name.patch.1
deleted file mode 100644 (file)
index 75e8e7f..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
--*- Mode:Diff -*-
-diff -ur glew.org/build/glew.rc glew/build/glew.rc
---- glew/config/Makefile.darwin
-+++ glew/config/Makefile.darwin
-@@ -20,7 +20,7 @@
- LIB.DEVLNK    = lib$(NAME).dylib
- LIB.SHARED    = lib$(NAME).$(SO_VERSION).dylib
- LIB.STATIC    = lib$(NAME).a
--LDFLAGS.SO    = -dynamiclib -install_name $(GLEW_DEST)/lib/$(LIB.SHARED) -current_version $(SO_VERSION) -compatibility_version $(SO_MAJOR)
-+LDFLAGS.SO    = -dynamiclib -install_name @__________________________________________________OOO/$(LIB.SHARED) -current_version $(SO_VERSION) -compatibility_version $(SO_MAJOR)
- LIB.SONAME.MX = lib$(NAME)mx.$(SO_MAJOR).dylib
- LIB.DEVLNK.MX = lib$(NAME)mx.dylib
- LIB.SHARED.MX = lib$(NAME)mx.$(SO_VERSION).dylib
diff --git a/external/glew/glew-msvc-disable-sse2.patch.1 b/external/glew/glew-msvc-disable-sse2.patch.1
deleted file mode 100644 (file)
index 6b07044..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
---- glew/build//vc10/common.props.orig 2014-10-02 15:06:57.027060664 +0200
-+++ glew/build//vc10/common.props      2014-10-02 15:06:59.026060509 +0200
-@@ -10,6 +10,7 @@
-   <ItemDefinitionGroup>
-     <ClCompile>
-       <AdditionalIncludeDirectories>$(INCLUDE_DIR)</AdditionalIncludeDirectories>
-+      <EnableEnhancedInstructionSet>StreamingSIMDExtensions</EnableEnhancedInstructionSet>
-     </ClCompile>
-   </ItemDefinitionGroup>
-   <ItemGroup>
diff --git a/external/glew/glew-static-only.patch.1 b/external/glew/glew-static-only.patch.1
deleted file mode 100644 (file)
index 14ccff2..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
--*- Mode:Diff -*-
---- glew/Makefile
-+++ glew/Makefile
-@@ -93,7 +93,7 @@
- LIB.SOBJS.MX       := $(addprefix tmp/$(SYSTEM)/mx/shared/,$(LIB.SRCS.NAMES))
- LIB.SOBJS.MX       := $(LIB.SOBJS.MX:.c=.o)
--glew.lib: lib lib/$(LIB.SHARED) lib/$(LIB.STATIC) glew.pc
-+glew.lib: lib lib/$(LIB.STATIC)
- lib:
-       mkdir lib
diff --git a/external/glew/glew-tmpdir.patch.1 b/external/glew/glew-tmpdir.patch.1
deleted file mode 100644 (file)
index 9a2847b..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-diff -ur glew.org/Makefile glew/Makefile
---- glew.org/Makefile  2016-05-02 06:25:53.521291677 +0200
-+++ glew/Makefile      2016-05-02 06:31:10.325035494 +0200
-@@ -55,7 +55,8 @@
- DIST_SRC_TGZ ?= $(shell pwd)/$(DIST_NAME).tgz
- DIST_WIN32   ?= $(shell pwd)/$(DIST_NAME)-win32.zip
--DIST_DIR := $(shell mktemp -d /tmp/glew.XXXXXX)/$(DIST_NAME)
-+TMPDIR ?= /tmp
-+DIST_DIR := $(shell mktemp -d $(TMPDIR)/glew.XXXXXX)/$(DIST_NAME)
- # To disable stripping of binaries either:
- #   - use STRIP= on gmake command-line
diff --git a/external/glew/glew_use_CC_variable.patch.1 b/external/glew/glew_use_CC_variable.patch.1
deleted file mode 100644 (file)
index 56e9903..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-Use CC variable from environment, don't hardcode "cc".
-
---- glew/config/Makefile.linux.orig    2014-01-29 15:39:43.364972925 +0100
-+++ glew/config/Makefile.linux 2014-01-29 15:44:45.621000941 +0100
-@@ -1,6 +1,6 @@
- NAME = $(GLEW_NAME)
--CC = cc
--LD = cc
-+CC ?= cc
-+LD ?= $(CC)
- M_ARCH ?= $(shell uname -m)
- ARCH64 = false
- ifeq (x86_64,${M_ARCH})
---- glew/config/Makefile.darwin.orig   2014-01-29 15:44:39.541000377 +0100
-+++ glew/config/Makefile.darwin        2014-01-29 15:44:47.548001120 +0100
-@@ -1,6 +1,6 @@
- NAME = $(GLEW_NAME)
--CC = cc
--LD = cc
-+CC ?= cc
-+LD ?= $(CC)
- CFLAGS.EXTRA = -dynamic -fno-common
- #CFLAGS.EXTRA += -no-cpp-precomp
- LDFLAGS.EXTRA =
index 57c01d048208188ba7889edf34ce61a60ac0d1d4..90a1d967ac27221041ef357c3c367aeb2ae54cc0 100644 (file)
@@ -17,7 +17,7 @@ $(eval $(call gb_ExternalProject_register_targets,libgltf,\
 
 $(eval $(call gb_ExternalProject_use_externals,libgltf,\
        boost_headers \
-       glew \
+       epoxy \
        glm_headers \
 ))
 
@@ -30,8 +30,8 @@ ifeq ($(SYSTEM_BOOST),)
 libgltf_AdditionalIncludes += "$(call gb_UnpackedTarball_get_dir,boost)"
 endif
 
-ifeq ($(SYSTEM_GLEW),)
-libgltf_AdditionalIncludes += "$(call gb_UnpackedTarball_get_dir,glew)/include"
+ifeq ($(SYSTEM_EPOXY),)
+libgltf_AdditionalIncludes += "$(call gb_UnpackedTarball_get_dir,epoxy)/include"
 endif
 
 ifeq ($(SYSTEM_GLM),)
@@ -45,7 +45,7 @@ $(call gb_ExternalProject_get_state_target,libgltf,build) :
                        $(if $(filter 120,$(VCVER)),/p:PlatformToolset=v120 /p:VisualStudioVersion=12.0 /ToolsVersion:12.0) \
                        $(if $(filter 140,$(VCVER)),/p:PlatformToolset=v140 /p:VisualStudioVersion=14.0 /ToolsVersion:14.0) \
                        '/p:AdditionalIncludeDirectories=$(subst $(WHITESPACE),;,$(subst /,\,$(strip $(libgltf_AdditionalIncludes))))' \
-                       /p:AdditionalLibraryDirectories=$(if $(SYSTEM_GLEW),,"$(subst /,\,$(call gb_UnpackedTarball_get_dir,glew))\lib\$(if $(MSVC_USE_DEBUG_RUNTIME),Debug,Release)\Win32") \
+                       /p:AdditionalLibraryDirectories=$(if $(SYSTEM_EPOXY),,"$(subst /,\,$(call gb_UnpackedTarball_get_dir,epoxy))\lib\$(if $(MSVC_USE_DEBUG_RUNTIME),Debug,Release)\Win32") \
        ,build/win32)
 
 else # !ifeq($(COM),MSC)
@@ -67,7 +67,7 @@ $(call gb_ExternalProject_get_state_target,libgltf,build) :
                        $(if $(ENABLE_DEBUG),--enable-debug,--disable-debug) \
                        --disable-werror \
                        BOOST_CFLAGS="$(BOOST_CPPFLAGS)" \
-                       GLEW_CFLAGS="$(if $(SYSTEM_GLEW),$(GLEW_CFLAGS),-I$(call gb_UnpackedTarball_get_dir,glew)/include) -DGLEW_NO_GLU" \
+                       EPOXY_CFLAGS="$(if $(SYSTEM_EPOXY),$(EPOXY_CFLAGS),-I$(call gb_UnpackedTarball_get_dir,epoxy)/include)" \
                        GLM_CFLAGS="$(if $(SYSTEM_GLM),$(GLM_CFLAGS),-I$(call gb_UnpackedTarball_get_dir,glm))" \
                        $(if $(libgltf_CPPFLAGS),CPPFLAGS='$(libgltf_CPPFLAGS)') \
                && $(MAKE) \
index 86417a752605324e105256be0a32df16859767be..32a831bebd5ca362bd0ed2365fe05d86214db7ef 100644 (file)
@@ -20,7 +20,7 @@ diff -ur libgltf.org/build/win32/libgltf.vcxproj libgltf/build/win32/libgltf.vcx
    </ItemGroup>
    <ItemGroup>
      <ClInclude Include="..\..\inc\libgltf.h" />
-@@ -56,6 +64,12 @@
+@@ -53,6 +61,12 @@
      <CharacterSet>MultiByte</CharacterSet>
      <PlatformToolset>v110</PlatformToolset>
    </PropertyGroup>
@@ -33,7 +33,7 @@ diff -ur libgltf.org/build/win32/libgltf.vcxproj libgltf/build/win32/libgltf.vcx
    <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
      <ConfigurationType>StaticLibrary</ConfigurationType>
      <UseDebugLibraries>false</UseDebugLibraries>
-@@ -63,15 +77,28 @@
+@@ -60,15 +74,28 @@
      <CharacterSet>MultiByte</CharacterSet>
      <PlatformToolset>v110</PlatformToolset>
    </PropertyGroup>
@@ -62,8 +62,8 @@ diff -ur libgltf.org/build/win32/libgltf.vcxproj libgltf/build/win32/libgltf.vcx
    <PropertyGroup Label="UserMacros" />
    <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
      <ClCompile>
-@@ -86,6 +113,19 @@
-       <AdditionalDependencies>opengl32.lib;glew32.lib;$(AdditionalDependencies)</AdditionalDependencies>
+@@ -83,10 +110,42 @@
+       <AdditionalDependencies>opengl32.lib;epoxy32.lib;$(AdditionalDependencies)</AdditionalDependencies>
      </Link>
    </ItemDefinitionGroup>
 +  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
@@ -76,20 +76,13 @@ diff -ur libgltf.org/build/win32/libgltf.vcxproj libgltf/build/win32/libgltf.vcx
 +    <Link>
 +      <GenerateDebugInformation>true</GenerateDebugInformation>
 +      <AdditionalLibraryDirectories>$(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
-+      <AdditionalDependencies>opengl32.lib;glew32.lib;$(AdditionalDependencies)</AdditionalDependencies>
++      <AdditionalDependencies>opengl32.lib;epoxy32.lib;$(AdditionalDependencies)</AdditionalDependencies>
 +    </Link>
 +  </ItemDefinitionGroup>
    <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
      <ClCompile>
        <WarningLevel>Level4</WarningLevel>
-@@ -105,6 +145,25 @@
-       <SubSystem>Windows</SubSystem>
-     </Link>
-   </ItemDefinitionGroup>
-+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-+    <ClCompile>
-+      <WarningLevel>Level4</WarningLevel>
-+      <Optimization>MaxSpeed</Optimization>
+       <Optimization>MaxSpeed</Optimization>
 +      <EnableEnhancedInstructionSet>StreamingSIMDExtensions</EnableEnhancedInstructionSet>
 +      <FunctionLevelLinking>true</FunctionLevelLinking>
 +      <IntrinsicFunctions>true</IntrinsicFunctions>
@@ -101,10 +94,14 @@ diff -ur libgltf.org/build/win32/libgltf.vcxproj libgltf/build/win32/libgltf.vcx
 +      <EnableCOMDATFolding>true</EnableCOMDATFolding>
 +      <OptimizeReferences>true</OptimizeReferences>
 +      <AdditionalLibraryDirectories>$(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
-+      <AdditionalDependencies>opengl32.lib;glew32.lib;$(AdditionalDependencies)</AdditionalDependencies>
++      <AdditionalDependencies>opengl32.lib;epoxy32.lib;$(AdditionalDependencies)</AdditionalDependencies>
 +      <SubSystem>Windows</SubSystem>
 +    </Link>
 +  </ItemDefinitionGroup>
-   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-   <ImportGroup Label="ExtensionTargets">
-   </ImportGroup>
++  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
++    <ClCompile>
++      <WarningLevel>Level4</WarningLevel>
++      <Optimization>MaxSpeed</Optimization>
+       <EnableEnhancedInstructionSet>StreamingSIMDExtensions</EnableEnhancedInstructionSet>
+       <FunctionLevelLinking>true</FunctionLevelLinking>
+       <IntrinsicFunctions>true</IntrinsicFunctions>
index e3e9ce0d2d838963e2e88a80ac065f471a3f43bd..ffcd816160ea86be0979ccd030a472848a7f2fe9 100644 (file)
@@ -12,7 +12,7 @@
 
 #include <string.h>
 
-#include <GL/glew.h>
+#include <epoxy/gl.h>
 
 #include <vcl/dllapi.h>
 #include <vcl/window.hxx>
@@ -158,8 +158,8 @@ private:
     virtual void destroyCurrentContext();
 
 protected:
-    bool InitGLEW();
-    static void InitGLEWDebugging();
+    bool InitGL();
+    static void InitGLDebugging();
     static void InitChildWindow(SystemChildWindow *pChildWindow);
     static void BuffersSwapped();
     virtual GLWindow& getModifiableOpenGLWindow() = 0;
index 458021f4ca277759bf8c90ba6c40adda82b04807..23b9b79a361cbe4e50b907225ad1a63d19310c77 100644 (file)
@@ -10,7 +10,7 @@
 #ifndef INCLUDED_VCL_OPENGL_OPENGLHELPER_HXX
 #define INCLUDED_VCL_OPENGL_OPENGLHELPER_HXX
 
-#include <GL/glew.h>
+#include <epoxy/gl.h>
 #include <sal/log.hxx>
 #include <vcl/dllapi.h>
 #include <vcl/bitmapex.hxx>
index 3b7f6a7e91da349ccb8ad864d7065e74a79533b5..e9fb967f8837a332f56d7655ebbf68f830b1b3c3 100644 (file)
@@ -7,7 +7,7 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-// Fully wrapped methods that have no exotic GL / GLEW header deps.
+// Fully wrapped methods that have no exotic GL header deps.
 
 #ifndef INCLUDED_VCL_OPENGL_OPENGLWRAPPER_HXX
 #define INCLUDED_VCL_OPENGL_OPENGLWRAPPER_HXX
index b908a0bb36504e48282f980b9ade514703ded0e4..fb04596cb7baa3ff5df602ae17cec92966188253 100644 (file)
@@ -34,7 +34,7 @@ $(eval $(call gb_Library_use_libraries,OGLTrans,\
 
 $(eval $(call gb_Library_use_externals,OGLTrans,\
        boost_headers \
-       glew \
+       epoxy \
        glm_headers \
 ))
 
@@ -56,13 +56,6 @@ $(eval $(call gb_Library_use_system_win32_libs,OGLTrans,\
     opengl32 \
 ))
 
-else
-
-$(eval $(call gb_Library_add_libs,OGLTrans,\
-       -lGL \
-       -lX11 \
-))
-
 endif
 
 $(eval $(call gb_Library_add_exception_objects,OGLTrans,\
index 3a9aac6ad245fdf2dc84045e5da4f54836e591f7..0583f5e5f10a69630e97741b141c210083d32e96 100644 (file)
@@ -31,7 +31,7 @@ $(eval $(call gb_Library_use_externals,slideshow,\
 ))
 ifeq ($(ENABLE_HEADLESS),)
 $(eval $(call gb_Library_use_externals,slideshow,\
-     glew \
+     epoxy \
  ))
 endif
 
index 60ab587471ae5e001c927191cae75e081f85a062..115aaf286ca4dc3d4f124ec3da34ac4aad5510f5 100644 (file)
@@ -26,7 +26,6 @@
  *
  ************************************************************************/
 
-#include <GL/glew.h>
 #include <glm/gtc/matrix_transform.hpp>
 #include <glm/gtc/type_ptr.hpp>
 #include <vcl/opengl/OpenGLHelper.hxx>
index 66ecb6b61a0c927086af534d922e46035403cd1c..cf34955a5bbb5973ca74436baa2acef1eb7bee18 100644 (file)
@@ -31,8 +31,6 @@
 #include <config_lgpl.h>
 #include <glm/gtc/type_ptr.hpp>
 
-#include <GL/glew.h>
-
 #include <memory>
 #include <vector>
 
index 61a28e9422ff595ec9e90184caca73b3e798d4fc..1434b037cec26853ec8445f57755c5a7ed3095d7 100644 (file)
@@ -830,7 +830,7 @@ void buildMipmaps(
     GLint internalFormat, GLsizei width, GLsizei height, GLenum format,
     GLenum type, const void * data)
 {
-    if (GLEW_ARB_framebuffer_object) {
+    if (epoxy_has_gl_extension("GL_ARB_framebuffer_object")) {
         glTexImage2D(
             GL_TEXTURE_2D, 0, internalFormat, width, height, 0, format, type,
             data);
index 557c427c8a5abfbcb035dc8d1956782c30857fb4..48ecf228ba834b7e4eba816f9e500e9f4624e56c 100644 (file)
@@ -88,7 +88,7 @@ $(eval $(call gb_Library_use_externals,svxcore,\
 ))
 ifeq ($(ENABLE_HEADLESS),)
 $(eval $(call gb_Library_use_externals,svxcore,\
-     glew \
+     epoxy \
  ))
 endif
 
index 27bd721922267e98de6857276d7268c725ea977e..b9a42d3c97aed0964c5df7215677d534e80df888 100644 (file)
@@ -27,7 +27,7 @@ $(eval $(call gb_Library_use_externals,tk,\
 
 ifeq ($(ENABLE_HEADLESS),)
 $(eval $(call gb_Library_use_externals,tk,\
-    glew \
+    epoxy \
 ))
 endif
 $(eval $(call gb_Library_set_include,tk,\
index 879c7ac5eaa954c8f3daf8b97ef75ad2cc8b2546..70ce156889dc5a3aa0b988e1539187d8092810a2 100644 (file)
@@ -19,7 +19,7 @@ $(eval $(call gb_CppunitTest_use_externals,vcl_bitmap_test,\
 ))
 ifeq ($(ENABLE_HEADLESS),)
 $(eval $(call gb_CppunitTest_use_externals,vcl_bitmap_test,\
-     glew \
+     epoxy \
  ))
 endif
 
index 44d685118d02dc48df78617b30a50a713cc1ff15..3b781476ae32bbe0ea1ef2b8c556372f5aae5c64 100644 (file)
@@ -87,7 +87,7 @@ $(eval $(call gb_CppunitTest_use_externals,vcl_wmf_test,\
 ))
 ifeq ($(ENABLE_HEADLESS),)
 $(eval $(call gb_CppunitTest_use_externals,vcl_wmf_test,\
-     glew \
+     epoxy \
  ))
 endif
 
@@ -136,7 +136,6 @@ $(eval $(call gb_CppunitTest_add_libs,vcl_wmf_test,\
     -lm \
     -ldl \
     -lpthread \
-    -lGL \
     -lX11 \
 ))
 endif
@@ -189,7 +188,6 @@ ifeq ($(OS), $(filter LINUX %BSD SOLARIS, $(OS)))
 $(eval $(call gb_CppunitTest_add_libs,vcl_wmf_test,\
     -lm $(DLOPEN_LIBS) \
     -lpthread \
-    -lGL \
     -lX11 \
     -lXext \
 ))
index 102697b0daa2c2b58433e0e89c153188197eea49..cce8feb48a2000a8e9eb8ab5ea69dbd4960bd3d4 100644 (file)
@@ -15,7 +15,7 @@ $(eval $(call gb_Executable_use_externals,icontest,\
 ))
 ifeq ($(ENABLE_HEADLESS),)
 $(eval $(call gb_Executable_use_externals,icontest,\
-    glew \
+    epoxy \
 ))
 endif
 
index bff091e2afebc04e9b96993239dc88181b3de9c1..a09d3b4936e1ddef4a69adddcff86e31334787bf 100644 (file)
@@ -21,7 +21,7 @@ $(eval $(call gb_Executable_use_externals,vcldemo,\
 ))
 ifeq ($(ENABLE_HEADLESS),)
 $(eval $(call gb_Executable_use_externals,vcldemo,\
-    glew \
+    epoxy \
 ))
 endif
 
index abf8cbe1429b74a0a5db716f21cbaef4bf7b9db9..87044535f03ea0bc9dd91dbd34d79fdc552cc0e7 100644 (file)
@@ -46,7 +46,6 @@ $(eval $(call gb_Executable_add_libs,visualbackendtest,\
        -lm \
        -ldl \
        -lpthread \
-    -lGL \
     -lX11 \
 ))
 
index a52938b2e928d700351d480ff67101957743480f..a911329204420836ae5ae296a98c34d5eb8ba358 100644 (file)
@@ -124,7 +124,7 @@ $(eval $(call gb_Library_use_externals,vcl,\
 ))
 ifeq ($(ENABLE_HEADLESS),)
 $(eval $(call gb_Library_use_externals,vcl,\
-     glew \
+     epoxy \
  ))
 endif
 
@@ -648,7 +648,6 @@ $(eval $(call gb_Library_add_libs,vcl,\
        -lm \
        -ldl \
        -lpthread \
-    -lGL \
     -lX11 \
 ))
 endif
index f281605d6bd7961f51f435013af103993bdaa43a..0e1c39c15766f2a0ac33bd1eb05d2ab41acb0f4c 100644 (file)
@@ -51,7 +51,7 @@ $(eval $(call gb_Library_use_externals,vclplug_gen,\
        boost_headers \
        cairo \
        graphite \
-       glew \
+       epoxy \
        glm_headers \
        harfbuzz \
        icu_headers \
@@ -65,7 +65,6 @@ $(eval $(call gb_Library_add_libs,vclplug_gen,\
        -lXext \
        -lSM \
        -lICE \
-       -lGL \
 ))
 
 $(eval $(call gb_Library_add_exception_objects,vclplug_gen,\
index c32a127e6b177c0ab484a24faeb65a1b103c55ad..67247b73d6425ceb14c5a2fd0bde3b7932e37dcc 100644 (file)
@@ -59,7 +59,7 @@ $(eval $(call gb_Library_use_externals,vclplug_gtk,\
        cairo \
        dbus \
        gio \
-       glew \
+       epoxy \
        gtk \
        gthread \
        icuuc \
index 8d013d93e3695758097f277d41a48263d181d0d1..1457c1abcf9ff78747992807652795e6ca356e87 100644 (file)
@@ -75,7 +75,7 @@ $(eval $(call gb_Library_use_libraries,vclplug_gtk3,\
 
 $(eval $(call gb_Library_use_externals,vclplug_gtk3,\
        boost_headers \
-       glew \
+       epoxy \
        dbus \
 ))
 
index 30c40696142782fb7dfb8de135b3dd817dbd1d20..acd7bd5981da5328310bafa0cf7258ef8550210f 100644 (file)
@@ -54,7 +54,7 @@ $(eval $(call gb_Library_use_externals,vclplug_kde4,\
        boost_headers \
        icuuc \
        kde4 \
-       glew \
+       epoxy \
 ))
 
 $(eval $(call gb_Library_add_libs,vclplug_kde4,\
index 58ae6a80910456fe54597bd5e8f2896c19abbe68..e3f375bb3dce73c7ea938a7ba7f77d6648796cd1 100644 (file)
@@ -11,7 +11,6 @@
 #ifndef INCLUDED_VCL_INC_OPENGL_LINERENDERUTILS_H
 #define INCLUDED_VCL_INC_OPENGL_LINERENDERUTILS_H
 
-#include <GL/glew.h>
 #include "opengl/VertexUtils.hxx"
 #include "opengl/RenderList.hxx"
 
index f9804ecd978f3df700ab2594849998a464c0a82d..de2c070abcc912ac05b04280293e3d532b40d64b 100644 (file)
@@ -12,7 +12,7 @@
 #define INCLUDED_VCL_INC_OPENGL_VERTEXUTILS_H
 
 #include <basegfx/numeric/ftools.hxx>
-#include <GL/glew.h>
+#include <epoxy/gl.h>
 #include <glm/gtx/norm.hpp>
 #include <vcl/salgtype.hxx>
 #include <vector>
index ec7a45099df7ff0002ebd0249aae65a138e40094..a2dbd1e632829ca5f42ee71347db824660d8b52e 100644 (file)
@@ -10,7 +10,6 @@
 #ifndef INCLUDED_VCL_INC_OPENGL_FRAMEBUFFER_H
 #define INCLUDED_VCL_INC_OPENGL_FRAMEBUFFER_H
 
-#include <GL/glew.h>
 #include <vcl/dllapi.h>
 
 #include <opengl/texture.hxx>
index 73cdb7fda6e782c4b0f58a54a2fafd942e0bc9bc..4632ddf4444424f7497ec72bcfaf7c06c405a379 100644 (file)
@@ -14,7 +14,6 @@
 
 #include <list>
 
-#include <GL/glew.h>
 #include <vcl/dllapi.h>
 
 #include <basegfx/point/b2dpoint.hxx>
index a0c80295f226a5afdf3badd136cc7d15c2df1e4b..fd4eb9724648527869205914c66e012ebe7f8c84 100644 (file)
@@ -20,7 +20,7 @@
 #ifndef INCLUDED_VCL_INC_OPENGL_TEXTURE_H
 #define INCLUDED_VCL_INC_OPENGL_TEXTURE_H
 
-#include <GL/glew.h>
+#include <epoxy/gl.h>
 #include <vcl/dllapi.h>
 #include <vcl/salgtype.hxx>
 #include <rtl/ustring.hxx>
index 6ef9e2a5069e58c918d531817a74df0ec698b280..a356ae8b8d556bdbc9880a16a05eafdbabfe4a29 100644 (file)
@@ -56,6 +56,7 @@
 #include <boost/math/special_functions/sinc.hpp>
 #include <boost/multi_array.hpp>
 #include <boost/optional.hpp>
+#include <epoxy/gl.h>
 #include <osl/conditn.hxx>
 #include <osl/diagnose.h>
 #include <osl/diagnose.hxx>
 #include <vcl/virdev.hxx>
 #include <vcl/window.hxx>
 #include <vcl/wrkwin.hxx>
-#include <GL/glew.h>
 #include <PhysicalFontCollection.hxx>
 #include <PhysicalFontFace.hxx>
 #include <PhysicalFontFamily.hxx>
index 64998df08332f26787d49c8cf64d031f1da4cbd1..339ba806d6e8384f409b60b0a1f17c5c23c6bf3f 100644 (file)
@@ -28,7 +28,7 @@ class   SalXLib;
 #include <X11/Xlib.h>
 #include <X11/Xutil.h>
 #include <X11/extensions/Xrender.h>
-#include "GL/glxew.h"
+#include <epoxy/glx.h>
 
 #include <unx/salunx.h>
 #include <unx/saltype.h>
index 240331f677bfae839ec947390e22c37b9b46819c..188a1a167e3cc3c2f0deb797b0e3e1d749831d77 100644 (file)
 #include <win/saldata.hxx>
 #include <win/salframe.h>
 #include <win/salinst.h>
-#include <GL/wglew.h>
+#include <epoxy/wgl.h>
 
 static std::vector<HGLRC> g_vShareList;
+static bool g_bAnyCurrent;
 
 class GLWinWindow : public GLWindow
 {
@@ -70,6 +71,7 @@ void WinOpenGLContext::resetCurrent()
     OpenGLZone aZone;
 
     wglMakeCurrent(nullptr, nullptr);
+    g_bAnyCurrent = false;
 }
 
 bool WinOpenGLContext::isCurrent()
@@ -81,7 +83,7 @@ bool WinOpenGLContext::isCurrent()
 
 bool WinOpenGLContext::isAnyCurrent()
 {
-    return wglGetCurrentContext() != nullptr;
+    return g_bAnyCurrent && wglGetCurrentContext() != nullptr;
 }
 
 void WinOpenGLContext::makeCurrent()
@@ -95,10 +97,13 @@ void WinOpenGLContext::makeCurrent()
 
     if (!wglMakeCurrent(m_aGLWin.hDC, m_aGLWin.hRC))
     {
+        g_bAnyCurrent = false;
         SAL_WARN("vcl.opengl", "wglMakeCurrent failed: " << WindowsErrorString(GetLastError()));
         return;
     }
 
+    g_bAnyCurrent = true;
+
     registerAsCurrent();
 }
 
@@ -140,7 +145,10 @@ void WinOpenGLContext::destroyCurrentContext()
             g_vShareList.erase(itr);
 
         if (wglGetCurrentContext() != nullptr)
+        {
             wglMakeCurrent(nullptr, nullptr);
+            g_bAnyCurrent = false;
+        }
         wglDeleteContext( m_aGLWin.hRC );
         ReleaseDC( m_aGLWin.hWnd, m_aGLWin.hDC );
         m_aGLWin.hRC = nullptr;
@@ -208,11 +216,13 @@ bool InitTempWindow(HWND& hwnd, int width, int height, const PIXELFORMATDESCRIPT
     if(!ret)
     {
         wglMakeCurrent(nullptr, nullptr);
+        g_bAnyCurrent = false;
         wglDeleteContext(glWin.hRC);
         ReleaseDC(hwnd, glWin.hDC);
         DestroyWindow(hwnd);
         return false;
     }
+    g_bAnyCurrent = false;
 
     return true;
 }
@@ -275,6 +285,7 @@ bool InitMultisample(const PIXELFORMATDESCRIPTOR& pfd, int& rPixelFormat,
     {
         SAL_WARN("vcl.opengl", "Device doesn't support multisample");
         wglMakeCurrent(nullptr, nullptr);
+        g_bAnyCurrent = false;
         wglDeleteContext(glWin.hRC);
         ReleaseDC(hWnd, glWin.hDC);
         DestroyWindow(hWnd);
@@ -285,6 +296,7 @@ bool InitMultisample(const PIXELFORMATDESCRIPTOR& pfd, int& rPixelFormat,
     if (!fn_wglChoosePixelFormatARB)
     {
         wglMakeCurrent(nullptr, nullptr);
+        g_bAnyCurrent = false;
         wglDeleteContext(glWin.hRC);
         ReleaseDC(hWnd, glWin.hDC);
         DestroyWindow(hWnd);
@@ -341,6 +353,7 @@ bool InitMultisample(const PIXELFORMATDESCRIPTOR& pfd, int& rPixelFormat,
         bArbMultisampleSupported = true;
         rPixelFormat = pixelFormat;
         wglMakeCurrent(nullptr, nullptr);
+        g_bAnyCurrent = false;
         wglDeleteContext(glWin.hRC);
         ReleaseDC(hWnd, glWin.hDC);
         DestroyWindow(hWnd);
@@ -355,6 +368,7 @@ bool InitMultisample(const PIXELFORMATDESCRIPTOR& pfd, int& rPixelFormat,
         bArbMultisampleSupported = true;
         rPixelFormat = pixelFormat;
         wglMakeCurrent(nullptr, nullptr);
+        g_bAnyCurrent = false;
         wglDeleteContext(glWin.hRC);
         ReleaseDC(hWnd, glWin.hDC);
         DestroyWindow(hWnd);
@@ -362,6 +376,7 @@ bool InitMultisample(const PIXELFORMATDESCRIPTOR& pfd, int& rPixelFormat,
     }
     // Return the valid format
     wglMakeCurrent(nullptr, nullptr);
+    g_bAnyCurrent = false;
     wglDeleteContext(glWin.hRC);
     ReleaseDC(hWnd, glWin.hDC);
     DestroyWindow(hWnd);
@@ -542,13 +557,17 @@ bool WinOpenGLContext::ImplInit()
 
     if (!wglMakeCurrent(m_aGLWin.hDC, hTempRC))
     {
+        g_bAnyCurrent = false;
         SAL_WARN("vcl.opengl", "wglMakeCurrent failed: "<< WindowsErrorString(GetLastError()));
         return false;
     }
 
-    if (!InitGLEW())
+    g_bAnyCurrent = true;
+
+    if (!InitGL())
     {
         wglMakeCurrent(NULL, NULL);
+        g_bAnyCurrent = false;
         wglDeleteContext(hTempRC);
         return false;
     }
@@ -560,6 +579,7 @@ bool WinOpenGLContext::ImplInit()
     if (!wglCreateContextAttribsARB)
     {
         wglMakeCurrent(nullptr, nullptr);
+        g_bAnyCurrent = false;
         wglDeleteContext(hTempRC);
         return false;
     }
@@ -578,6 +598,7 @@ bool WinOpenGLContext::ImplInit()
     {
         SAL_WARN("vcl.opengl", "wglCreateContextAttribsARB failed: "<< WindowsErrorString(GetLastError()));
         wglMakeCurrent(nullptr, nullptr);
+        g_bAnyCurrent = false;
         wglDeleteContext(hTempRC);
         return false;
     }
@@ -585,19 +606,24 @@ bool WinOpenGLContext::ImplInit()
     if (!compiledShaderBinariesWork())
     {
         wglMakeCurrent(nullptr, nullptr);
+        g_bAnyCurrent = false;
         wglDeleteContext(hTempRC);
         return false;
     }
 
     wglMakeCurrent(nullptr, nullptr);
+    g_bAnyCurrent = false;
     wglDeleteContext(hTempRC);
 
     if (!wglMakeCurrent(m_aGLWin.hDC, m_aGLWin.hRC))
     {
+        g_bAnyCurrent = false;
         SAL_WARN("vcl.opengl", "wglMakeCurrent failed: " << WindowsErrorString(GetLastError()));
         return false;
     }
 
+    g_bAnyCurrent = true;
+
     if (bFirstCall)
     {
         // Checking texture size
@@ -629,7 +655,7 @@ bool WinOpenGLContext::ImplInit()
         }
     }
 
-    InitGLEWDebugging();
+    InitGLDebugging();
 
     g_vShareList.push_back(m_aGLWin.hRC);
 
index b4f87a3a92efea163ad962c3ec63e8afe67c769d..92dd18c5ca888d2ed42516e07d68437823362714 100644 (file)
@@ -32,6 +32,7 @@
 #include <o3tl/lru_map.hxx>
 
 static std::vector<GLXContext> g_vShareList;
+static bool g_bAnyCurrent;
 
 class X11OpenGLContext : public OpenGLContext
 {
@@ -184,23 +185,10 @@ namespace
         return pFBC;
     }
 
-    // we need them before glew can initialize them
-    // glew needs an OpenGL context so we need to get the address manually
-    void initOpenGLFunctionPointers()
-    {
-        glXChooseFBConfig = reinterpret_cast<GLXFBConfig*(*)(Display *dpy, int screen, const int *attrib_list, int *nelements)>(glXGetProcAddressARB(reinterpret_cast<GLubyte const *>("glXChooseFBConfig")));
-        glXGetVisualFromFBConfig = reinterpret_cast<XVisualInfo*(*)(Display *dpy, GLXFBConfig config)>(glXGetProcAddressARB(reinterpret_cast<GLubyte const *>("glXGetVisualFromFBConfig")));    // try to find a visual for the current set of attributes
-        glXGetFBConfigAttrib = reinterpret_cast<int(*)(Display *dpy, GLXFBConfig config, int attribute, int* value)>(glXGetProcAddressARB(reinterpret_cast<GLubyte const *>("glXGetFBConfigAttrib")));
-        glXCreateContextAttribsARB = reinterpret_cast<GLXContext(*)(Display*, GLXFBConfig, GLXContext, Bool, const int*)>(glXGetProcAddressARB(reinterpret_cast<const GLubyte *>("glXCreateContextAttribsARB")));
-        glXCreatePixmap = reinterpret_cast<GLXPixmap(*)(Display*, GLXFBConfig, Pixmap, const int*)>(glXGetProcAddressARB(reinterpret_cast<const GLubyte *>("glXCreatePixmap")));
-    }
-
     Visual* getVisual(Display* dpy, Window win)
     {
         OpenGLZone aZone;
 
-        initOpenGLFunctionPointers();
-
         XWindowAttributes xattr;
         if( !XGetWindowAttributes( dpy, win, &xattr ) )
         {
@@ -235,7 +223,10 @@ void X11OpenGLContext::resetCurrent()
     OpenGLZone aZone;
 
     if (m_aGLWin.dpy)
+    {
         glXMakeCurrent(m_aGLWin.dpy, None, nullptr);
+        g_bAnyCurrent = false;
+    }
 }
 
 bool X11OpenGLContext::isCurrent()
@@ -247,7 +238,7 @@ bool X11OpenGLContext::isCurrent()
 
 bool X11OpenGLContext::isAnyCurrent()
 {
-    return glXGetCurrentContext() != None;
+    return g_bAnyCurrent && glXGetCurrentContext() != None;
 }
 
 SystemWindowData X11OpenGLContext::generateWinData(vcl::Window* pParent, bool /*bRequestLegacyContext*/)
@@ -266,8 +257,6 @@ SystemWindowData X11OpenGLContext::generateWinData(vcl::Window* pParent, bool /*
     if( dpy == nullptr || !glXQueryExtension( dpy, nullptr, nullptr ) )
         return aWinData;
 
-    initOpenGLFunctionPointers();
-
     int best_fbc = -1;
     GLXFBConfig* pFBC = getFBConfig(dpy, win, best_fbc, true, false);
 
@@ -355,10 +344,13 @@ bool X11OpenGLContext::ImplInit()
 
     if( !glXMakeCurrent( m_aGLWin.dpy, m_aGLWin.win, m_aGLWin.ctx ) )
     {
+        g_bAnyCurrent = false;
         SAL_WARN("vcl.opengl", "unable to select current GLX context");
         return false;
     }
 
+    g_bAnyCurrent = true;
+
     int glxMinor, glxMajor;
     double nGLXVersion = 0;
     if( glXQueryVersion( m_aGLWin.dpy, &glxMajor, &glxMinor ) )
@@ -400,8 +392,8 @@ bool X11OpenGLContext::ImplInit()
         }
     }
 
-    bool bRet = InitGLEW();
-    InitGLEWDebugging();
+    bool bRet = InitGL();
+    InitGLDebugging();
 
     glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
 
@@ -427,10 +419,12 @@ void X11OpenGLContext::makeCurrent()
     {
         if (!glXMakeCurrent( m_aGLWin.dpy, m_aGLWin.win, m_aGLWin.ctx ))
         {
+            g_bAnyCurrent = false;
             SAL_WARN("vcl.opengl", "OpenGLContext::makeCurrent failed "
                      "on drawable " << m_aGLWin.win);
             return;
         }
+        g_bAnyCurrent = true;
     }
 
     registerAsCurrent();
@@ -445,6 +439,7 @@ void X11OpenGLContext::destroyCurrentContext()
             g_vShareList.erase(itr);
 
         glXMakeCurrent(m_aGLWin.dpy, None, nullptr);
+        g_bAnyCurrent = false;
         if( glGetError() != GL_NO_ERROR )
         {
             SAL_WARN("vcl.opengl", "glError: " << glGetError());
index c75f2a7d866b2e65b1da03f80c908eb2521c5117..9e6e746d5b350a03ae09a495025bb0c92929ea30 100644 (file)
@@ -321,8 +321,8 @@ bool AquaOpenGLContext::ImplInit()
     NSOpenGLView* pView = getOpenGLView();
     [[pView openGLContext] makeCurrentContext];
 
-    bool bRet = InitGLEW();
-    InitGLEWDebugging();
+    bool bRet = InitGL();
+    InitGLDebugging();
     return bRet;
 }
 
index fc12d88617ff346a0091fc91bdd13ab60bc72654..11a00525d3beaec4d74f5bcc9dae4d975f8d8dd7 100644 (file)
@@ -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
@@ -281,30 +275,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;
@@ -320,11 +298,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;
 
index e00a93aa45860884ac2dd3f1aeae2abc2316e580..6f4a880dcce741cfa738ffc7d3bd7e8a5b36e8c5 100644 (file)
@@ -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);
@@ -1106,14 +1106,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 ?
index 0bff9b8352c171da2278e37a5df9af1ab399bd62..34f0e6f73968685cd047f050a3244f2ef5097dbc 100644 (file)
@@ -47,7 +47,6 @@
 #include <X11/extensions/Xinerama.h>
 #endif
 
-#include "GL/glxew.h"
 #include <opengl/zone.hxx>
 
 #include <vcl/svapp.hxx>
index ae2973b7feef92e1a63a510ffeb1e111953178d9..32d6ae8c05fec0149b4e6c79f5a7aa7b4120a9c9 100644 (file)
@@ -20,8 +20,6 @@
 
 #include <math.h>
 
-#include <GL/glew.h>
-
 #include <glm/gtx/bit.hpp>
 
 #include <com/sun/star/lang/XComponent.hpp>