[cairo] [PATCH] Fix apply_evenodd_fill_rule_and_step_edges

Jeff Muizelaar jeff at infidigm.net
Wed Jul 28 14:20:37 PDT 2010


  commit a5336782b47f32fb476d0f936b5d692060449cc7
Author: Jeff Muizelaar <jmuizelaar at mozilla.com>
Date:   Tue May 11 15:14:28 2010 -0400

     Fix apply_evenodd_fill_rule_and_step_edges

     If the right most edge is clipped away we can exit the coverage
     loop before we are supposed to. Keeping track of the winding ensures
     that this doesn't happen.

diff --git a/src/cairo-tor-scan-converter.c b/src/cairo-tor-scan-converter.c
index 7cea78d..d28f5c0 100644
--- a/src/cairo-tor-scan-converter.c
+++ b/src/cairo-tor-scan-converter.c
@@ -1512,6 +1512,7 @@ apply_evenodd_fill_rule_and_step_edges (struct 
active_list *active,
      left_edge = *cursor;
      while (NULL != left_edge) {
      struct edge *right_edge;
+    int winding = left_edge->dir;

      left_edge->height_left -= GRID_Y;
      if (left_edge->height_left)
@@ -1530,10 +1531,13 @@ apply_evenodd_fill_rule_and_step_edges (struct 
active_list *active,
          else
          *cursor = right_edge->next;

-        if (right_edge->next == NULL ||
-        right_edge->next->x.quo != right_edge->x.quo)
-        {
-        break;
+        winding += right_edge->dir;
+        if ((winding & 1) == 0) {
+        if (right_edge->next == NULL ||
+            right_edge->next->x.quo != right_edge->x.quo)
+        {
+            break;
+        }
          }

          if (! right_edge->vertical) {



More information about the cairo mailing list