[cairo-commit] 3 commits - NEWS src/cairo-path-in-fill.c test/in-fill-trapezoid.c

Chris Wilson ickle at kemper.freedesktop.org
Wed Nov 5 17:24:58 PST 2008


 NEWS                     |   42 +++++++++++++++++++++++++++++
 src/cairo-path-in-fill.c |    2 -
 test/in-fill-trapezoid.c |   66 +++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 109 insertions(+), 1 deletion(-)

New commits:
commit ff0bd64e9436026f11e85eafcd74e9a0131c8b9f
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Nov 6 01:22:39 2008 +0000

    [NEWS] Add a few notes.
    
    Help Carl with a speedy snapshot by writing a few notes about what has been
    added so far to 1.9.

diff --git a/NEWS b/NEWS
index ec2041f..a2965a0 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,45 @@
+Release 1.9.2 (2008-11-08?)
+===========================
+
+API additions:
+
+  cairo_surface_set_mime_data()
+  cairo_surface_get_mime_data()
+
+    Associate an alternate, compressed, representation for a surface.
+    Currently:
+     "image/jpeg" is understood by PDF,PS,SVG,win32-printing.
+     "image/png" is understood by SVG.
+
+New backend:
+
+   Simple DirectMedia Layer
+
+New utility:
+
+  cairo-trace
+
+    Generates a human-readable, replayable, compact representation of
+    the sequences of drawing commands made by an application.
+    Though currently the replay tools are out-of-tree -
+      people.freedesktop.org:~ickle/cairo-script,
+      people.freedesktop.org:~ickle/sphinx
+
+Test suite overhaul:
+  The test suite is undergoing an overhaul, primarily to improve its speed
+  and utility.
+
+Optimisations:
+Tweaks to tessellator, allocations of patterns, delayed initialisation of
+the xlib backend (reduce the cairo overhead of render_bench by ~80%).
+
+Bug fixes:
+EXTEND_PAD.
+Better handling of large scale-factors on image patterns.
+Emit /Interpolate for PS,PDF images.
+
+
+
 Release 1.8.2 (2008-10-29 Carl Worth <cworth at cworth.org>)
 =========================================================
 The cairo community is pleased to announce the 1.8.2 release of the
commit 13627b46209f9239d10a155f2de7e53c0585e4c2
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Nov 6 01:04:52 2008 +0000

    [in-fill] Fix transposed arguments.
    
    Silly typo that escaped the test suite.

diff --git a/src/cairo-path-in-fill.c b/src/cairo-path-in-fill.c
index 8bfc9d8..f9920ea 100644
--- a/src/cairo-path-in-fill.c
+++ b/src/cairo-path-in-fill.c
@@ -125,7 +125,7 @@ _cairo_in_fill_add_edge (cairo_in_fill_t *in_fill,
 	return;
 
     if ((p1->x <= in_fill->x && p2->x <= in_fill->x) ||
-	edge_compare_for_y_against_x (p1, p2, in_fill->x, in_fill->y) <= 0)
+	edge_compare_for_y_against_x (p1, p2, in_fill->y, in_fill->x) <= 0)
     {
 	in_fill->winding += dir;
     }
commit 9dee7af41f4f5a4c1285e9d7951148e78659c064
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Nov 6 01:02:23 2008 +0000

    [test] Add off-centre tests to in-fill-trapezoid.
    
    Reading through the previous commit spotted that the arguments to
    edge_compare_for_y_against_x were transposed, but the test-suite had
    failed to catch detect it. This is due that in order to actually
    solve the equation we need to have a diagonal edge passing near an
    off-centre point of interest, which was not among the test cases. So add
    some off-centre tests to fully exercise the code.

diff --git a/test/in-fill-trapezoid.c b/test/in-fill-trapezoid.c
index f38f97d..717a87a 100644
--- a/test/in-fill-trapezoid.c
+++ b/test/in-fill-trapezoid.c
@@ -124,6 +124,72 @@ draw (cairo_t *cr, int width, int height)
 	ret = CAIRO_TEST_FAILURE;
     }
 
+    /* check off-centre */
+    cairo_new_path (cr);
+    cairo_arc (cr, 7.5, 0, 10, 0, 2 * M_PI);
+    cairo_arc_negative (cr, 7.5, 0, 5, 0, -2 * M_PI);
+    if (cairo_in_fill (cr, 7.5, 0)) {
+	cairo_test_log (ctx, "Error: Found an unexpected point inside circular hole\n");
+	ret = CAIRO_TEST_FAILURE;
+    }
+    cairo_new_path (cr);
+    cairo_arc (cr, 0, 7.5, 10, 0, 2 * M_PI);
+    cairo_arc_negative (cr, 0, 7.5, 5, 0, -2 * M_PI);
+    if (cairo_in_fill (cr, 0, 7.5)) {
+	cairo_test_log (ctx, "Error: Found an unexpected point inside circular hole\n");
+	ret = CAIRO_TEST_FAILURE;
+    }
+    cairo_new_path (cr);
+    cairo_arc (cr, 15, 0, 10, 0, 2 * M_PI);
+    if (! cairo_in_fill (cr, 15, 0)) {
+	cairo_test_log (ctx, "Error: Failed to find point inside circle\n");
+	ret = CAIRO_TEST_FAILURE;
+    }
+    cairo_new_path (cr);
+    cairo_arc (cr, 0, 15, 10, 0, 2 * M_PI);
+    if (! cairo_in_fill (cr, 0, 15)) {
+	cairo_test_log (ctx, "Error: Failed to find point inside circle\n");
+	ret = CAIRO_TEST_FAILURE;
+    }
+
+    /* simple rectangle */
+    cairo_new_path (cr);
+    cairo_rectangle (cr, 10, 0, 5, 5);
+    if (cairo_in_fill (cr, 0, 0)) {
+	cairo_test_log (ctx, "Error: Found an unexpected point outside rectangle\n");
+	ret = CAIRO_TEST_FAILURE;
+    }
+    if (cairo_in_fill (cr, 20, 20)) {
+	cairo_test_log (ctx, "Error: Found an unexpected point outside rectangle\n");
+	ret = CAIRO_TEST_FAILURE;
+    }
+    if (! cairo_in_fill (cr, 12.5, 2.5)) {
+	cairo_test_log (ctx, "Error: Failed to find point inside rectangle\n");
+	ret = CAIRO_TEST_FAILURE;
+    }
+
+    /* off-centre triangle */
+    cairo_new_path (cr);
+    cairo_move_to (cr, 10, 0);
+    cairo_line_to (cr, 15, 5);
+    cairo_line_to (cr, 5, 5);
+    cairo_close_path (cr);
+    if (cairo_in_fill (cr, 0, 0) ||
+	cairo_in_fill (cr, 10, 10) ||
+	cairo_in_fill (cr, 20, 0) ||
+	cairo_in_fill (cr, 7, 2.5) ||
+	cairo_in_fill (cr, 13, 2.5))
+    {
+	cairo_test_log (ctx, "Error: Found an unexpected point outside triangle\n");
+	ret = CAIRO_TEST_FAILURE;
+    }
+    if (! cairo_in_fill (cr, 8, 2.5) ||
+	! cairo_in_fill (cr, 12, 2.5))
+    {
+	cairo_test_log (ctx, "Error: Failed to find point inside triangle\n");
+	ret = CAIRO_TEST_FAILURE;
+    }
+
     return ret;
 }
 


More information about the cairo-commit mailing list