Re: [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 <[email protected]>
Newsgroups gmane.comp.lib.cairo
Message-ID <[email protected]>
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
--
cairo mailing list
[email protected]
http://lists.cairographics.org/mailman/listinfo/cairo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.