[cairo-commit] 2 commits - src/cairoint.h src/cairo-path-stroke-polygon.c src/cairo-spans-compositor.c test/reference

Chris Wilson ickle at kemper.freedesktop.org
Mon May 14 10:29:47 PDT 2012


 dev/null                                        |binary
 src/cairo-path-stroke-polygon.c                 |   14 +++-----------
 src/cairo-spans-compositor.c                    |    3 +++
 src/cairoint.h                                  |    2 ++
 test/reference/close-path-current-point.ref.png |binary
 test/reference/fallback.traps.argb32.ref.png    |binary
 test/reference/fallback.traps.rgb24.ref.png     |binary
 test/reference/halo.ref.png                     |binary
 test/reference/rounded-rectangle-stroke.ref.png |binary
 9 files changed, 8 insertions(+), 11 deletions(-)

New commits:
commit e41dffb329e4a6fcb4e75fb501843838a499c4c8
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon May 14 17:46:32 2012 +0100

    stroke: Don't drop clockwise==0 lines
    
    If the join indicates the pair of edges are parallel, we may be
    considering the final segment of the spline with a different tangent
    vector than the slope of the final edge and so lead to false dropping of
    an edge. This has the effect that the line segments between 'arc arc arc
    arc' (a rounded rectangle) are no longer horizontal or vertical. As path
    construction tries to eliminate joins between colinear segments, this
    optimisation should not be required anyway.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/cairo-path-stroke-polygon.c b/src/cairo-path-stroke-polygon.c
