[cairo-commit] src/cairo-compositor.c src/cairo-fallback-compositor.c src/cairo-gl-composite.c src/cairo-gl-glyphs.c src/cairo-gl-msaa-compositor.c src/cairo-gl-operand.c src/cairo-gl-private.h src/cairo-gl-source.c src/cairo-gl-spans-compositor.c src/cairo-gl-surface.c src/cairo-gl-traps-compositor.c src/cairo-spans-compositor.c src/cairo-surface.c

Chris Wilson ickle at kemper.freedesktop.org
Wed Feb 29 02:30:26 PST 2012


 src/cairo-compositor.c          |    5 ++++
 src/cairo-fallback-compositor.c |    5 ++++
 src/cairo-gl-composite.c        |    3 --
 src/cairo-gl-glyphs.c           |   47 +++++++++++++++++++++-------------------
 src/cairo-gl-msaa-compositor.c  |    6 +----
 src/cairo-gl-operand.c          |   13 +++++++++--
 src/cairo-gl-private.h          |    7 ++++-
 src/cairo-gl-source.c           |    1 
 src/cairo-gl-spans-compositor.c |   43 ++++++++++++++++++++++--------------
 src/cairo-gl-surface.c          |    4 +--
 src/cairo-gl-traps-compositor.c |   12 +++++-----
 src/cairo-spans-compositor.c    |   13 +++++++++++
 src/cairo-surface.c             |    6 +++++
 13 files changed, 108 insertions(+), 57 deletions(-)

