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>
This commit is contained in:
Caolán McNamara 2016-11-25 20:25:27 +00:00
parent 178e38dd82
commit 482d7ce61b
77 changed files with 344 additions and 423 deletions

View 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) \

View 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_epoxy
$(call gb_LinkTarget_set_include,$(1),\
-I$(call gb_UnpackedTarball_get_dir,epoxy/include) \
$$(INCLUDE) \
)
$(call gb_LinkTarget_use_libraries,$(1),\
epoxy \
)
endef
$(eval $(call gb_Helper_register_libraries_for_install,PLAINLIBS_OOO,ooo,\
epoxy \
))
define gb_LinkTarget__use_glew
$(call gb_LinkTarget_use_package,$(1),glew)
$(call gb_LinkTarget_set_include,$(1),\
-I$(call gb_UnpackedTarball_get_dir,glew/include) \
-DGLEW_NO_GLU \
$$(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 \
)
endif
define gb_ExternalProject__use_epoxy
$(call gb_ExternalProject_use_external_project,$(1),epoxy)
endef
define gb_ExternalProject__use_glew
$(call gb_ExternalProject_use_external_project,$(1),glew)
endef
endif # SYSTEM_GLEW
endif # SYSTEM_EPOXY
define gb_LinkTarget__use_iconv
$(call gb_LinkTarget_add_libs,$(1),-liconv)
@ -3435,7 +3427,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

View 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

View 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:

View File

@ -105,7 +105,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)

View File

@ -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 \

View 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:

View 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>

View 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>

View 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>

View 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>

View File

@ -9,7 +9,7 @@
#include <sal/config.h>
#include <GL/glew.h>
#include <epoxy/gl.h>
#include <com/sun/star/geometry/IntegerSize2D.hpp>

View 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
{

View 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:

View 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

View 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>
@ -169,6 +168,7 @@
#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>

View 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>

View 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();

View 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>

View File

@ -199,8 +199,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@

View File

@ -1,10 +0,0 @@
/*
Settings for OpenGL
*/
#ifndef CONFIG_OPENGL_H
#define CONFIG_OPENGL_H
#define HAVE_GLEW_1_12 0
#endif

View File

@ -1627,6 +1627,11 @@ AC_ARG_WITH(system-cairo,
[Use cairo libraries already on system. Happens automatically for
(implicit) --enable-gtk and for --enable-gtk3.]))
AC_ARG_WITH(system-epoxy,
AS_HELP_STRING([--with-system-epoxy],
[Use epoxy libraries already on system. Happens automatically for
--enable-gtk3.]))
AC_ARG_WITH(myspell-dicts,
AS_HELP_STRING([--with-myspell-dicts],
[Adds myspell dictionaries to the LibreOffice installation set]),
@ -8920,14 +8925,6 @@ fi
AC_SUBST([GLM_CFLAGS])
AC_SUBST([SYSTEM_GLM])
dnl ===================================================================
dnl Check for system glew
dnl ===================================================================
libo_CHECK_SYSTEM_MODULE([glew], [GLEW], [glew >= 1.10.0])
AS_IF([test "$with_system_glew" = "yes"],
[PKG_CHECK_EXISTS([glew >= 1.12.0], [AC_DEFINE([HAVE_GLEW_1_12])])],
[AC_DEFINE([HAVE_GLEW_1_12])])
dnl ===================================================================
dnl Check for system odbc
dnl ===================================================================
@ -10465,7 +10462,7 @@ if test "x$enable_gltf" != "xno" -a $_os != iOS -a $_os != Android -a "$ENABLE_H
AC_DEFINE(HAVE_FEATURE_GLTF,1)
if test "$with_system_libgltf" = "yes"; then
SYSTEM_LIBGLTF=TRUE
PKG_CHECK_MODULES( LIBGLTF, [libgltf-0.0 >= 0.0.1] )
PKG_CHECK_MODULES( LIBGLTF, [libgltf-0.1 >= 0.1.0] )
FilterLibs "${LIBGLTF_LIBS}"
LIBGLTF_LIBS="${filteredlibs}"
else
@ -11695,6 +11692,11 @@ AC_SUBST(SYSTEM_CAIRO)
AC_SUBST(CAIRO_CFLAGS)
AC_SUBST(CAIRO_LIBS)
dnl ===================================================================
dnl Check for system epoxy
dnl ===================================================================
libo_CHECK_SYSTEM_MODULE([epoxy], [EPOXY], [epoxy >= 1.3.1], ["-I${WORKDIR}/UnpackedTarball/epoxy/include"])
dnl ===================================================================
dnl Test whether to use avahi
dnl ===================================================================
@ -12854,7 +12856,6 @@ AC_CONFIG_HEADERS([config_host/config_locales.h])
AC_CONFIG_HEADERS([config_host/config_mpl.h])
AC_CONFIG_HEADERS([config_host/config_kde4.h])
AC_CONFIG_HEADERS([config_host/config_oox.h])
AC_CONFIG_HEADERS([config_host/config_opengl.h])
AC_CONFIG_HEADERS([config_host/config_options.h])
AC_CONFIG_HEADERS([config_host/config_options_calc.h])
AC_CONFIG_HEADERS([config_host/config_test.h])

View 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

View 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

View File

@ -29,6 +29,8 @@ export CURL_TARBALL := curl-7.51.0.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_TARBALL := 3069842a88b8f40c6b83ad2850cda293-graphite2-minimal-1.3.9.tgz
export HARFBUZZ_MD5SUM := 5986e1bfcd983d1f6caa53ef64c4abc5
@ -88,8 +89,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

View 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) \

