summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2016-11-17 20:10:07 +0100
committercinap_lenrek <cinap_lenrek@felloff.net>2016-11-17 20:10:07 +0100
commit28f4567ba615c4036c079021392825757ef2a008 (patch)
treebe226fccd3470ef044d36536e0d336318a7982a0
parent6fc0e0541c6f27dcb4c6196eab5badedf49c01c8 (diff)
libmemdraw: cleanup fillpoly(), remove unused fillcolor hack
-rw-r--r--sys/src/libmemdraw/fillpoly.c33
1 files changed, 2 insertions, 31 deletions
diff --git a/sys/src/libmemdraw/fillpoly.c b/sys/src/libmemdraw/fillpoly.c
index 6ecccc0a1..5bc647b18 100644
--- a/sys/src/libmemdraw/fillpoly.c
+++ b/sys/src/libmemdraw/fillpoly.c
@@ -27,18 +27,6 @@ static void xscan(Memimage *dst, Seg **seg, Seg *segtab, int nseg, int wind, Mem
static void yscan(Memimage *dst, Seg **seg, Seg *segtab, int nseg, int wind, Memimage *src, Point sp, int, int);
static void
-fillcolor(Memimage *dst, int left, int right, int y, Memimage *src, Point p)
-{
- int srcval;
-
- USED(src);
- srcval = p.x;
- p.x = left;
- p.y = y;
- memset(byteaddr(dst, p), srcval, right-left);
-}
-
-static void
fillline(Memimage *dst, int left, int right, int y, Memimage *src, Point p, int op)
{
Rectangle r;
@@ -165,25 +153,8 @@ xscan(Memimage *dst, Seg **seg, Seg *segtab, int nseg, int wind, Memimage *src,
Seg **ep, **next, **p, **q, *s;
long n, i, iy, cnt, ix, ix2, minx, maxx;
Point pt;
- void (*fill)(Memimage*, int, int, int, Memimage*, Point, int);
-
- fill = fillline;
-/*
- * This can only work on 8-bit destinations, since fillcolor is
- * just using memset on sp.x.
- *
- * I'd rather not even enable it then, since then if the general
- * code is too slow, someone will come up with a better improvement
- * than this sleazy hack. -rsc
- *
- if(clipped && (src->flags&Frepl) && src->depth==8 && Dx(src->r)==1 && Dy(src->r)==1) {
- fill = fillcolor;
- sp.x = membyteval(src);
- }
- *
- */
- USED(clipped);
+ USED(clipped);
for(i=0, s=segtab, p=seg; i<nseg; i++, s++) {
*p = s;
@@ -300,7 +271,7 @@ xscan(Memimage *dst, Seg **seg, Seg *segtab, int nseg, int wind, Memimage *src,
ix = (x + x2) >> (fixshift+1);
ix2 = ix+1;
}
- (*fill)(dst, ix, ix2, iy, src, sp, op);
+ fillline(dst, ix, ix2, iy, src, sp, op);
}
y += (1<<fixshift);
iy++;