New commits:
commit a49a26f961bc284d496ea7e16dd79e0ddb36c98e
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Wed Feb 29 10:03:00 2012 +0000

    gl: Various fixes for glyphs
    
    Not 100% improvement, there are still a variety of failures with
    GLXWindows, but getting there. At least it fixes more things than its
    breaks...
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/cairo-compositor.c b/src/cairo-compositor.c
index f6b06e5..56e46ef 100644
--- a/src/cairo-compositor.c
+++ b/src/cairo-compositor.c
@@ -51,6 +51,7 @@ _cairo_compositor_paint (const cairo_compositor_t	*compositor,
     cairo_composite_rectangles_t extents;
     cairo_int_status_t status;
 
+    TRACE ((stderr, "%s\n", __FUNCTION__));
     status = _cairo_composite_rectangles_init_for_paint (&extents, surface,
 							 op, source,
 							 clip);
@@ -86,6 +87,7 @@ _cairo_compositor_mask (const cairo_compositor_t	*compositor,
     cairo_composite_rectangles_t extents;
     cairo_int_status_t status;
 
+    TRACE ((stderr, "%s\n", __FUNCTION__));
     status = _cairo_composite_rectangles_init_for_mask (&extents, surface,
 							op, source, mask,
 							clip);
@@ -126,6 +128,7 @@ _cairo_compositor_stroke (const cairo_compositor_t	*compositor,
     cairo_composite_rectangles_t extents;
     cairo_int_status_t status;
 
+    TRACE ((stderr, "%s\n", __FUNCTION__));
     status = _cairo_composite_rectangles_init_for_stroke (&extents, surface,
 							  op, source,
 							  path, style, ctm,
@@ -167,6 +170,7 @@ _cairo_compositor_fill (const cairo_compositor_t	*compositor,
     cairo_composite_rectangles_t extents;
     cairo_int_status_t status;
 
+    TRACE ((stderr, "%s\n", __FUNCTION__));
     status = _cairo_composite_rectangles_init_for_fill (&extents, surface,
 							op, source, path,
 							clip);
@@ -206,6 +210,7 @@ _cairo_compositor_glyphs (const cairo_compositor_t		*compositor,
     cairo_bool_t overlap;
     cairo_int_status_t status;
 
+    TRACE ((stderr, "%s\n", __FUNCTION__));
     status = _cairo_composite_rectangles_init_for_glyphs (&extents, surface,
 							  op, source,
 							  scaled_font,
diff --git a/src/cairo-fallback-compositor.c b/src/cairo-fallback-compositor.c
index 767fc6b..efc8a79 100644
--- a/src/cairo-fallback-compositor.c
+++ b/src/cairo-fallback-compositor.c
@@ -53,6 +53,7 @@ _cairo_fallback_compositor_paint (const cairo_compositor_t	*_compositor,
     cairo_surface_t *image;
     cairo_int_status_t status;
 
+    TRACE ((stderr, "%s\n", __FUNCTION__));
     image = cairo_surface_map_to_image (extents->surface, &extents->unbounded);
     status = _cairo_surface_offset_paint (image,
 					  extents->unbounded.x,
@@ -72,6 +73,7 @@ _cairo_fallback_compositor_mask (const cairo_compositor_t	*_compositor,
     cairo_surface_t *image;
     cairo_int_status_t status;
 
+    TRACE ((stderr, "%s\n", __FUNCTION__));
     image = cairo_surface_map_to_image (extents->surface, &extents->unbounded);
     status = _cairo_surface_offset_mask (image,
 					 extents->unbounded.x,
@@ -98,6 +100,7 @@ _cairo_fallback_compositor_stroke (const cairo_compositor_t	*_compositor,
     cairo_surface_t *image;
     cairo_int_status_t status;
 
+    TRACE ((stderr, "%s\n", __FUNCTION__));
     image = cairo_surface_map_to_image (extents->surface, &extents->unbounded);
     status = _cairo_surface_offset_stroke (image,
 					   extents->unbounded.x,
@@ -125,6 +128,7 @@ _cairo_fallback_compositor_fill (const cairo_compositor_t	*_compositor,
     cairo_surface_t *image;
     cairo_int_status_t status;
 
+    TRACE ((stderr, "%s\n", __FUNCTION__));
     image = cairo_surface_map_to_image (extents->surface, &extents->unbounded);
     status = _cairo_surface_offset_fill (image,
 					 extents->unbounded.x,
@@ -150,6 +154,7 @@ _cairo_fallback_compositor_glyphs (const cairo_compositor_t	*_compositor,
     cairo_surface_t *image;
     cairo_int_status_t status;
 
+    TRACE ((stderr, "%s\n", __FUNCTION__));
     image = cairo_surface_map_to_image (extents->surface, &extents->unbounded);
     status = _cairo_surface_offset_glyphs (image,
 					   extents->unbounded.x,
diff --git a/src/cairo-gl-composite.c b/src/cairo-gl-composite.c
index 064f4d7..bd7c675 100644
--- a/src/cairo-gl-composite.c
+++ b/src/cairo-gl-composite.c
@@ -768,8 +768,7 @@ cairo_status_t
 _cairo_gl_composite_init (cairo_gl_composite_t *setup,
                           cairo_operator_t op,
                           cairo_gl_surface_t *dst,
-                          cairo_bool_t assume_component_alpha,
-                          const cairo_rectangle_int_t *rect)
+                          cairo_bool_t assume_component_alpha)
 {
     memset (setup, 0, sizeof (cairo_gl_composite_t));
 
diff --git a/src/cairo-gl-glyphs.c b/src/cairo-gl-glyphs.c
index c553d7d..832956f 100644
--- a/src/cairo-gl-glyphs.c
+++ b/src/cairo-gl-glyphs.c
@@ -234,13 +234,17 @@ render_glyphs (cairo_gl_surface_t	*dst,
     cairo_int_status_t status;
     int i = 0;
 
+    TRACE ((stderr, "%s (%d, %d)x(%d, %d)\n", __FUNCTION__,
+	    info->extents.x, info->extents.y,
+	    info->extents.width, info->extents.height));
+
     *has_component_alpha = FALSE;
 
     status = _cairo_gl_context_acquire (dst->base.device, &ctx);
     if (unlikely (status))
 	return status;
 
-    status = _cairo_gl_composite_init (&setup, op, dst, TRUE, &info->extents);
+    status = _cairo_gl_composite_init (&setup, op, dst, TRUE);
     if (unlikely (status))
 	goto FINISH;
 
@@ -281,11 +285,8 @@ render_glyphs (cairo_gl_surface_t	*dst,
 	    _cairo_gl_composite_set_mask_operand (&setup, &cache->surface->operand);
 	    *has_component_alpha |= cache->surface->operand.texture.attributes.has_component_alpha;
 
-            /* XXX: _cairo_gl_composite_begin() acquires the context a
-             * second time. Need to refactor this loop so this doesn't happen.
-             */
+	    /* XXX Shoot me. */
             status = _cairo_gl_composite_begin (&setup, &ctx);
-
             status = _cairo_gl_context_release (ctx, status);
 	    if (unlikely (status))
 		goto FINISH;
@@ -318,8 +319,8 @@ render_glyphs (cairo_gl_surface_t	*dst,
 	x_offset = scaled_glyph->surface->base.device_transform.x0;
 	y_offset = scaled_glyph->surface->base.device_transform.y0;
 
-	x1 = _cairo_lround (info->glyphs[i].x - x_offset);
-	y1 = _cairo_lround (info->glyphs[i].y - y_offset);
+	x1 = _cairo_lround (info->glyphs[i].x - x_offset - dst_x);
+	y1 = _cairo_lround (info->glyphs[i].y - y_offset - dst_y);
 	x2 = x1 + scaled_glyph->surface->width;
 	y2 = y1 + scaled_glyph->surface->height;
 
@@ -340,6 +341,7 @@ render_glyphs (cairo_gl_surface_t	*dst,
 
 static cairo_int_status_t
 render_glyphs_via_mask (cairo_gl_surface_t *dst,
+			int dst_x, int dst_y,
 			cairo_operator_t  op,
 			cairo_surface_t *source,
 			cairo_composite_glyphs_info_t *info)
@@ -347,7 +349,8 @@ render_glyphs_via_mask (cairo_gl_surface_t *dst,
     cairo_surface_t *mask;
     cairo_status_t status;
     cairo_bool_t has_component_alpha;
-    int i;
+
+    TRACE ((stderr, "%s\n", __FUNCTION__));
 
     /* XXX: For non-CA, this should be CAIRO_CONTENT_ALPHA to save memory */
     mask = cairo_gl_surface_create (dst->base.device,
@@ -357,12 +360,8 @@ render_glyphs_via_mask (cairo_gl_surface_t *dst,
     if (unlikely (mask->status))
         return mask->status;
 
-    for (i = 0; i < info->num_glyphs; i++) {
-	info->glyphs[i].x -= info->extents.x;
-	info->glyphs[i].y -= info->extents.y;
-    }
-
-    status = render_glyphs ((cairo_gl_surface_t *) mask, 0, 0,
+    status = render_glyphs ((cairo_gl_surface_t *) mask,
+			    info->extents.x, info->extents.y,
 			    CAIRO_OPERATOR_ADD, NULL,
 			    info, &has_component_alpha);
     if (likely (status == CAIRO_STATUS_SUCCESS)) {
@@ -372,22 +371,23 @@ render_glyphs_via_mask (cairo_gl_surface_t *dst,
 	mask->is_clear = FALSE;
 	_cairo_pattern_init_for_surface (&mask_pattern, mask);
 	mask_pattern.base.has_component_alpha = has_component_alpha;
+	mask_pattern.base.filter = CAIRO_FILTER_NEAREST;
+	mask_pattern.base.extend = CAIRO_EXTEND_NONE;
 
 	cairo_matrix_init_translate (&mask_pattern.base.matrix,
-		                     -info->extents.x, -info->extents.y);
+		                     dst_x-info->extents.x, dst_y-info->extents.y);
 
 	_cairo_pattern_init_for_surface (&source_pattern, source);
+	cairo_matrix_init_translate (&source_pattern.base.matrix,
+		                     dst_x-info->extents.x, dst_y-info->extents.y);
+
 	status = _cairo_surface_mask (&dst->base, op,
-		                      &source_pattern.base, &mask_pattern.base,
+		                      &source_pattern.base,
+				      &mask_pattern.base,
 				      NULL);
 
 	_cairo_pattern_fini (&mask_pattern.base);
 	_cairo_pattern_fini (&source_pattern.base);
-    } else {
-	for (i = 0; i < info->num_glyphs; i++) {
-	    info->glyphs[i].x += info->extents.x;
-	    info->glyphs[i].y += info->extents.y;
-	}
     }
 
     cairo_surface_destroy (mask);
@@ -425,6 +425,8 @@ _cairo_gl_composite_glyphs (void			*_dst,
     cairo_bool_t has_component_alpha;
     int i;
 
+    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.
@@ -445,7 +447,8 @@ _cairo_gl_composite_glyphs (void			*_dst,
     }
 
     if (info->use_mask) {
-	return render_glyphs_via_mask (dst, op, _src, info);
+	return render_glyphs_via_mask (dst, dst_x, dst_y,
+				       op, _src, info);
     } else {
 	return render_glyphs (dst, dst_x, dst_y,
 			      op, _src, info,
diff --git a/src/cairo-gl-msaa-compositor.c b/src/cairo-gl-msaa-compositor.c
index 4436b2c..7d8fa08 100644
--- a/src/cairo-gl-msaa-compositor.c
+++ b/src/cairo-gl-msaa-compositor.c
@@ -318,8 +318,7 @@ _cairo_gl_msaa_compositor_stroke (const cairo_compositor_t	*compositor,
     status = _cairo_gl_composite_init (&info.setup,
 				       composite->op,
 				       dst,
-				       FALSE, /* assume_component_alpha */
-				       &composite->bounded);
+				       FALSE /* assume_component_alpha */);
     if (unlikely (status))
 	return status;
 
@@ -393,8 +392,7 @@ _cairo_gl_msaa_compositor_fill (const cairo_compositor_t	*compositor,
     status = _cairo_gl_composite_init (&setup,
 				       composite->op,
 				       dst,
-				       FALSE, /* assume_component_alpha */
-				       &composite->bounded);
+				       FALSE /* assume_component_alpha */);
     if (unlikely (status))
 	goto cleanup_traps;
 
diff --git a/src/cairo-gl-operand.c b/src/cairo-gl-operand.c
index f571e1d..ddff5e7 100644
--- a/src/cairo-gl-operand.c
+++ b/src/cairo-gl-operand.c
@@ -174,7 +174,7 @@ _cairo_gl_subsurface_operand_init (cairo_gl_operand_t *operand,
     }
 
     surface = (cairo_gl_surface_t *) sub->target;
-    if (surface->base.device != dst->base.device)
+    if (surface->base.device && surface->base.device != dst->base.device)
 	return CAIRO_INT_STATUS_UNSUPPORTED;
 
     /* Translate the matrix from
@@ -220,7 +220,7 @@ _cairo_gl_surface_operand_init (cairo_gl_operand_t *operand,
 	return CAIRO_INT_STATUS_UNSUPPORTED;
     }
 
-    if (surface->base.device != dst->base.device)
+    if (surface->base.device && surface->base.device != dst->base.device)
 	return CAIRO_INT_STATUS_UNSUPPORTED;
 
     *operand = surface->operand;
@@ -307,6 +307,14 @@ _cairo_gl_solid_operand_init (cairo_gl_operand_t *operand,
     operand->constant.color[3] = color->alpha;
 }
 
+void
+_cairo_gl_operand_translate (cairo_gl_operand_t *operand,
+			     double tx, double ty)
+{
+    operand->texture.attributes.matrix.x0 -= tx * operand->texture.attributes.matrix.xx;
+    operand->texture.attributes.matrix.y0 -= ty * operand->texture.attributes.matrix.yy;
+}
+
 static cairo_status_t
 _cairo_gl_gradient_operand_init (cairo_gl_operand_t *operand,
                                  const cairo_pattern_t *pattern,
@@ -456,6 +464,7 @@ _cairo_gl_operand_init (cairo_gl_operand_t *operand,
 {
     cairo_int_status_t status;
 
+    TRACE ((stderr, "%s: type=%d\n", __FUNCTION__, pattern->type));
     switch (pattern->type) {
     case CAIRO_PATTERN_TYPE_SOLID:
 	_cairo_gl_solid_operand_init (operand,
diff --git a/src/cairo-gl-private.h b/src/cairo-gl-private.h
index a0cf50b..3afdd70 100644
--- a/src/cairo-gl-private.h
+++ b/src/cairo-gl-private.h
@@ -449,8 +449,7 @@ cairo_private cairo_status_t
 _cairo_gl_composite_init (cairo_gl_composite_t *setup,
                           cairo_operator_t op,
                           cairo_gl_surface_t *dst,
-                          cairo_bool_t has_component_alpha,
-                          const cairo_rectangle_int_t *rect);
+                          cairo_bool_t has_component_alpha);
 
 cairo_private void
 _cairo_gl_composite_fini (cairo_gl_composite_t *setup);
@@ -671,6 +670,10 @@ _cairo_gl_operand_copy (cairo_gl_operand_t *dst,
 			const cairo_gl_operand_t *src);
 
 cairo_private void
+_cairo_gl_operand_translate (cairo_gl_operand_t *operand,
+			     double tx, double ty);
+
+cairo_private void
 _cairo_gl_operand_destroy (cairo_gl_operand_t *operand);
 
 cairo_private const cairo_compositor_t *
diff --git a/src/cairo-gl-source.c b/src/cairo-gl-source.c
index 00c68db..294f6f9 100644
--- a/src/cairo-gl-source.c
+++ b/src/cairo-gl-source.c
@@ -65,6 +65,7 @@ _cairo_gl_pattern_to_source (cairo_surface_t *dst,
     cairo_gl_source_t *source;
     cairo_int_status_t status;
 
+    TRACE ((stderr, "%s\n", __FUNCTION__));
     if (pattern == NULL)
 	return _cairo_gl_white_source ();
 
diff --git a/src/cairo-gl-spans-compositor.c b/src/cairo-gl-spans-compositor.c
index c86b638..0e31ea9 100644
--- a/src/cairo-gl-spans-compositor.c
+++ b/src/cairo-gl-spans-compositor.c
@@ -240,13 +240,14 @@ emit_aligned_boxes (cairo_gl_context_t *ctx,
     const struct _cairo_boxes_chunk *chunk;
     int i;
 
+    TRACE ((stderr, "%s: num_boxes=%d\n", __FUNCTION__, boxes->num_boxes));
     for (chunk = &boxes->chunks; chunk; chunk = chunk->next) {
 	for (i = 0; i < chunk->count; i++) {
 	    int x1 = _cairo_fixed_integer_part (chunk->base[i].p1.x);
 	    int y1 = _cairo_fixed_integer_part (chunk->base[i].p1.y);
 	    int x2 = _cairo_fixed_integer_part (chunk->base[i].p2.x);
 	    int y2 = _cairo_fixed_integer_part (chunk->base[i].p2.y);
-	    _cairo_gl_composite_emit_rect (ctx, x1, y1, x2, y2, 0);
+	    _cairo_gl_composite_emit_rect (ctx, x1, y1, x2, y2, 255);
 	}
     }
 }
@@ -261,7 +262,8 @@ fill_boxes (void		*_dst,
     cairo_gl_context_t *ctx;
     cairo_int_status_t status;
 
-    status = _cairo_gl_composite_init (&setup, op, _dst, FALSE, NULL);
+    TRACE ((stderr, "%s\n", __FUNCTION__));
+    status = _cairo_gl_composite_init (&setup, op, _dst, FALSE);
     if (unlikely (status))
         goto FAIL;
 
@@ -297,15 +299,19 @@ composite_boxes (void			*_dst,
     cairo_gl_context_t *ctx;
     cairo_int_status_t status;
 
-    status = _cairo_gl_composite_init (&setup, op, _dst, FALSE, extents);
+    TRACE ((stderr, "%s mask=(%d,%d), dst=(%d, %d)\n", __FUNCTION__,
+	    mask_x, mask_y, dst_x, dst_y));
+    status = _cairo_gl_composite_init (&setup, op, _dst, FALSE);
     if (unlikely (status))
         goto FAIL;
 
     _cairo_gl_composite_set_source_operand (&setup,
 					    source_to_operand (abstract_src));
+    _cairo_gl_operand_translate (&setup.mask, -src_x, -src_y);
 
     _cairo_gl_composite_set_mask_operand (&setup,
 					  source_to_operand (abstract_mask));
+    _cairo_gl_operand_translate (&setup.mask, -mask_x, -mask_y);
 
     status = _cairo_gl_composite_begin (&setup, &ctx);
     if (unlikely (status))
@@ -346,7 +352,7 @@ _cairo_gl_span_renderer_init (cairo_abstract_span_renderer_t	*_r,
 
     status = _cairo_gl_composite_init (&r->setup,
                                        op, (cairo_gl_surface_t *)composite->surface,
-                                       FALSE, &composite->unbounded);
+                                       FALSE);
     if (unlikely (status))
         goto FAIL;
 
@@ -416,21 +422,24 @@ _cairo_gl_span_renderer_fini (cairo_abstract_span_renderer_t *_r,
 const cairo_compositor_t *
 _cairo_gl_span_compositor_get (void)
 {
-    static cairo_spans_compositor_t compositor;
+    static cairo_spans_compositor_t spans;
+    static cairo_compositor_t shape;
 
-    if (compositor.base.delegate == NULL) {
+    if (spans.base.delegate == NULL) {
 	/* The fallback to traps here is essentially just for glyphs... */
-	_cairo_spans_compositor_init (&compositor,
-				      _cairo_gl_traps_compositor_get());
-
-	compositor.fill_boxes = fill_boxes;
-	//compositor.check_composite_boxes = check_composite_boxes;
-	compositor.pattern_to_surface = _cairo_gl_pattern_to_source;
-	compositor.composite_boxes = composite_boxes;
-	//compositor.check_span_renderer = check_span_renderer;
-	compositor.renderer_init = _cairo_gl_span_renderer_init;
-	compositor.renderer_fini = _cairo_gl_span_renderer_fini;
+	_cairo_shape_mask_compositor_init (&shape,
+					   _cairo_gl_traps_compositor_get());
+	shape.glyphs = NULL;
+
+	_cairo_spans_compositor_init (&spans, &shape);
+	spans.fill_boxes = fill_boxes;
+	//spans.check_composite_boxes = check_composite_boxes;
+	spans.pattern_to_surface = _cairo_gl_pattern_to_source;
+	spans.composite_boxes = composite_boxes;
+	//spans.check_span_renderer = check_span_renderer;
+	spans.renderer_init = _cairo_gl_span_renderer_init;
+	spans.renderer_fini = _cairo_gl_span_renderer_fini;
     }
 
-    return &compositor.base;
+    return &spans.base;
 }
diff --git a/src/cairo-gl-surface.c b/src/cairo-gl-surface.c
index c0d768a..43e4bfc 100644
--- a/src/cairo-gl-surface.c
+++ b/src/cairo-gl-surface.c
@@ -758,8 +758,8 @@ _cairo_gl_surface_fill_alpha_channel (cairo_gl_surface_t *dst,
     _cairo_gl_composite_flush (ctx);
     glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_TRUE);
 
-    status = _cairo_gl_composite_init (&setup, CAIRO_OPERATOR_SOURCE, dst,
-                                       FALSE, NULL);
+    status = _cairo_gl_composite_init (&setup, CAIRO_OPERATOR_SOURCE,
+				       dst, FALSE);
     if (unlikely (status))
         goto CLEANUP;
 
diff --git a/src/cairo-gl-traps-compositor.c b/src/cairo-gl-traps-compositor.c
index 0fb7c4c..776b74c 100644
--- a/src/cairo-gl-traps-compositor.c
+++ b/src/cairo-gl-traps-compositor.c
@@ -132,7 +132,7 @@ fill_boxes (void		*_dst,
     cairo_gl_context_t *ctx;
     cairo_int_status_t status;
 
-    status = _cairo_gl_composite_init (&setup, op, _dst, FALSE, NULL);
+    status = _cairo_gl_composite_init (&setup, op, _dst, FALSE);
     if (unlikely (status))
         goto FAIL;
 
@@ -168,7 +168,7 @@ composite_boxes (void			*_dst,
     cairo_gl_context_t *ctx;
     cairo_int_status_t status;
 
-    status = _cairo_gl_composite_init (&setup, op, _dst, FALSE, extents);
+    status = _cairo_gl_composite_init (&setup, op, _dst, FALSE);
     if (unlikely (status))
         goto FAIL;
 
@@ -208,7 +208,7 @@ composite (void			*_dst,
     cairo_gl_context_t *ctx;
     cairo_int_status_t status;
 
-    status = _cairo_gl_composite_init (&setup, op, _dst, FALSE, NULL);
+    status = _cairo_gl_composite_init (&setup, op, _dst, FALSE);
     if (unlikely (status))
         goto FAIL;
 
@@ -279,7 +279,7 @@ traps_to_operand (void *_dst,
     cairo_surface_pattern_t pattern;
     cairo_status_t status;
 
-    pixman_format = antialias != CAIRO_ANTIALIAS_NONE ? PIXMAN_a8 : PIXMAN_a1,
+    pixman_format = antialias != CAIRO_ANTIALIAS_NONE ? PIXMAN_a8 : PIXMAN_a1;
     pixman_image = pixman_image_create_bits (pixman_format,
 					     extents->width,
 					     extents->height,
@@ -350,7 +350,7 @@ composite_traps (void			*_dst,
     cairo_gl_context_t *ctx;
     cairo_int_status_t status;
 
-    status = _cairo_gl_composite_init (&setup, op, _dst, FALSE, NULL);
+    status = _cairo_gl_composite_init (&setup, op, _dst, FALSE);
     if (unlikely (status))
         goto FAIL;
 
@@ -447,7 +447,7 @@ composite_tristrip (void		*_dst,
     if (unlikely (mask->base.status))
 	return mask->base.status;
 
-    status = _cairo_gl_composite_init (&setup, op, _dst, FALSE, NULL);
+    status = _cairo_gl_composite_init (&setup, op, _dst, FALSE);
     if (unlikely (status))
         goto FAIL;
 
diff --git a/src/cairo-spans-compositor.c b/src/cairo-spans-compositor.c
index b106d73..8cc47c2 100644
--- a/src/cairo-spans-compositor.c
+++ b/src/cairo-spans-compositor.c
@@ -314,6 +314,7 @@ fixup_unbounded_boxes (const cairo_spans_compositor_t *compositor,
 
     assert (boxes->is_pixel_aligned);
 
+    TRACE ((stderr, "%s\n", __FUNCTION__));
     if (extents->bounded.width  == extents->unbounded.width &&
 	extents->bounded.height == extents->unbounded.height)
     {
@@ -444,6 +445,8 @@ composite_aligned_boxes (const cairo_spans_compositor_t		*compositor,
     cairo_bool_t no_mask;
     cairo_bool_t inplace;
 
+    TRACE ((stderr, "%s: need_clip_mask=%d, is-bounded=%d\n",
+	    __FUNCTION__, need_clip_mask, extents->is_bounded));
     if (need_clip_mask && ! extents->is_bounded)
 	return CAIRO_INT_STATUS_UNSUPPORTED;
 
@@ -452,6 +455,9 @@ composite_aligned_boxes (const cairo_spans_compositor_t		*compositor,
 	CAIRO_ALPHA_IS_OPAQUE (extents->mask_pattern.solid.color.alpha);
     inplace = ! need_clip_mask && op_is_source && no_mask;
 
+    TRACE ((stderr, "%s: op-is-source=%d [op=%d], no-mask=%d, inplace=%d\n",
+	    __FUNCTION__, op_is_source, op, no_mask, inplace));
+
     if (op == CAIRO_OPERATOR_SOURCE && (need_clip_mask || ! no_mask)) {
 	/* SOURCE with a mask is actually a LERP in cairo semantics */
 	if ((compositor->flags & CAIRO_SPANS_COMPOSITOR_HAS_LERP) == 0)
@@ -582,6 +588,7 @@ composite_boxes (const cairo_spans_compositor_t *compositor,
     cairo_int_status_t status;
     cairo_box_t box;
 
+    TRACE ((stderr, "%s\n", __FUNCTION__));
     _cairo_box_from_rectangle (&box, &extents->unbounded);
     if (composite_needs_clip (extents, &box))
 	return CAIRO_INT_STATUS_UNSUPPORTED;
@@ -620,6 +627,7 @@ composite_polygon (const cairo_spans_compositor_t	*compositor,
     cairo_bool_t needs_clip;
     cairo_int_status_t status;
 
+    TRACE ((stderr, "%s\n", __FUNCTION__));
     needs_clip = extents->clip->path != NULL || extents->clip->num_boxes > 1;
     if (needs_clip) {
 	return CAIRO_INT_STATUS_UNSUPPORTED;
@@ -688,6 +696,7 @@ clip_and_composite_boxes (const cairo_spans_compositor_t	*compositor,
     cairo_int_status_t status;
     cairo_polygon_t polygon;
 
+    TRACE ((stderr, "%s\n", __FUNCTION__));
     status = trim_extents_to_boxes (extents, boxes);
     if (unlikely (status))
 	return status;
@@ -761,6 +770,8 @@ clip_and_composite_polygon (const cairo_spans_compositor_t	*compositor,
 {
     cairo_int_status_t status;
 
+    TRACE ((stderr, "%s\n", __FUNCTION__));
+
     /* XXX simply uses polygon limits.point extemities, tessellation? */
     status = trim_extents_to_polygon (extents, polygon);
     if (unlikely (status))
@@ -822,6 +833,7 @@ _cairo_spans_compositor_paint (const cairo_compositor_t		*_compositor,
     cairo_boxes_t boxes;
     cairo_int_status_t status;
 
+    TRACE ((stderr, "%s\n", __FUNCTION__));
     _cairo_clip_steal_boxes (extents->clip, &boxes);
     status = clip_and_composite_boxes (compositor, extents, &boxes);
     _cairo_clip_unsteal_boxes (extents->clip, &boxes);
@@ -837,6 +849,7 @@ _cairo_spans_compositor_mask (const cairo_compositor_t		*_compositor,
     cairo_int_status_t status;
     cairo_boxes_t boxes;
 
+    TRACE ((stderr, "%s\n", __FUNCTION__));
     _cairo_clip_steal_boxes (extents->clip, &boxes);
     status = clip_and_composite_boxes (compositor, extents, &boxes);
     _cairo_clip_unsteal_boxes (extents->clip, &boxes);
diff --git a/src/cairo-surface.c b/src/cairo-surface.c
index b3a48f1..d8f5b91 100644
--- a/src/cairo-surface.c
+++ b/src/cairo-surface.c
@@ -1818,6 +1818,7 @@ _cairo_surface_paint (cairo_surface_t		*surface,
 {
     cairo_int_status_t status;
 
+    TRACE ((stderr, "%s\n", __FUNCTION__));
     if (unlikely (surface->status))
 	return surface->status;
 
@@ -1851,6 +1852,7 @@ _cairo_surface_mask (cairo_surface_t		*surface,
 {
     cairo_int_status_t status;
 
+    TRACE ((stderr, "%s\n", __FUNCTION__));
     if (unlikely (surface->status))
 	return surface->status;
 
@@ -1905,6 +1907,7 @@ _cairo_surface_fill_stroke (cairo_surface_t	    *surface,
 {
     cairo_int_status_t status;
 
+    TRACE ((stderr, "%s\n", __FUNCTION__));
     if (unlikely (surface->status))
 	return surface->status;
 
@@ -1982,6 +1985,7 @@ _cairo_surface_stroke (cairo_surface_t			*surface,
 {
     cairo_int_status_t status;
 
+    TRACE ((stderr, "%s\n", __FUNCTION__));
     if (unlikely (surface->status))
 	return surface->status;
 
@@ -2022,6 +2026,7 @@ _cairo_surface_fill (cairo_surface_t		*surface,
 {
     cairo_int_status_t status;
 
+    TRACE ((stderr, "%s\n", __FUNCTION__));
     if (unlikely (surface->status))
 	return surface->status;
 
@@ -2228,6 +2233,7 @@ _cairo_surface_show_text_glyphs (cairo_surface_t	    *surface,
     cairo_int_status_t status;
     cairo_scaled_font_t *dev_scaled_font = scaled_font;
 
+    TRACE ((stderr, "%s\n", __FUNCTION__));
     if (unlikely (surface->status))
 	return surface->status;
 


More information about the cairo-commit mailing list