[cairo] [PATCH 4/8] xml: Don't assert on unsupported mesh and raster source patterns

Bryce W. Harrington b.harrington at samsung.com
Fri Feb 21 18:07:06 PST 2014


This quells the following warnings:

  src/cairo-xml-surface.c:722:5: warning: enumeration value
  ‘CAIRO_PATTERN_TYPE_MESH’ not handled in switch
  src/cairo-xml-surface.c:722:5: warning: enumeration value
  ‘CAIRO_PATTERN_TYPE_RASTER_SOURCE’ not handled
  in switch

I didn't find matching routines to handle these recently added enums, so
gather they're unsupported in xml.  But we probably shouldn't crash if
they're present.

Signed-off-by: Bryce Harrington <b.harrington at samsung.com>
---
 src/cairo-xml-surface.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/cairo-xml-surface.c b/src/cairo-xml-surface.c
index c9473c2..20d049c 100644
--- a/src/cairo-xml-surface.c
+++ b/src/cairo-xml-surface.c
@@ -732,6 +732,10 @@ _cairo_xml_emit_pattern (cairo_xml_t *xml,
     case CAIRO_PATTERN_TYPE_SURFACE:
 	status = _cairo_xml_emit_surface (xml, (cairo_surface_pattern_t *) pattern);
 	break;
+    case CAIRO_PATTERN_TYPE_MESH:
+    case CAIRO_PATTERN_TYPE_RASTER_SOURCE:
+	status = CAIRO_INT_STATUS_UNSUPPORTED;
+	break;
     default:
 	ASSERT_NOT_REACHED;
 	status = CAIRO_INT_STATUS_UNSUPPORTED;
-- 
1.7.9.5


More information about the cairo mailing list