When WEBGL=no, but OPENGL=yes and TEXTURE_MAPPER_GL=yes, the opengl function calls in Source/WebCore/platform/graphics/texmap/BitmapTextureGL.cpp fail during the final ld linking stage of libwebkit2gtk-4.0.so, I guess because Source/WebCore/platform/graphics/OpenGLShims.cpp is only included when WEBGL=yes. Getting rid of that #if ENABLE(WEBGL) preprocessing in OpenGLShims.cpp allowed things to link/compile for me. Linking CXX shared library lib/libwebkit2gtk-4.0.so... FAILED: lib/libwebkit2gtk-4.0.so.... ld: Source/WebCore/CMakeFiles/WebCore.dir/./platform/graphics/texmap/BitmapTextureGL.cpp.o: in function `WebCore::BitmapTextureGL::initializeStencil()': BitmapTextureGL.cpp: undefined reference to `WebCore::openGLFunctionTable()' ld: BitmapTextureGL.cpp: undefined reference to `WebCore::openGLFunctionTable()' ld: BitmapTextureGL.cpp: undefined reference to `WebCore::openGLFunctionTable()' ld: BitmapTextureGL.cpp: undefined reference to `WebCore::openGLFunctionTable()' ld: BitmapTextureGL.cpp: undefined reference to `WebCore::openGLFunctionTable()' ld: Source/WebCore/CMakeFiles/WebCore.dir/./platform/graphics/texmap/BitmapTextureGL.cpp.o:BitmapTextureGL.cpp: more undefined references to `WebCore::openGLFunctionTable()' follow ld: Source/WebCore/CMakeFiles/WebCore.dir/./platform/graphics/GLContext.cpp.o: in function `WebCore::initializeOpenGLShimsIfNeeded()': GLContext.cpp: undefined reference to `WebCore::initializeOpenGLShims()' ld: Source/WebCore/CMakeFiles/WebCore.dir/./platform/graphics/GLContext.cpp.o: in function `WebCore::GLContext::version()': GLContext.cpp: undefined reference to `WebCore::openGLFunctionTable()' ld: Source/WebCore/CMakeFiles/WebCore.dir/./platform/graphics/glx/GLContextGLX.cpp.o: in function `WebCore::GLContextGLX::~GLContextGLX()': GLContextGLX.cpp: undefined reference to `WebCore::openGLFunctionTable()' collect2: error: ld returned 1 exit status
WebKitGTK is not expected to build with ENABLE_WEBGL=OFF. Please limit yourself to using the public build options, not the private (CMake ADVANCED) options.
(In reply to Michael Catanzaro from comment #1) > WebKitGTK is not expected to build with ENABLE_WEBGL=OFF. Well, it's not expected to build if you also use ENABLE_OPENGL=ON, which implies ENABLE_WEBGL=ON. If you have a very small patch or PR to fix the build in your configuration, we could consider it, but it'll probably break again in the future.
(In reply to Michael Catanzaro from comment #2) > (In reply to Michael Catanzaro from comment #1) > > WebKitGTK is not expected to build with ENABLE_WEBGL=OFF. > > Well, it's not expected to build if you also use ENABLE_OPENGL=ON, which > implies ENABLE_WEBGL=ON. If you have a very small patch or PR to fix the > build in your configuration, we could consider it, but it'll probably break > again in the future. Yea I was wondering about that. Shouldn't we then have the cmake configuration script enforce that dependency? I assumed the dependency was the other way around, that webgl was the higher level (and unecessary imho) thing that depended on opengl. Maybe I don't even need opengl - I don't do anything 3d with my browser - does it help with 2d stuff?
(In reply to Dennis Nezic from comment #3) > Yea I was wondering about that. Shouldn't we then have the cmake > configuration script enforce that dependency? We only enforce dependencies for public options. Private options are a free-for-all: trying to set rules for them would be a little silly, since only WebKit developers should be using them. > I assumed the dependency was the other way around, that webgl was the higher > level (and unecessary imho) thing that depended on opengl. Maybe I don't > even need opengl - I don't do anything 3d with my browser - does it help > with 2d stuff? I think OpenGL enabled should result in faster rendering.
(In reply to Michael Catanzaro from comment #4) > (In reply to Dennis Nezic from comment #3) > > Yea I was wondering about that. Shouldn't we then have the cmake > > configuration script enforce that dependency? > > We only enforce dependencies for public options. Private options are a > free-for-all: trying to set rules for them would be a little silly, since > only WebKit developers should be using them. > > > I assumed the dependency was the other way around, that webgl was the higher > > level (and unecessary imho) thing that depended on opengl. Maybe I don't > > even need opengl - I don't do anything 3d with my browser - does it help > > with 2d stuff? > > I think OpenGL enabled should result in faster rendering. Some websites will not work correctly without OpenGL, because it's used for accelerated compositing, and accelerated compositing in turn gets used for web content that uses e.g. CSS 3D transforms. And also compositing tiles in the GPU results in a smoother user experience a number of situations.