From patchwork Mon Jul 25 13:56:42 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: 3089 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 AEF6023E54 for ; Mon, 25 Jul 2011 13:57:43 +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 76384A1844E for ; Mon, 25 Jul 2011 13:57:43 +0000 (UTC) Received: by mail-qy0-f173.google.com with SMTP id 10so1057030qyk.11 for ; Mon, 25 Jul 2011 06:57:43 -0700 (PDT) Received: by 10.229.25.212 with SMTP id a20mr3470121qcc.148.1311602263055; Mon, 25 Jul 2011 06:57:43 -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 hl14cs77900qcb; Mon, 25 Jul 2011 06:57:42 -0700 (PDT) Received: by 10.223.160.65 with SMTP id m1mr6874203fax.28.1311602262151; Mon, 25 Jul 2011 06:57:42 -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.41 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 25 Jul 2011 06:57:42 -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:41 -0700 (PDT) Received: by 10.223.43.1 with SMTP id u1mr6968651fae.38.1311602261699; Mon, 25 Jul 2011 06:57:41 -0700 (PDT) Received: from localhost (77.49.93.204.dsl.dyn.forthnet.gr [77.49.93.204]) by mx.google.com with ESMTPS id a24sm3806913fak.12.2011.07.25.06.57.40 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 25 Jul 2011 06:57:41 -0700 (PDT) From: alexandros.frantzis@linaro.org To: patches@linaro.org Subject: [PATCH 15/21] gl: Require the GL_OES_texture_npot extension for GLES2 Date: Mon, 25 Jul 2011 16:56:42 +0300 Message-Id: <1311602208-5973-15-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 default support for GLES2 NPOT textures is very limited. We need the additional features provided by the GL_OES_texture_npot extension. Signed-off-by: Chris Wilson --- src/cairo-gl-device.c | 20 ++++++++++++++------ 1 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/cairo-gl-device.c b/src/cairo-gl-device.c index fb0a7dd..3b60a54 100644 --- a/src/cairo-gl-device.c +++ b/src/cairo-gl-device.c @@ -167,12 +167,20 @@ _cairo_gl_context_init (cairo_gl_context_t *ctx) return _cairo_error (CAIRO_STATUS_DEVICE_ERROR); /* Check for required extensions */ - if (_cairo_gl_has_extension ("GL_ARB_texture_non_power_of_two")) - ctx->tex_target = GL_TEXTURE_2D; - else if (_cairo_gl_has_extension ("GL_ARB_texture_rectangle")) - ctx->tex_target = GL_TEXTURE_RECTANGLE; - else - return _cairo_error (CAIRO_STATUS_DEVICE_ERROR); + if (gl_flavor == CAIRO_GL_FLAVOR_DESKTOP) { + if (_cairo_gl_has_extension ("GL_ARB_texture_non_power_of_two")) + ctx->tex_target = GL_TEXTURE_2D; + else if (_cairo_gl_has_extension ("GL_ARB_texture_rectangle")) + ctx->tex_target = GL_TEXTURE_RECTANGLE; + else + return _cairo_error (CAIRO_STATUS_DEVICE_ERROR); + } + else { + if (_cairo_gl_has_extension ("GL_OES_texture_npot")) + ctx->tex_target = GL_TEXTURE_2D; + else + return _cairo_error (CAIRO_STATUS_DEVICE_ERROR); + } if (gl_flavor == CAIRO_GL_FLAVOR_DESKTOP && gl_version < CAIRO_GL_VERSION_ENCODE (2, 1) &&