Index: trunk/src/hid.h =================================================================== --- trunk/src/hid.h (revision 25342) +++ trunk/src/hid.h (revision 25343) @@ -317,7 +317,7 @@ void (*fill_circle)(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t radius); void (*fill_polygon)(pcb_hid_gc_t gc, int n_coords, pcb_coord_t *x, pcb_coord_t *y); void (*fill_polygon_offs)(pcb_hid_gc_t gc, int n_coords, pcb_coord_t *x, pcb_coord_t *y, pcb_coord_t dx, pcb_coord_t dy); - void (*fill_pcb_polygon)(pcb_hid_gc_t gc, pcb_poly_t *poly, const pcb_box_t *clip_box); + void (*fill_pcb_polygon)(pcb_hid_gc_t gc, pcb_polyarea_t *poly, const pcb_box_t *clip_box, int fullpoly); void (*thindraw_pcb_polygon)(pcb_hid_gc_t gc, pcb_poly_t *poly, const pcb_box_t *clip_box); void (*fill_rect)(pcb_hid_gc_t gc, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2); Index: trunk/src/hid_draw_helpers.c =================================================================== --- trunk/src/hid_draw_helpers.c (revision 25342) +++ trunk/src/hid_draw_helpers.c (revision 25343) @@ -224,6 +224,7 @@ void pcb_dhlp_draw_helpers_init(pcb_hid_t * hid) { - hid->fill_pcb_polygon = pcb_dhlp_fill_pcb_polygon; +TODO("Remove this: nogui should leave these NULL"); + hid->fill_pcb_polygon = NULL; hid->thindraw_pcb_polygon = pcb_dhlp_thindraw_pcb_polygon; } Index: trunk/src/hid_nogui.c =================================================================== --- trunk/src/hid_nogui.c (revision 25342) +++ trunk/src/hid_nogui.c (revision 25343) @@ -159,7 +159,7 @@ CRASH("fill_polygon"); } -static void nogui_fill_pcb_polygon(pcb_hid_gc_t gc, pcb_poly_t * poly, const pcb_box_t * clip_box) +static void nogui_fill_pcb_polygon(pcb_hid_gc_t gc, pcb_polyarea_t *poly, const pcb_box_t *clip_box, int fullpoly) { CRASH("fill_pcb_polygon"); } Index: trunk/src/obj_poly.c =================================================================== --- trunk/src/obj_poly.c (revision 25342) +++ trunk/src/obj_poly.c (revision 25343) @@ -1181,6 +1181,14 @@ return np; } +static void pcb_poly_draw_filled(pcb_hid_gc_t gc, pcb_poly_t *poly, const pcb_box_t *clip_box) +{ + if (pcb_gui->fill_pcb_polygon == NULL) + pcb_dhlp_fill_pcb_polygon(gc, poly, clip_box); /* no direct poly rendering support, pass on simplified x;y */ + else + pcb_gui->fill_pcb_polygon(gc, poly->Clipped, clip_box, PCB_FLAG_TEST(PCB_FLAG_FULLPOLY, poly)); /* direct polyarea rendering */ +} + void pcb_poly_draw_(pcb_draw_info_t *info, pcb_poly_t *polygon, int allow_term_gfx) { pcb_poly_t *trpoly = NULL; @@ -1207,7 +1215,7 @@ if ((allow_term_gfx) && pcb_draw_term_need_gfx(polygon) && pcb_draw_term_hid_permission()) { pcb_vnode_t *n, *head; int i; - pcb_gui->fill_pcb_polygon(pcb_draw_out.active_padGC, polygon, info->drawn_area); + pcb_poly_draw_filled(pcb_draw_out.active_padGC, polygon, info->drawn_area); head = &polygon->Clipped->contours->head; pcb_hid_set_line_cap(pcb_draw_out.fgGC, pcb_cap_square); for(n = head, i = 0; (n != head) || (i == 0); n = n->next, i++) { @@ -1223,7 +1231,7 @@ } } else - pcb_gui->fill_pcb_polygon(pcb_draw_out.fgGC, polygon, info->drawn_area); + pcb_poly_draw_filled(pcb_draw_out.fgGC, polygon, info->drawn_area); } /* If checking planes, thin-draw any pieces which have been clipped away */ Index: trunk/src_plugins/export_ps/ps.c =================================================================== --- trunk/src_plugins/export_ps/ps.c (revision 25342) +++ trunk/src_plugins/export_ps/ps.c (revision 25343) @@ -1211,7 +1211,7 @@ return *c1 < *c2; } -static void ps_fill_pcb_polygon(pcb_hid_gc_t gc, pcb_poly_t * poly, const pcb_box_t * clip_box) +static void ps_fill_pcb_polygon(pcb_hid_gc_t gc, pcb_polyarea_t *poly, const pcb_box_t *clip_box, int fullpoly) { /* Ignore clip_box, just draw everything */ @@ -1222,7 +1222,7 @@ use_gc(gc); - pl = poly->Clipped->contours; + pl = poly->contours; len = 0; do { Index: trunk/src_plugins/hid_gtk2_gl/gtkhid-gl.c =================================================================== --- trunk/src_plugins/hid_gtk2_gl/gtkhid-gl.c (revision 25342) +++ trunk/src_plugins/hid_gtk2_gl/gtkhid-gl.c (revision 25343) @@ -515,11 +515,11 @@ hidgl_fill_polygon_offs(n_coords, x, y, dx, dy); } -static void ghid_gl_fill_pcb_polygon(pcb_hid_gc_t gc, pcb_poly_t *poly, const pcb_box_t *clip_box) +static void ghid_gl_fill_pcb_polygon(pcb_hid_gc_t gc, pcb_polyarea_t *poly, const pcb_box_t *clip_box, int fullpoly) { USE_GC(gc); - hidgl_fill_pcb_polygon(poly->Clipped, clip_box, gport->view.coord_per_px, PCB_FLAG_TEST(PCB_FLAG_FULLPOLY, poly)); + hidgl_fill_pcb_polygon(poly, clip_box, gport->view.coord_per_px, fullpoly); } static void ghid_gl_thindraw_pcb_polygon(pcb_hid_gc_t gc, pcb_poly_t *poly, const pcb_box_t *clip_box) Index: trunk/src_plugins/loghid/hid-logger.c =================================================================== --- trunk/src_plugins/loghid/hid-logger.c (revision 25342) +++ trunk/src_plugins/loghid/hid-logger.c (revision 25343) @@ -184,10 +184,10 @@ delegatee_->fill_polygon_offs(gc, n_coords, x, y, dx, dy); } -static void log_fill_pcb_polygon(pcb_hid_gc_t gc, pcb_poly_t *poly, const pcb_box_t *clip_box) +static void log_fill_pcb_polygon(pcb_hid_gc_t gc, pcb_polyarea_t *poly, const pcb_box_t *clip_box, int fullpoly) { - pcb_fprintf(out_, "fill_pcb_polygon(gc, poly->PointN=%d, ...)\n", poly->PointN); - delegatee_->fill_pcb_polygon(gc, poly, clip_box); + pcb_fprintf(out_, "fill_pcb_polygon(gc, ...)\n"); + delegatee_->fill_pcb_polygon(gc, poly, clip_box, fullpoly); } static void log_thindraw_pcb_polygon(pcb_hid_gc_t gc, pcb_poly_t *poly, const pcb_box_t *clip_box)