[patch] gl: use font's antialias option to check whether it needs mask

"Henry (Yu) Song - SISA" <[email protected]>
Newsgroups gmane.comp.lib.cairo
Message-ID <3955FA337689574EB32F94B12A7E6E9E0B4F8885@ex10mail>
It seems that we don't need to check each glyphs surface for ARGB32 format.  We can use font's antialias option.


Author: Henry (Yu) Song <[email protected]>
Date:   Tue Mar 27 14:19:45 2012 -0700

    gl: There is need to loop over number of glyphs to check wether the glyph
    image is a ARGB32.  The font's antialias option can be used for checking.
    if antialias is SUBPIXEL or BEST, the glyph surface will be ARGB32,
    otherwise, it will be A8 format.

diff --git a/src/cairo-gl-glyphs.c b/src/cairo-gl-glyphs.c
index 832956f..ede44ce 100644
--- a/src/cairo-gl-glyphs.c
+++ b/src/cairo-gl-glyphs.c
@@ -432,18 +432,9 @@ _cairo_gl_composite_glyphs (void			*_dst,
      * alpha.
      */
     if (!dst->base.is_clear && ! info->use_mask && op != CAIRO_OPERATOR_OVER) {
-	for (i = 0; i < info->num_glyphs; i++) {
-	    cairo_scaled_glyph_t *scaled_glyph;
-
-	    if (_cairo_scaled_glyph_lookup (info->font, info->glyphs[i].index,
-					    CAIRO_SCALED_GLYPH_INFO_SURFACE,
-					    &scaled_glyph) == CAIRO_INT_STATUS_SUCCESS &&
-		scaled_glyph->surface->format == CAIRO_FORMAT_ARGB32)
-	    {
+	if (info->font->options.antialias == CAIRO_ANTIALIAS_SUBPIXEL ||
+	    info->font->options.antialias == CAIRO_ANTIALIAS_BEST)
 		info->use_mask = TRUE;
-		break;
-	    }
-	}
     }
 
     if (info->use_mask) {
--
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.