@@ -259,6 +259,18 @@ enabled_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_gl_cxx_sources)
enabled_cairo_boilerplate_sources += $(cairo_boilerplate_gl_sources)
endif
+unsupported_cairo_boilerplate_headers += $(cairo_boilerplate_glesv2_headers)
+all_cairo_boilerplate_headers += $(cairo_boilerplate_glesv2_headers)
+all_cairo_boilerplate_private += $(cairo_boilerplate_glesv2_private)
+all_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_glesv2_cxx_sources)
+all_cairo_boilerplate_sources += $(cairo_boilerplate_glesv2_sources)
+ifeq ($(CAIRO_HAS_GLESV2_SURFACE),1)
+enabled_cairo_boilerplate_headers += $(cairo_boilerplate_glesv2_headers)
+enabled_cairo_boilerplate_private += $(cairo_boilerplate_glesv2_private)
+enabled_cairo_boilerplate_cxx_sources += $(cairo_boilerplate_glesv2_cxx_sources)
+enabled_cairo_boilerplate_sources += $(cairo_boilerplate_glesv2_sources)
+endif
+
unsupported_cairo_boilerplate_headers += $(cairo_boilerplate_directfb_headers)
all_cairo_boilerplate_headers += $(cairo_boilerplate_directfb_headers)
all_cairo_boilerplate_private += $(cairo_boilerplate_directfb_private)
@@ -20,6 +20,7 @@ CAIRO_HAS_GALLIUM_SURFACE=0
CAIRO_HAS_XCB_DRM_FUNCTIONS=0
CAIRO_HAS_PNG_FUNCTIONS=1
CAIRO_HAS_GL_SURFACE=0
+CAIRO_HAS_GLESV2_SURFACE=0
CAIRO_HAS_DIRECTFB_SURFACE=0
CAIRO_HAS_VG_SURFACE=0
CAIRO_HAS_EGL_FUNCTIONS=0
@@ -65,6 +65,9 @@ endif
ifeq ($(CAIRO_HAS_GL_SURFACE),1)
@echo "#define CAIRO_HAS_GL_SURFACE 1" >> src/cairo-features.h
endif
+ifeq ($(CAIRO_HAS_GLESV2_SURFACE),1)
+ @echo "#define CAIRO_HAS_GLESV2_SURFACE 1" >> src/cairo-features.h
+endif
ifeq ($(CAIRO_HAS_DIRECTFB_SURFACE),1)
@echo "#define CAIRO_HAS_DIRECTFB_SURFACE 1" >> src/cairo-features.h
endif
@@ -381,6 +381,7 @@ AC_DEFUN([CAIRO_REPORT],
echo " PDF: $use_pdf"
echo " SVG: $use_svg"
echo " OpenGL: $use_gl"
+ echo " OpenGL ES 2.0: $use_glesv2"
echo " BeOS: $use_beos"
echo " DirectFB: $use_directfb"
echo " OpenVG: $use_vg"
@@ -323,6 +323,20 @@ CAIRO_ENABLE_SURFACE_BACKEND(gl, OpenGL, no, [
])
dnl ===========================================================================
+CAIRO_ENABLE_SURFACE_BACKEND(glesv2, OpenGLESv2, no, [
+ glesv2_REQUIRES="glesv2"
+ PKG_CHECK_MODULES(glesv2, $glesv2_REQUIRES,, [
+ dnl Fallback to searching for headers
+ AC_CHECK_HEADER(GLES2/gl2.h,, [use_glesv2="no (glesv2.pc nor OpenGL ES 2.0 headers not found)"])
+ if test "x$use_glesv2" = "xyes"; then
+ glesv2_NONPKGCONFIG_CFLAGS=
+ glesv2_NONPKGCONFIG_LIBS="-lGLESv2"
+ fi])
+
+ need_egl_functions=yes
+])
+
+dnl ===========================================================================
CAIRO_ENABLE_SURFACE_BACKEND(directfb, directfb, no, [
directfb_REQUIRES=directfb
@@ -328,6 +328,10 @@ cairo_gl_sources = cairo-gl-composite.c \
cairo-gl-shaders.c \
cairo-gl-surface.c
+cairo_glesv2_headers = $(cairo_gl_headers)
+cairo_glesv2_private = $(cairo_gl_private)
+cairo_glesv2_sources = $(cairo_gl_sources)
+
cairo_egl_sources += cairo-egl-context.c
cairo_glx_sources += cairo-glx-context.c
cairo_wgl_sources += cairo-wgl-context.c
@@ -341,6 +341,22 @@ ifeq ($(CAIRO_HAS_GL_SURFACE),1)
enabled_cairo_pkgconf += cairo-gl.pc
endif
+unsupported_cairo_headers += $(cairo_glesv2_headers)
+all_cairo_headers += $(cairo_glesv2_headers)
+all_cairo_private += $(cairo_glesv2_private)
+all_cairo_cxx_sources += $(cairo_glesv2_cxx_sources)
+all_cairo_sources += $(cairo_glesv2_sources)
+ifeq ($(CAIRO_HAS_GLESV2_SURFACE),1)
+enabled_cairo_headers += $(cairo_glesv2_headers)
+enabled_cairo_private += $(cairo_glesv2_private)
+enabled_cairo_cxx_sources += $(cairo_glesv2_cxx_sources)
+enabled_cairo_sources += $(cairo_glesv2_sources)
+endif
+all_cairo_pkgconf += cairo-glesv2.pc
+ifeq ($(CAIRO_HAS_GLESV2_SURFACE),1)
+enabled_cairo_pkgconf += cairo-glesv2.pc
+endif
+
unsupported_cairo_headers += $(cairo_directfb_headers)
all_cairo_headers += $(cairo_directfb_headers)
all_cairo_private += $(cairo_directfb_private)