From patchwork Mon Jul 25 13:56:43 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: alexandros.frantzis@linaro.org X-Patchwork-Id: 3095 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 2469623E54 for ; Mon, 25 Jul 2011 13:59:32 +0000 (UTC) Received: from mail-qw0-f52.google.com (mail-qw0-f52.google.com [209.85.216.52]) by fiordland.canonical.com (Postfix) with ESMTP id BD3DFA1848C for ; Mon, 25 Jul 2011 13:59:31 +0000 (UTC) Received: by qwb8 with SMTP id 8so3005461qwb.11 for ; Mon, 25 Jul 2011 06:59:31 -0700 (PDT) Received: by 10.229.25.212 with SMTP id a20mr3471968qcc.148.1311602370976; Mon, 25 Jul 2011 06:59:30 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.229.217.78 with SMTP id hl14cs77983qcb; Mon, 25 Jul 2011 06:59:30 -0700 (PDT) Received: by 10.223.21.219 with SMTP id k27mr4513959fab.54.1311602369954; Mon, 25 Jul 2011 06:59:29 -0700 (PDT) Received: from mail-fx0-f44.google.com (mail-fx0-f44.google.com [209.85.161.44]) by mx.google.com with ESMTPS id i25si7060101faa.34.2011.07.25.06.59.29 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 25 Jul 2011 06:59:29 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.161.44 is neither permitted nor denied by best guess record for domain of alexandros.frantzis@linaro.org) client-ip=209.85.161.44; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.161.44 is neither permitted nor denied by best guess record for domain of alexandros.frantzis@linaro.org) smtp.mail=alexandros.frantzis@linaro.org Received: by fxe6 with SMTP id 6so6804863fxe.17 for ; Mon, 25 Jul 2011 06:59:29 -0700 (PDT) Received: by 10.223.87.79 with SMTP id v15mr2470005fal.125.1311602267675; Mon, 25 Jul 2011 06:57:47 -0700 (PDT) Received: from localhost (77.49.93.204.dsl.dyn.forthnet.gr [77.49.93.204]) by mx.google.com with ESMTPS id 12sm3303236fad.16.2011.07.25.06.57.43 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 25 Jul 2011 06:57:44 -0700 (PDT) From: alexandros.frantzis@linaro.org To: patches@linaro.org Subject: [PATCH 16/21] gl: Add GLESv2 backend to build system Date: Mon, 25 Jul 2011 16:56:43 +0300 Message-Id: <1311602208-5973-16-git-send-email-alexandros.frantzis@linaro.org> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1311602208-5973-1-git-send-email-alexandros.frantzis@linaro.org> References: <1311602208-5973-1-git-send-email-alexandros.frantzis@linaro.org> From: Alexandros Frantzis Signed-off-by: Chris Wilson --- boilerplate/Makefile.win32.features | 12 ++++++++++++ build/Makefile.win32.features | 1 + build/Makefile.win32.features-h | 3 +++ build/configure.ac.features | 1 + configure.ac | 14 ++++++++++++++ src/Makefile.sources | 4 ++++ src/Makefile.win32.features | 16 ++++++++++++++++ 7 files changed, 51 insertions(+), 0 deletions(-) diff --git a/boilerplate/Makefile.win32.features b/boilerplate/Makefile.win32.features index b97f6d0..d0b184d 100644 --- a/boilerplate/Makefile.win32.features +++ b/boilerplate/Makefile.win32.features @@ -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) diff --git a/build/Makefile.win32.features b/build/Makefile.win32.features index d76cf0e..0d0261d 100644 --- a/build/Makefile.win32.features +++ b/build/Makefile.win32.features @@ -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 diff --git a/build/Makefile.win32.features-h b/build/Makefile.win32.features-h index f5cbcf1..ce39de3 100644 --- a/build/Makefile.win32.features-h +++ b/build/Makefile.win32.features-h @@ -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 diff --git a/build/configure.ac.features b/build/configure.ac.features index 343442a..e1651d8 100644 --- a/build/configure.ac.features +++ b/build/configure.ac.features @@ -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" diff --git a/configure.ac b/configure.ac index 951e960..9107b3e 100644 --- a/configure.ac +++ b/configure.ac @@ -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 diff --git a/src/Makefile.sources b/src/Makefile.sources index c4ca001..474e092 100644 --- a/src/Makefile.sources +++ b/src/Makefile.sources @@ -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 diff --git a/src/Makefile.win32.features b/src/Makefile.win32.features index e1701e7..d7cc77e 100644 --- a/src/Makefile.win32.features +++ b/src/Makefile.win32.features @@ -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)