[cairo-commit] src/cairo-scaled-font.c

Chris Wilson ickle at kemper.freedesktop.org
Tue Mar 30 07:33:13 PDT 2010


 src/cairo-scaled-font.c |   19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)

New commits:
commit d901692a5550c51fd3eefd307609fb800ef02a95
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Tue Mar 30 15:31:32 2010 +0100

    scaled-glyph: Allow removal info fields.
    
    Pushed a fraction of a second too soon... Update the
    scaled_glyph->has_info if the backend clears any field as well.

diff --git a/src/cairo-scaled-font.c b/src/cairo-scaled-font.c
index 70e8805..58048fa 100644
--- a/src/cairo-scaled-font.c
+++ b/src/cairo-scaled-font.c
@@ -2498,7 +2498,11 @@ _cairo_scaled_glyph_set_surface (cairo_scaled_glyph_t *scaled_glyph,
     /* sanity check the backend glyph contents */
     _cairo_debug_check_image_surface_is_defined (&surface->base);
     scaled_glyph->surface = surface;
-    scaled_glyph->has_info |= CAIRO_SCALED_GLYPH_INFO_SURFACE;
+
+    if (surface != NULL)
+	scaled_glyph->has_info |= CAIRO_SCALED_GLYPH_INFO_SURFACE;
+    else
+	scaled_glyph->has_info &= ~CAIRO_SCALED_GLYPH_INFO_SURFACE;
 }
 
 void
@@ -2508,8 +2512,13 @@ _cairo_scaled_glyph_set_path (cairo_scaled_glyph_t *scaled_glyph,
 {
     if (scaled_glyph->path != NULL)
 	_cairo_path_fixed_destroy (scaled_glyph->path);
+
     scaled_glyph->path = path;
-    scaled_glyph->has_info |= CAIRO_SCALED_GLYPH_INFO_PATH;
+
+    if (path != NULL)
+	scaled_glyph->has_info |= CAIRO_SCALED_GLYPH_INFO_PATH;
+    else
+	scaled_glyph->has_info &= ~CAIRO_SCALED_GLYPH_INFO_PATH;
 }
 
 void
@@ -2523,7 +2532,11 @@ _cairo_scaled_glyph_set_recording_surface (cairo_scaled_glyph_t *scaled_glyph,
     }
 
     scaled_glyph->recording_surface = recording_surface;
-    scaled_glyph->has_info |= CAIRO_SCALED_GLYPH_INFO_RECORDING_SURFACE;
+
+    if (recording_surface != NULL)
+	scaled_glyph->has_info |= CAIRO_SCALED_GLYPH_INFO_RECORDING_SURFACE;
+    else
+	scaled_glyph->has_info &= ~CAIRO_SCALED_GLYPH_INFO_RECORDING_SURFACE;
 }
 
 static cairo_bool_t


More information about the cairo-commit mailing list