From patchwork Mon Jul 25 14:05:10 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: 3102 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 9116523E54 for ; Mon, 25 Jul 2011 14:05:33 +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 59FCAA1849B for ; Mon, 25 Jul 2011 14:05:33 +0000 (UTC) Received: by mail-qw0-f52.google.com with SMTP id 8so3010075qwb.11 for ; Mon, 25 Jul 2011 07:05:33 -0700 (PDT) Received: by 10.229.68.200 with SMTP id w8mr3739704qci.114.1311602733106; Mon, 25 Jul 2011 07:05:33 -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 hl14cs78178qcb; Mon, 25 Jul 2011 07:05:32 -0700 (PDT) Received: by 10.223.83.15 with SMTP id d15mr296107fal.105.1311602732062; Mon, 25 Jul 2011 07:05:32 -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 o15si7048838fal.135.2011.07.25.07.05.31 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 25 Jul 2011 07:05:32 -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 6so6811099fxe.17 for ; Mon, 25 Jul 2011 07:05:31 -0700 (PDT) Received: by 10.223.144.194 with SMTP id a2mr6121658fav.138.1311602731627; Mon, 25 Jul 2011 07:05:31 -0700 (PDT) Received: from localhost (77.49.93.204.dsl.dyn.forthnet.gr [77.49.93.204]) by mx.google.com with ESMTPS id b14sm2334907fam.21.2011.07.25.07.05.30 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 25 Jul 2011 07:05:31 -0700 (PDT) From: alexandros.frantzis@linaro.org To: patches@linaro.org Subject: [PATCH 6/9] gl: Use the GL core 2.0 shader implementation for both GL 1.x ARB and GL 2.x Date: Mon, 25 Jul 2011 17:05:10 +0300 Message-Id: <1311602713-6182-6-git-send-email-alexandros.frantzis@linaro.org> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1311602713-6182-1-git-send-email-alexandros.frantzis@linaro.org> References: <1311602713-6182-1-git-send-email-alexandros.frantzis@linaro.org> From: Alexandros Frantzis The GL core 2.0 shader implementation can be used by both GL 1.x and 2.x thanks to the dispatch table. --- src/cairo-gl-shaders.c | 9 ++++----- 1 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/cairo-gl-shaders.c b/src/cairo-gl-shaders.c index 06e3c62..909b681 100644 --- a/src/cairo-gl-shaders.c +++ b/src/cairo-gl-shaders.c @@ -543,12 +543,11 @@ _cairo_gl_context_init_shaders (cairo_gl_context_t *ctx) cairo_status_t status; /* XXX multiple device support? */ - if (GLEW_VERSION_2_0) { + if (GLEW_VERSION_2_0 || + (GLEW_ARB_shader_objects && + GLEW_ARB_fragment_shader && + GLEW_ARB_vertex_program)) { ctx->shader_impl = &shader_impl_core_2_0; - } else if (GLEW_ARB_shader_objects && - GLEW_ARB_fragment_shader && - GLEW_ARB_vertex_program) { - ctx->shader_impl = &shader_impl_arb; } else { ctx->shader_impl = NULL; }