Make EGL/GLESv2 dependencies optional

Introduce --disable-egl switch for configure to disable
EGL/GLESv2 support.

Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
This commit is contained in:
Vasily Khoruzhick
2013-01-08 19:09:02 +03:00
committed by Kristian Høgsberg
parent 52cfd61cdb
commit 1bfe2e6f4b
4 changed files with 91 additions and 18 deletions
+5 -1
View File
@@ -34,7 +34,6 @@ weston_SOURCES = \
workspaces-server-protocol.h \
util.c \
gl-renderer.h \
gl-renderer.c \
noop-renderer.c \
pixman-renderer.c \
pixman-renderer.h \
@@ -43,6 +42,11 @@ weston_SOURCES = \
weston-launch.h \
weston-egl-ext.h
if ENABLE_EGL
weston_SOURCES += \
gl-renderer.c
endif
git-version.h : .FORCE
$(AM_V_GEN)(echo "#define BUILD_ID \"$(shell git --work-tree=$(top_srcdir) describe --always --dirty) $(shell git --work-tree=$(top_srcdir) log -1 --format='%s (%ci)')\"" > $@-new; \
cmp -s $@ $@-new || cp $@-new $@; \
+2 -2
View File
@@ -884,7 +884,7 @@ x11_compositor_create_output(struct x11_compositor *c, int x, int y,
return NULL;
}
} else {
if (gl_renderer_output_create(&output->base, output->window) < 0)
if (gl_renderer_output_create(&output->base, (EGLNativeWindowType)output->window) < 0)
return NULL;
}
@@ -1474,7 +1474,7 @@ x11_compositor_create(struct wl_display *display,
goto err_xdisplay;
}
else {
if (gl_renderer_create(&c->base, c->dpy, gl_renderer_opaque_attribs,
if (gl_renderer_create(&c->base, (EGLNativeDisplayType)c->dpy, gl_renderer_opaque_attribs,
NULL) < 0)
goto err_xdisplay;
}
+59
View File
@@ -20,8 +20,13 @@
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "compositor.h"
#ifdef ENABLE_EGL
#include <EGL/egl.h>
extern const EGLint gl_renderer_opaque_attribs[];
@@ -45,3 +50,57 @@ gl_renderer_set_border(struct weston_compositor *ec, int32_t width, int32_t heig
void
gl_renderer_print_egl_error_state(void);
#else
typedef int EGLint;
typedef int EGLDisplay;
typedef int EGLSurface;
typedef long int EGLNativeDisplayType;
typedef long int EGLNativeWindowType;
static const EGLint gl_renderer_opaque_attribs[];
static const EGLint gl_renderer_alpha_attribs[];
inline static int
gl_renderer_create(struct weston_compositor *ec, EGLNativeDisplayType display,
const EGLint *attribs, const EGLint *visual_id)
{
return -1;
}
inline static EGLDisplay
gl_renderer_display(struct weston_compositor *ec)
{
return 0;
}
inline static int
gl_renderer_output_create(struct weston_output *output,
EGLNativeWindowType window)
{
return -1;
}
inline static void
gl_renderer_output_destroy(struct weston_output *output)
{
}
inline static EGLSurface
gl_renderer_output_surface(struct weston_output *output)
{
return 0;
}
inline static void
gl_renderer_set_border(struct weston_compositor *ec, int32_t width, int32_t height, void *data,
int32_t *edges)
{
}
inline static void
gl_renderer_print_egl_error_state(void)
{
}
#endif