[cairo-commit] 2 commits - src/cairo-polygon-intersect.c src/cairo-tor-scan-converter.c

Chris Wilson ickle at kemper.freedesktop.org
Thu Feb 9 11:46:51 PST 2012


 src/cairo-polygon-intersect.c  |   13 +++++++++++--
 src/cairo-tor-scan-converter.c |    6 ++----
 2 files changed, 13 insertions(+), 6 deletions(-)

New commits:
commit bbdb17fc1826ca50bdfc4e2666249d3e8e1fca4d
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Feb 9 19:43:18 2012 +0000

    tor: Restore the 256x15 sampling of the original rasteriser
    
    A quick hack escaped into the wild, as this was superseded by the
    separate tor22 rasteriser.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/cairo-tor-scan-converter.c b/src/cairo-tor-scan-converter.c
index d6ea778..099b50b 100644
--- a/src/cairo-tor-scan-converter.c
+++ b/src/cairo-tor-scan-converter.c
@@ -115,10 +115,8 @@ typedef cairo_status_t glitter_status_t;
 
 /* The input coordinate scale and the rasterisation grid scales. */
 #define GLITTER_INPUT_BITS CAIRO_FIXED_FRAC_BITS
-//#define GRID_X_BITS CAIRO_FIXED_FRAC_BITS
-//#define GRID_Y 15
-#define GRID_X_BITS 2
-#define GRID_Y_BITS 2
+#define GRID_X_BITS CAIRO_FIXED_FRAC_BITS
+#define GRID_Y 15
 
 /* Set glitter up to use a cairo span renderer to do the coverage
  * blitting. */
commit 658fa75a5c78c8ca08bc5c1f8f29d50a9da0aaf5
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Feb 9 19:40:26 2012 +0000

    polygon: Extend intersection edges to cover entire range
    
    By simply swapping the continuation edges, we end up with a set of edges
    that are defined over a shorter range than their extents. Whilst this is
    numerically stable at our normal precision we start to encounter issues
    when using a coarser grid during rasterisation as the derivative of the
    edge becomes unstable.
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44722
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/cairo-polygon-intersect.c b/src/cairo-polygon-intersect.c
index 573f801..0e5b0b9 100644
--- a/src/cairo-polygon-intersect.c
+++ b/src/cairo-polygon-intersect.c
@@ -1179,8 +1179,17 @@ edges_start_or_continue (cairo_bo_edge_t	*left,
 
     if (left->deferred.other != NULL) {
 	if (right != NULL && edges_colinear (left->deferred.other, right)) {
-	    /* continuation on right, so just swap edges */
-	    assert (left->deferred.other->deferred.other == NULL);
+	    cairo_bo_edge_t *old = left->deferred.other;
+
+	    /* continuation on right, extend right to cover both */
+	    assert (old->deferred.other == NULL);
+	    assert (old->edge.dir == right->edge.dir);
+	    assert (old->edge.line.p2.y > old->edge.line.p1.y);
+
+	    if (old->edge.line.p1.y < right->edge.line.p1.y)
+		right->edge.line.p1 = old->edge.line.p1;
+	    if (old->edge.line.p2.y > right->edge.line.p2.y)
+		right->edge.line.p2 = old->edge.line.p2;
 	    left->deferred.other = right;
 	    return;
 	}


More information about the cairo-commit mailing list