+ event_t* e = event_new();
+ e->type = s->delta.y ? EVENT_START : EVENT_HORIZONTAL;
+ e->p = s->a;
+ e->s1 = s;
+ e->s2 = 0;
+
+ if(queue) queue_put(queue, e);
+ else hqueue_put(hqueue, e);
+
+ if(e->type != EVENT_HORIZONTAL) {
+ break;
+ }
+ }
+ if(s) {
+#ifdef DEBUG
+ fprintf(stderr, "attaching contingency of stroke %08x to segment [%d] %s\n",
+ stroke, s, s->delta.y?"":"(horizontal)");
+#endif
+ s->stroke = stroke;
+ s->stroke_pos = pos;
+ }
+}
+
+static void gfxpoly_enqueue(gfxpoly_t*p, queue_t*queue, hqueue_t*hqueue, int polygon_nr)
+{
+ int t;
+ gfxpolystroke_t*stroke = p->strokes;
+ for(;stroke;stroke=stroke->next) {
+ assert(stroke->num_points > 1);
+
+#ifdef CHECKS
+ int s;
+ for(s=0;s<stroke->num_points-1;s++) {
+ assert(stroke->points[s].y <= stroke->points[s+1].y);
+ }
+#endif
+ advance_stroke(queue, hqueue, stroke, polygon_nr, 0);