[cairo-commit] src/cairo-gl-glyphs.c

Chris Wilson ickle at kemper.freedesktop.org
Tue Mar 27 15:31:10 PDT 2012


 src/cairo-gl-glyphs.c |   24 ++++++++----------------
 1 file changed, 8 insertions(+), 16 deletions(-)

New commits:
commit fba21ef2a4c4eb343668267fda713aedbb6af2a4
Author: Henry (Yu) Song <hsong at sisa.samsung.com>
Date:   Tue Mar 27 21:25:37 2012 +0000

    gl: use font's antialias option to check whether it needs mask
    
    There is need to loop over number of glyphs to check wether the glyph
    image is a ARGB32 as 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. Therefore we will only be using
    component-alpha at SUBPIXEL (or better) font quality and only then need
    a mask for multiple pass glyph composition.

diff --git a/src/cairo-gl-glyphs.c b/src/cairo-gl-glyphs.c
index 832956f..9756ea4 100644
--- a/src/cairo-gl-glyphs.c
+++ b/src/cairo-gl-glyphs.c
@@ -427,23 +427,15 @@ _cairo_gl_composite_glyphs (void			*_dst,
 
     TRACE ((stderr, "%s\n", __FUNCTION__));
 
-    /* If any of the glyphs are component alpha, we have to go through a mask,
-     * since only _cairo_gl_surface_composite() currently supports component
-     * alpha.
+    /* If any of the glyphs require component alpha, we have to go through
+     * a mask, since only _cairo_gl_surface_composite() currently supports
+     * component 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)
-	    {
-		info->use_mask = TRUE;
-		break;
-	    }
-	}
+    if (!dst->base.is_clear && ! info->use_mask && op != CAIRO_OPERATOR_OVER &&
+	(info->font->options.antialias == CAIRO_ANTIALIAS_SUBPIXEL ||
+	 info->font->options.antialias == CAIRO_ANTIALIAS_BEST))
+    {
+	info->use_mask = TRUE;
     }
 
     if (info->use_mask) {


More information about the cairo-commit mailing list