From 6b40ba283b6d09a7bf3bd0ec795a19b05b9bfec4 Mon Sep 17 00:00:00 2001 From: Emmanuel Pacaud Date: Fri, 5 May 2006 12:59:29 +0200 Subject: [PATCH] SVG: Remove special case for unclipped CLEAR and SOURCE in paint when we're in analysis mode. intersect_clip_path is not analyzed, so we can't know if we're clipped when we're in analysis mode. --- src/cairo-svg-surface.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/cairo-svg-surface.c b/src/cairo-svg-surface.c index 29cdfa9e9..96ed4618f 100644 --- a/src/cairo-svg-surface.c +++ b/src/cairo-svg-surface.c @@ -1300,10 +1300,7 @@ _cairo_svg_surface_paint (void *abstract_surface, { cairo_svg_surface_t *surface = abstract_surface; - if (surface->paginated_mode == CAIRO_PAGINATED_MODE_ANALYZE && - !(surface->clip_level == 0 && - (op == CAIRO_OPERATOR_CLEAR || - op == CAIRO_OPERATOR_SOURCE))) + if (surface->paginated_mode == CAIRO_PAGINATED_MODE_ANALYZE) return _analyze_operation (surface, op, source); /* XXX: It would be nice to be able to assert this condition @@ -1318,7 +1315,12 @@ _cairo_svg_surface_paint (void *abstract_surface, /* Emulation of clear and source operators, when no clipping region * is defined. We just delete existing content of surface root node, - * and exit early if operator is clear. */ + * and exit early if operator is clear. + * XXX: optimization of SOURCE operator doesn't work, since analyze + * above always return FALSE. In order to make it work, we need a way + * to know if there's an active clipping path. + * Optimization of CLEAR works because of a test in paginated surface, + * and an optimiszation in meta surface. */ if (surface->clip_level == 0 && (op == CAIRO_OPERATOR_CLEAR || op == CAIRO_OPERATOR_SOURCE)) {