From 32b6f2fa0383f04855a181f6db61df84968ec97c Mon Sep 17 00:00:00 2001 From: Tiago Vignatti Date: Mon, 1 Aug 2016 17:30:43 +0300 Subject: [linux] Implement EGL headless backend Original author: Tiago Vignatti Calling X11 window system is superfluous for headless rendering. This patch implements EGL platform using GBM, which is slightly more simple than the GLX path when using X11. In principle there are no big advantages in terms of performance etc. My motivation behind this was to get in touch with the code and the project. For testing I'm using: $ unset DISPLAY && ./build/linux-x86_64/Debug/mbgl-test v2: rebased patch against the new cmake changes; walk through render node to find a valid one; remove EGLSurface completely cause windows are not needed here. --- CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 10d1076e29..064710780f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,15 +15,23 @@ include(.mason/mason.cmake) option(WITH_CXX11ABI "Use cxx11abi mason packages" OFF) option(WITH_COVERAGE "Enable coverage reports" OFF) option(WITH_OSMESA "Use OSMesa headless backend" OFF) +option(WITH_EGL "Use EGL backend" OFF) option(IS_CI_BUILD "Continuous integration build" OFF) if(WITH_CXX11ABI) set(MASON_CXXABI_SUFFIX -cxx11abi) endif() +if(WITH_OSMESA AND WITH_EGL) + message(FATAL_ERROR "WITH_OSMESA and WITH_EGL are mutually exclusive.") +endif() + if(WITH_OSMESA) # Default mesa mason binary is OSMesa. set(MASON_MESA_SUFFIX "") +elseif(WITH_EGL) + add_definitions(-DMBGL_USE_GLES2=1) + set(MASON_MESA_SUFFIX "-egl") else() set(MASON_MESA_SUFFIX "-glx") endif() -- cgit v1.2.1