+ gfxline_t*gfxline = 0;
+ if(poly) {
+ // this is the case where everything went right
+ gfxline_t*line = gfxline_from_gfxpoly(poly);
+ gfxpoly_destroy(poly);
+ *ok = 1;
+ return line;
+ } else {
+ if(i->clip && i->clip->poly) {
+ /* convert current clipping from a polygon to an
+ actual "startclip" written to the output */
+ assert(i->clip->openclips <= 1);
+ gfxline_t*clipline = gfxline_from_gfxpoly(i->clip->poly);
+ i->out->startclip(i->out, clipline);
+ gfxline_free(clipline);
+ gfxpoly_destroy(i->clip->poly);i->clip->poly = 0;
+ i->clip->openclips++;
+ return 0;
+ } else {
+ return 0;
+ }
+ }
+}
+
+void polyops_stroke(struct _gfxdevice*dev, gfxline_t*line, gfxcoord_t width, gfxcolor_t*color, gfx_capType cap_style, gfx_joinType joint_style, gfxcoord_t miterLimit)
+{
+ dbg("polyops_stroke");
+ internal_t*i = (internal_t*)dev->internal;
+
+ gfxpoly_t* poly = gfxpoly_from_stroke(line, width, cap_style, joint_style, miterLimit, DEFAULT_GRID);
+ char ok = 0;
+ gfxline_t*line2 = handle_poly(dev, poly, &ok);
+
+ if(ok) {
+ if(i->out && line2) i->out->fill(i->out, line2, color);
+ gfxline_free(line2);
+ } else {
+ msg("<error> ..");
+ if(i->out) i->out->stroke(i->out, line, width, color, cap_style, joint_style, miterLimit);
+ }