63
external/epoxy/Library_epoxy.mk vendored Normal file
View File

@ -0,0 +1,63 @@
# -*- 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 \
UnpackedTarball/epoxy/src/dispatch_egl \
UnpackedTarball/epoxy/src/egl_generated_dispatch \
))
endif
# vim: set noet sw=4 ts=4:

View File

@ -7,12 +7,11 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
$(eval $(call gb_Module_Module,glew))
$(eval $(call gb_Module_Module,epoxy))
$(eval $(call gb_Module_add_targets,glew,\
ExternalProject_glew \
UnpackedTarball_glew \
ExternalPackage_glew \
$(eval $(call gb_Module_add_targets,epoxy,\
Library_epoxy \
UnpackedTarball_epoxy \
))
# vim: set noet sw=4 ts=4:

5
external/epoxy/README vendored Normal file
View File

@ -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

20
external/epoxy/UnpackedTarball_epoxy.mk vendored Normal file
View File

@ -0,0 +1,20 @@
# -*- 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 \
))
# vim: set noet sw=4 ts=4:

90
external/epoxy/epoxy.windows.api.patch vendored Normal file
View File

@ -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);

View File

@ -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:

View File

@ -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:

View File

@ -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/

View File

@ -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:

View File

@ -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

View File

@ -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>

View File

@ -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

View File

@ -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

View File

@ -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 =

View 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) \

View 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>

View 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;

View 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>

View 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

View 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,\

View 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

View 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>

View File

@ -31,8 +31,6 @@
#include <config_lgpl.h>
#include <glm/gtc/type_ptr.hpp>
#include <GL/glew.h>
#include <limits>
#include <memory>
#include <vector>

View File

@ -810,7 +810,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);

View 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

View 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,\

View 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

View 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
@ -190,7 +189,6 @@ ifeq ($(OS), $(filter LINUX %BSD SOLARIS, $(OS)))
$(eval $(call gb_CppunitTest_add_libs,vcl_wmf_test,\
-lm $(DLOPEN_LIBS) \
-lpthread \
-lGL \
-lX11 \
-lXext \
))

View 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

View 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

View File

@ -46,7 +46,6 @@ $(eval $(call gb_Executable_add_libs,visualbackendtest,\
-lm \
-ldl \
-lpthread \
-lGL \
-lX11 \
))

View File

@ -122,7 +122,7 @@ $(eval $(call gb_Library_use_externals,vcl,\
))
ifeq ($(ENABLE_HEADLESS),)
$(eval $(call gb_Library_use_externals,vcl,\
glew \
epoxy \
))
endif
@ -621,7 +621,6 @@ ifeq ($(OS), $(filter LINUX %BSD SOLARIS, $(OS)))
$(eval $(call gb_Library_add_libs,vcl,\
-lm $(DLOPEN_LIBS) \
-lpthread \
-lGL \
-lX11 \
-lXext \
))

View 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,\

View File

@ -59,7 +59,7 @@ $(eval $(call gb_Library_use_externals,vclplug_gtk,\
cairo \
dbus \
gio \
glew \
epoxy \
gtk \
gthread \
icuuc \

View 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 \
))

View 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,\

View 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"

View 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>

View 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>

View File

@ -14,7 +14,6 @@
#include <list>
#include <GL/glew.h>
#include <vcl/dllapi.h>
#include <basegfx/point/b2dpoint.hxx>

View 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>

View File

@ -55,6 +55,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>
@ -183,7 +184,6 @@
#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>

View 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>

View File

@ -16,9 +16,10 @@
#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);

View 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());

View File

@ -321,8 +321,8 @@ bool AquaOpenGLContext::ImplInit()
NSOpenGLView* pView = getOpenGLView();
[[pView openGLContext] makeCurrentContext];
bool bRet = InitGLEW();
InitGLEWDebugging();
bool bRet = InitGL();
InitGLDebugging();
return bRet;
}

View 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
@ -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;

View 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);
@ -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 ?

View File

@ -47,7 +47,6 @@
#include <X11/extensions/Xinerama.h>
#endif
#include "GL/glxew.h"
#include <opengl/zone.hxx>
#include <vcl/svapp.hxx>

View File

@ -20,8 +20,6 @@
#include <math.h>
#include <GL/glew.h>
#include <glm/gtx/bit.hpp>
#include <com/sun/star/lang/XComponent.hpp>