index 919e7db..88527f5 100644
--- a/src/cairo-path-stroke-polygon.c
+++ b/src/cairo-path-stroke-polygon.c
@@ -1052,7 +1052,6 @@ line_to (void *closure,
     cairo_stroke_face_t start;
     cairo_point_t *p1 = &stroker->current_face.point;
     cairo_slope_t dev_slope;
-    int move_last = 0;
 
     stroker->has_initial_sub_path = TRUE;
 
@@ -1069,9 +1068,7 @@ line_to (void *closure,
     if (stroker->has_current_face) {
 	int clockwise = _cairo_slope_compare (&stroker->current_face.dev_vector,
 					      &start.dev_vector);
-	if (clockwise == 0) {
-	    move_last = 1;
-	} else {
+	if (clockwise) {
 	    clockwise = clockwise < 0;
 	    /* Join with final face from previous segment */
 	    if (! within_tolerance (&stroker->current_face.ccw, &start.ccw,
@@ -1102,13 +1099,8 @@ line_to (void *closure,
     stroker->current_face.cw.x += dev_slope.dx;
     stroker->current_face.cw.y += dev_slope.dy;
 
-    if (move_last) {
-	*_cairo_contour_last_point (&stroker->cw.contour) = stroker->current_face.cw;
-	*_cairo_contour_last_point (&stroker->ccw.contour) = stroker->current_face.ccw;
-    } else {
-	contour_add_point (stroker, &stroker->cw, &stroker->current_face.cw);
-	contour_add_point (stroker, &stroker->ccw, &stroker->current_face.ccw);
-    }
+    contour_add_point (stroker, &stroker->cw, &stroker->current_face.cw);
+    contour_add_point (stroker, &stroker->ccw, &stroker->current_face.ccw);
 
     return CAIRO_STATUS_SUCCESS;
 }
diff --git a/test/reference/arc-direction.traps.argb32.ref.png b/test/reference/arc-direction.traps.argb32.ref.png
deleted file mode 100644
index 280c09b..0000000
Binary files a/test/reference/arc-direction.traps.argb32.ref.png and /dev/null differ
diff --git a/test/reference/arc-direction.traps.rgb24.ref.png b/test/reference/arc-direction.traps.rgb24.ref.png
deleted file mode 100644
index 280c09b..0000000
Binary files a/test/reference/arc-direction.traps.rgb24.ref.png and /dev/null differ
diff --git a/test/reference/close-path-current-point.argb32.ref.png b/test/reference/close-path-current-point.argb32.ref.png
deleted file mode 100644
index ab3124b..0000000
Binary files a/test/reference/close-path-current-point.argb32.ref.png and /dev/null differ
diff --git a/test/reference/close-path-current-point.ref.png b/test/reference/close-path-current-point.ref.png
index 9d3fd24..3ae4900 100644
Binary files a/test/reference/close-path-current-point.ref.png and b/test/reference/close-path-current-point.ref.png differ
diff --git a/test/reference/close-path-current-point.rgb24.ref.png b/test/reference/close-path-current-point.rgb24.ref.png
deleted file mode 100644
index ab3124b..0000000
Binary files a/test/reference/close-path-current-point.rgb24.ref.png and /dev/null differ
diff --git a/test/reference/fallback.traps.argb32.ref.png b/test/reference/fallback.traps.argb32.ref.png
index b7ce573..c0c5f46 100644
Binary files a/test/reference/fallback.traps.argb32.ref.png and b/test/reference/fallback.traps.argb32.ref.png differ
diff --git a/test/reference/fallback.traps.rgb24.ref.png b/test/reference/fallback.traps.rgb24.ref.png
index 16d3c14..18b6a7c 100644
Binary files a/test/reference/fallback.traps.rgb24.ref.png and b/test/reference/fallback.traps.rgb24.ref.png differ
diff --git a/test/reference/halo.argb32.ref.png b/test/reference/halo.argb32.ref.png
deleted file mode 100644
index 191ee47..0000000
Binary files a/test/reference/halo.argb32.ref.png and /dev/null differ
diff --git a/test/reference/halo.ref.png b/test/reference/halo.ref.png
index ebe0c61..a2b7ae1 100644
Binary files a/test/reference/halo.ref.png and b/test/reference/halo.ref.png differ
diff --git a/test/reference/halo.rgb24.ref.png b/test/reference/halo.rgb24.ref.png
deleted file mode 100644
index 191ee47..0000000
Binary files a/test/reference/halo.rgb24.ref.png and /dev/null differ
diff --git a/test/reference/halo.traps.argb32.ref.png b/test/reference/halo.traps.argb32.ref.png
deleted file mode 100644
index 191ee47..0000000
Binary files a/test/reference/halo.traps.argb32.ref.png and /dev/null differ
diff --git a/test/reference/halo.traps.rgb24.ref.png b/test/reference/halo.traps.rgb24.ref.png
deleted file mode 100644
index 191ee47..0000000
Binary files a/test/reference/halo.traps.rgb24.ref.png and /dev/null differ
diff --git a/test/reference/rounded-rectangle-stroke.argb32.ref.png b/test/reference/rounded-rectangle-stroke.argb32.ref.png
deleted file mode 100644
index 3f2a1fb..0000000
Binary files a/test/reference/rounded-rectangle-stroke.argb32.ref.png and /dev/null differ
diff --git a/test/reference/rounded-rectangle-stroke.ref.png b/test/reference/rounded-rectangle-stroke.ref.png
index b0f1b07..6285750 100644
Binary files a/test/reference/rounded-rectangle-stroke.ref.png and b/test/reference/rounded-rectangle-stroke.ref.png differ
diff --git a/test/reference/rounded-rectangle-stroke.rgb24.ref.png b/test/reference/rounded-rectangle-stroke.rgb24.ref.png
deleted file mode 100644
index 3f2a1fb..0000000
Binary files a/test/reference/rounded-rectangle-stroke.rgb24.ref.png and /dev/null differ
commit 099420a07c33c66daf5392d4ca1df06585791751
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon May 14 17:50:54 2012 +0100

    spans: Debug input paths and polygons
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/cairo-spans-compositor.c b/src/cairo-spans-compositor.c
index 5b59cb3..6cc9a7b 100644
--- a/src/cairo-spans-compositor.c
+++ b/src/cairo-spans-compositor.c
@@ -991,6 +991,8 @@ _cairo_spans_compositor_stroke (const cairo_compositor_t	*_compositor,
     const cairo_spans_compositor_t *compositor = (cairo_spans_compositor_t*)_compositor;
     cairo_int_status_t status;
 
+    TRACE_ (_cairo_debug_print_path (stderr, path));
+
     status = CAIRO_INT_STATUS_UNSUPPORTED;
     if (_cairo_path_fixed_stroke_is_rectilinear (path)) {
 	cairo_boxes_t boxes;
@@ -1031,6 +1033,7 @@ _cairo_spans_compositor_stroke (const cairo_compositor_t	*_compositor,
 						      ctm, ctm_inverse,
 						      tolerance,
 						      &polygon);
+	TRACE_ (_cairo_debug_print_polygon (stderr, &polygon));
 	if (status == CAIRO_INT_STATUS_SUCCESS && extents->clip->num_boxes > 1) {
 	    status = _cairo_polygon_intersect_with_boxes (&polygon, &fill_rule,
 							  extents->clip->boxes,
diff --git a/src/cairoint.h b/src/cairoint.h
index 9f20d51..d8070e5 100644
--- a/src/cairoint.h
+++ b/src/cairoint.h
@@ -2011,8 +2011,10 @@ _cairo_debug_print_clip (FILE *stream, const cairo_clip_t *clip);
 
 #if 0
 #define TRACE(x) fprintf x
+#define TRACE_(x) x
 #else
 #define TRACE(x)
+#define TRACE_(x)
 #endif
 
 #endif


More information about the cairo-commit mailing list