From patchwork Mon Jul 25 13:56:44 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: 3090 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 5BF6B23E54 for ; Mon, 25 Jul 2011 13:57:53 +0000 (UTC) Received: from mail-qy0-f173.google.com (mail-qy0-f173.google.com [209.85.216.173]) by fiordland.canonical.com (Postfix) with ESMTP id 23564A183B4 for ; Mon, 25 Jul 2011 13:57:53 +0000 (UTC) Received: by mail-qy0-f173.google.com with SMTP id 10so1057030qyk.11 for ; Mon, 25 Jul 2011 06:57:52 -0700 (PDT) Received: by 10.229.1.217 with SMTP id 25mr1001766qcg.38.1311602272872; Mon, 25 Jul 2011 06:57:52 -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 hl14cs77908qcb; Mon, 25 Jul 2011 06:57:52 -0700 (PDT) Received: by 10.204.191.79 with SMTP id dl15mr1376386bkb.269.1311602271947; Mon, 25 Jul 2011 06:57:51 -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 18si7042659fat.105.2011.07.25.06.57.51 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 25 Jul 2011 06:57:51 -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 mail-fx0-f44.google.com with SMTP id 6so6802455fxe.17 for ; Mon, 25 Jul 2011 06:57:51 -0700 (PDT) Received: by 10.223.121.204 with SMTP id i12mr6856232far.83.1311602271525; Mon, 25 Jul 2011 06:57:51 -0700 (PDT) Received: from localhost (77.49.93.204.dsl.dyn.forthnet.gr [77.49.93.204]) by mx.google.com with ESMTPS id f7sm3057062faa.8.2011.07.25.06.57.50 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 25 Jul 2011 06:57:51 -0700 (PDT) From: alexandros.frantzis@linaro.org To: patches@linaro.org Subject: [PATCH 17/21] gl: Fix build issues for GLES2 Date: Mon, 25 Jul 2011 16:56:44 +0300 Message-Id: <1311602208-5973-17-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 The glReadBuffer/glDrawBuffer functions are not present in GLES2, only a single buffer is supported. Signed-off-by: Chris Wilson --- src/cairo-gl-device.c | 4 ++++ src/cairo-gl-ext-def-private.h | 4 ++++ src/cairo-gl-gradient-private.h | 5 +++++ src/cairo-gl-private.h | 6 ++++++ src/cairo-gl.h | 2 +- 5 files changed, 20 insertions(+), 1 deletions(-) diff --git a/src/cairo-gl-device.c b/src/cairo-gl-device.c index 3b60a54..c94e36f 100644 --- a/src/cairo-gl-device.c +++ b/src/cairo-gl-device.c @@ -261,8 +261,10 @@ _cairo_gl_ensure_framebuffer (cairo_gl_context_t *ctx, ctx->tex_target, surface->tex, 0); +#if CAIRO_HAS_GL_SURFACE glDrawBuffer (GL_COLOR_ATTACHMENT0); glReadBuffer (GL_COLOR_ATTACHMENT0); +#endif status = dispatch->CheckFramebufferStatus (GL_FRAMEBUFFER); if (status != GL_FRAMEBUFFER_COMPLETE) { @@ -342,8 +344,10 @@ _cairo_gl_context_set_destination (cairo_gl_context_t *ctx, } else { ctx->make_current (ctx, surface); ctx->dispatch.BindFramebuffer (GL_FRAMEBUFFER, 0); +#if CAIRO_HAS_GL_SURFACE glDrawBuffer (GL_BACK_LEFT); glReadBuffer (GL_BACK_LEFT); +#endif } glViewport (0, 0, surface->width, surface->height); diff --git a/src/cairo-gl-ext-def-private.h b/src/cairo-gl-ext-def-private.h index 97e42c1..a261947 100644 --- a/src/cairo-gl-ext-def-private.h +++ b/src/cairo-gl-ext-def-private.h @@ -136,4 +136,8 @@ #define GL_UNPACK_ROW_LENGTH 0x0CF2 #endif +#ifndef GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE +#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE 0x8D56 +#endif + #endif /* CAIRO_GL_EXT_DEF_PRIVATE_H */ diff --git a/src/cairo-gl-gradient-private.h b/src/cairo-gl-gradient-private.h index 9e34847..3d7b047 100644 --- a/src/cairo-gl-gradient-private.h +++ b/src/cairo-gl-gradient-private.h @@ -50,8 +50,13 @@ #include "cairo-gl.h" +#if CAIRO_HAS_GL_SURFACE #include #include +#elif CAIRO_HAS_GLESV2_SURFACE +#include +#include +#endif #define CAIRO_GL_GRADIENT_CACHE_SIZE 4096 diff --git a/src/cairo-gl-private.h b/src/cairo-gl-private.h index 433a40b..3f3153e 100644 --- a/src/cairo-gl-private.h +++ b/src/cairo-gl-private.h @@ -58,8 +58,14 @@ #include "cairo-gl.h" +#if CAIRO_HAS_GL_SURFACE #include #include +#elif CAIRO_HAS_GLESV2_SURFACE +#include +#include +#endif + #include "cairo-gl-ext-def-private.h" #define DEBUG_GL 0 diff --git a/src/cairo-gl.h b/src/cairo-gl.h index d23cea7..d23b8a5 100644 --- a/src/cairo-gl.h +++ b/src/cairo-gl.h @@ -62,7 +62,7 @@ #include "cairo.h" -#if CAIRO_HAS_GL_SURFACE +#if CAIRO_HAS_GL_SURFACE || CAIRO_HAS_GLESV2_SURFACE CAIRO_BEGIN_DECLS