[cairo] [cairo/glitz] glitz patches?

Luo Jinghua sunmoon1997 at gmail.com
Mon Nov 24 17:01:57 PST 2008


On Tue, Nov 25, 2008 at 3:08 AM, Paolo Bonzini <bonzini at gnu.org> wrote:
> I prepared this alternative patch to disable glx testing in configure.
> But still, no warning is issued because this is a limitation in cairo,
> not a user error.
>
> Also, I find this patch suboptimal because it is perfectly possible to
> have in the future other cairo test programs in cairo's repository,
> which wouldn't have the same limitation as the boilerplate/* code.
>
> Paolo
>
> From f99aef31850dce5c82f9ac9c578320d2df833443 Mon Sep 17 00:00:00 2001
> From: Paolo Bonzini <bonzini at gnu.org>
> Date: Fri, 21 Nov 2008 16:36:56 +0100
> Subject: [PATCH] [boilerplate] fix compilation for glitz-agl
>
> This patch fixies the compilation of the cairo-boilerplate-glitz.c file
> when the AGL backend is used.  Besides fixing pasto errors, there are
> conflicts between QuickDraw's Cursor and X11.  Given that GLX is not
> very well supported on Mac OS X, I opted to use AGL if both are
> available and testable.
>
I's easy to compile AGL and GLX backend simultaneously, just splits
cairo-boilerplate-glitz.c into cairo-boilerplate-glitz-{agl,glx,wgl}.c. But
my question is does linking to both AGL.framework and GLX work?
If it does, I like this approch.
BTW: cairo's glitz backend doesn't depends on glitz-{agl,glx,wgl},
only the boilerplate does.
> ---
>  boilerplate/cairo-boilerplate-glitz.c |    4 +++-
>  configure.ac                          |    7 +++++--
>  2 files changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/boilerplate/cairo-boilerplate-glitz.c b/boilerplate/cairo-boilerplate-glitz.c
> index a764080..c03675a 100644
> --- a/boilerplate/cairo-boilerplate-glitz.c
> +++ b/boilerplate/cairo-boilerplate-glitz.c
> @@ -257,7 +257,7 @@ typedef struct _glitz_agl_target_closure {
>     glitz_target_closure_base_t base;
>  } glitz_agl_target_closure_t;
>
> -glitz_surface_t *
> +static glitz_surface_t *
>  _cairo_boilerplate_glitz_agl_create_surface_internal (glitz_format_name_t               formatname,
>                                                      int                                width,
>                                                      int                                height,
> @@ -332,6 +332,7 @@ _cairo_boilerplate_glitz_agl_create_surface (const char                      *name,
>     glitz_surface_t *glitz_surface;
>     cairo_surface_t *surface = NULL;
>     glitz_agl_target_closure_t *aglc;
> +    int status;
>
>     glitz_agl_init ();
>
> @@ -344,6 +345,7 @@ _cairo_boilerplate_glitz_agl_create_surface (const char                      *name,
>     case CAIRO_CONTENT_COLOR_ALPHA:
>        glitz_surface = _cairo_boilerplate_glitz_agl_create_surface_internal (GLITZ_STANDARD_ARGB32, width, height, NULL);
>        break;
> +    case CAIRO_CONTENT_ALPHA:
>     default:
>        CAIRO_BOILERPLATE_LOG ("Invalid content for glitz-agl test: %d\n", content);
>        goto FAIL;
> diff --git a/configure.ac b/configure.ac
> index 7384ccc..8b495a0 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -213,7 +213,10 @@ if test "x$use_glitz" = "xyes";then
>   if test "x$have_glitz_egl" = "xyes";then
>     AC_DEFINE(CAIRO_CAN_TEST_GLITZ_EGL_SURFACE, 1, [define if glitz backend can be tested against egl])
>   fi
> -  if test "x$have_glitz_glx" = "xyes";then
> +
> +  dnl There are conflicts between QuickDraw and X11.  Furthermore, on MacOS
> +  dnl GLX is pretty much broken, so test AGL instead.
> +  if test "x$have_glitz_glx" = "xyes" && test "x$have_glitz_agl" = "xno";then
>     AC_DEFINE(CAIRO_CAN_TEST_GLITZ_GLX_SURFACE, 1, [define if glitz backend can be tested against glx])
>   fi
>   if test "x$have_glitz_wgl" = "xyes";then
> @@ -223,7 +226,7 @@ fi
>
>  AM_CONDITIONAL(CAIRO_CAN_TEST_GLITZ_AGL_SURFACE, test "x$have_glitz_agl" = "xyes")
>  AM_CONDITIONAL(CAIRO_CAN_TEST_GLITZ_EGL_SURFACE, test "x$have_glitz_egl" = "xyes")
> -AM_CONDITIONAL(CAIRO_CAN_TEST_GLITZ_GLX_SURFACE, test "x$have_glitz_glx" = "xyes")
> +AM_CONDITIONAL(CAIRO_CAN_TEST_GLITZ_GLX_SURFACE, test "x$have_glitz_glx" = "xyes" && test "x$have_glitz_agl" = "xno")
>  AM_CONDITIONAL(CAIRO_CAN_TEST_GLITZ_WGL_SURFACE, test "x$have_glitz_wgl" = "xyes")
>
>  dnl ===========================================================================
> --
> 1.5.5
>
>
>


More information about the cairo mailing list