[cairo] [cairo-commit] src/cairo-gl-composite.c src/cairo-gl-device.c src/cairo-gl-dispatch-private.h src/cairo-gl-msaa-compositor.c src/cairo-gl-operand.c src/cairo-gl-private.h src/cairo-gl-surface.c

Martin Robinson mrobinson at igalia.com
Thu May 17 12:14:20 PDT 2012


On 05/17/2012 12:01 PM, Chris Wilson wrote:

> This is a little non-descriptive, and I can't quite judge if it does
> what I think it should just by the name. I was expecting something along
> the lines of:
> 
>   can_use_msaa(cairo_gl_surface_t *surface, cairo_antialias_t antialias)
>   {
>     if (antialias == CAIRO_ANTIALIAS_NONE)
>       return TRUE; /* single sample "MSAA" */
>     if (antialias == CAIRO_ANTIALIAS_FAST)
>       return surface->supports_msaa;
>     if (antialias == CAIRO_ANTIALIAS_DEFAULT)
>       return surface->supports_msaa && 
>              to_gl_device(surface->base.device)->use_msaa_by_default;
>     return FALSE;
>   }

The name change and the second conditional look like definite 
improvements to me.

As for the last conditional, use of the MSAA compositor
is currently guarded by the CAIRO_GL_COMPOOSITOR environment
variable set to "msaa." Without that present, the MSAA compositor 
isn't instantiated at all, so this check isn't run.

So perhaps this can just become:

can_use_msaa(cairo_gl_surface_t *surface, cairo_antialias_t antialias)
{
    if (antialias == CAIRO_ANTIALIAS_NONE)
        return TRUE; /* single sample "MSAA" */
    if (antialias == CAIRO_ANTIALIAS_FAST || antialias == CAIRO_ANTIALIAS_DEFAULT)
        return surface->supports_msaa;
    return FALSE;
}

--Martin


More information about the cairo mailing list