[cairo] [cairo/glitz] glitz patches?

Luo Jinghua sunmoon1997 at gmail.com
Mon Nov 24 08:07:46 PST 2008


On Mon, Nov 24, 2008 at 8:47 PM, Paolo Bonzini <bonzini at gnu.org> wrote:
>
>>> Right, your patch is better.  Note that mine was just taken from the
>>> archives.
>
> Thanks for moving on!
>
> The attached patch makes the AGL boilerplate work again.
>
> 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.
>
> ---
>  boilerplate/cairo-boilerplate-glitz.c |    4 +++-
>  boilerplate/cairo-boilerplate.h       |    7 +++++++
>  2 files changed, 10 insertions(+), 1 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/boilerplate/cairo-boilerplate.h b/boilerplate/cairo-boilerplate.h
> index 19b2957..9dd7818 100644
> --- a/boilerplate/cairo-boilerplate.h
> +++ b/boilerplate/cairo-boilerplate.h
> @@ -94,6 +94,13 @@
>  #endif
>
>
> +/* There are conflicts between QuickDraw and X11.  On MacOS GLX is pretty
> +   much broken, so test AGL instead.  */
> +#if CAIRO_CAN_TEST_GLITZ_AGL_SURFACE
> +#undef CAIRO_CAN_TEST_GLITZ_GLX_SURFACE
> +#endif
> +
> +
It'd be better to print a warning and unset
CAIRO_CAN_TEST_GLITZ_GLX_SURFACE in configure.

>  /* A fake format we use for the flattened ARGB output of the PS and
>  * PDF surfaces. */
>  #define CAIRO_TEST_CONTENT_COLOR_ALPHA_FLATTENED ((unsigned int) -1)
> --
> 1.5.5
>
>
>


More information about the cairo mailing list