Skip to content

Commit 62da23b

Browse files
committed
Removed polygon from DRAW struct
1 parent fcac6e7 commit 62da23b

File tree

1 file changed

+6
-22
lines changed

1 file changed

+6
-22
lines changed

src/libImaging/Draw.c

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -589,21 +589,6 @@ polygon_generic(Imaging im, int n, Edge *e, int ink, int eofill, hline_handler h
589589
return 0;
590590
}
591591

592-
static inline int
593-
polygon8(Imaging im, int n, Edge *e, int ink, int eofill) {
594-
return polygon_generic(im, n, e, ink, eofill, hline8);
595-
}
596-
597-
static inline int
598-
polygon32(Imaging im, int n, Edge *e, int ink, int eofill) {
599-
return polygon_generic(im, n, e, ink, eofill, hline32);
600-
}
601-
602-
static inline int
603-
polygon32rgba(Imaging im, int n, Edge *e, int ink, int eofill) {
604-
return polygon_generic(im, n, e, ink, eofill, hline32rgba);
605-
}
606-
607592
static inline void
608593
add_edge(Edge *e, int x0, int y0, int x1, int y1) {
609594
/* printf("edge %d %d %d %d\n", x0, y0, x1, y1); */
@@ -640,12 +625,11 @@ typedef struct {
640625
void (*point)(Imaging im, int x, int y, int ink);
641626
void (*hline)(Imaging im, int x0, int y0, int x1, int ink);
642627
void (*line)(Imaging im, int x0, int y0, int x1, int y1, int ink);
643-
int (*polygon)(Imaging im, int n, Edge *e, int ink, int eofill);
644628
} DRAW;
645629

646-
DRAW draw8 = {point8, hline8, line8, polygon8};
647-
DRAW draw32 = {point32, hline32, line32, polygon32};
648-
DRAW draw32rgba = {point32rgba, hline32rgba, line32rgba, polygon32rgba};
630+
DRAW draw8 = {point8, hline8, line8};
631+
DRAW draw32 = {point32, hline32, line32};
632+
DRAW draw32rgba = {point32rgba, hline32rgba, line32rgba};
649633

650634
/* -------------------------------------------------------------------- */
651635
/* Interface */
@@ -730,7 +714,7 @@ ImagingDrawWideLine(
730714
add_edge(e + 2, vertices[2][0], vertices[2][1], vertices[3][0], vertices[3][1]);
731715
add_edge(e + 3, vertices[3][0], vertices[3][1], vertices[0][0], vertices[0][1]);
732716

733-
draw->polygon(im, 4, e, ink, 0);
717+
polygon_generic(im, 4, e, ink, 0, draw->hline);
734718
}
735719
return 0;
736720
}
@@ -838,7 +822,7 @@ ImagingDrawPolygon(
838822
if (xy[i * 2] != xy[0] || xy[i * 2 + 1] != xy[1]) {
839823
add_edge(&e[n++], xy[i * 2], xy[i * 2 + 1], xy[0], xy[1]);
840824
}
841-
draw->polygon(im, n, e, ink, 0);
825+
polygon_generic(im, n, e, ink, 0, draw->hline);
842826
free(e);
843827

844828
} else {
@@ -1988,7 +1972,7 @@ ImagingDrawOutline(
19881972

19891973
DRAWINIT();
19901974

1991-
draw->polygon(im, outline->count, outline->edges, ink, 0);
1975+
polygon_generic(im, outline->count, outline->edges, ink, 0, draw->hline);
19921976

19931977
return 0;
19941978
}

0 commit comments

Comments
 (0)