[cairo-commit] src/cairo-polygon-intersect.c

Chris Wilson ickle at kemper.freedesktop.org
Mon Nov 21 09:00:49 PST 2011


 src/cairo-polygon-intersect.c |   13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

New commits:
commit 56746110fe0a83979ceb51f7b186b2b74f7ff974
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon Nov 21 16:57:42 2011 +0000

    polygon-intersection: Finish any edges upon intersection
    
    In order to keep the bookkeeping in order, and so prevent a later
    assert, we need to clear any edges when swapping the active edge order
    upon an intersection event. The active edges are then reconstructed.
    
    Fixes evince http://www.horizonhobby.com/pdf/BLH3500-Manual_EN.pdf
    
    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 92becd0..573f801 100644
--- a/src/cairo-polygon-intersect.c
+++ b/src/cairo-polygon-intersect.c
@@ -1172,6 +1172,8 @@ edges_start_or_continue (cairo_bo_edge_t	*left,
 			 int			 top,
 			 cairo_polygon_t	*polygon)
 {
+    assert (right->deferred.other == NULL);
+
     if (left->deferred.other == right)
 	return;
 
@@ -1233,13 +1235,11 @@ active_edges (cairo_bo_edge_t		*left,
 		}
 
 		right = right->next;
-	    } while (right);
+	    } while (1);
 
 	    edges_start_or_continue (left, right, top, polygon);
 
-	    left = right;
-	    if (left != NULL)
-		left = left->next;
+	    left = right->next;
 	}
 }
 
@@ -1324,6 +1324,11 @@ intersection_sweep (cairo_bo_event_t   **start_events,
 	    if (e2 != e1->next)
 		break;
 
+	    if (e1->deferred.other)
+		edges_end (e1, sweep_line.current_y, polygon);
+	    if (e2->deferred.other)
+		edges_end (e2, sweep_line.current_y, polygon);
+
 	    left = e1->prev;
 	    right = e2->next;
 


More information about the cairo-commit mailing list