History

get rid of drawdebug cruft

cinap_lenrek committed 9 years ago

Commit d6760dc1 parent 2c92a6e6 files · +11 −176Browse files

Unified · Split

6 files
  1. include/draw.h +0 −1
  2. include/memdraw.h +0 −7
  3. kern/devdraw.c +0 −1
  4. libmemdraw/draw.c +9 −146
  5. libmemdraw/iprint.c +0 −12
  6. libmemlayer/draw.c +2 −9
include/draw.h+0−1
@@ -490,7 +490,6 @@ extern Font *font; · 489 unmodified lines
490490 // extern Image *screen;
491491 extern Screen *_screen;
492492 extern int _cursorfd;
493−extern int _drawdebug; /* set to 1 to see errors from flushimage */
494493 extern void _setdrawop(Display*, Drawop);
495494
496495 #define BGSHORT(p) (((p)[0]<<0) | ((p)[1]<<8))
include/memdraw.h+0−7
@@ -169,10 +169,3 @@ extern Memcmap *memdefcmap; · 168 unmodified lines
169169 * Kernel interface
170170 */
171171 void memimagemove(void*, void*);
172−
173−/*
174− * Kernel cruft
175− */
176−extern void rdb(void);
177−extern int iprint(char*, ...);
178−extern int drawdebug;
kern/devdraw.c+0−1
@@ -1585,7 +1585,6 @@ drawmesg(Client *client, void *av, int n) · 1584 unmodified lines
15851585 m = 1+1;
15861586 if(n < m)
15871587 error(Eshortdraw);
1588− drawdebug = a[1];
15891588 continue;
15901589
15911590 /* ellipse: 'e' dstid[4] srcid[4] center[2*4] a[4] b[4] thick[4] sp[2*4] alpha[4] phi[4]*/
libmemdraw/draw.c+9−146
@@ -3,8 +3,6 @@ · 2 unmodified lines
33 #include <draw.h>
44 #include <memdraw.h>
55
6−int drawdebug;
7−
86 /* perfect approximation to NTSC = .299r+.587g+.114b when 0 ≤ r,g,b < 256 */
97 #define RGB2K(r,g,b) ((156763*(r)+307758*(g)+59769*(b))>>19)
108
@@ -91,7 +89,6 @@ static ulong imgtorgba(Memimage*, ulong); · 80 unmodified lines
9189 static ulong rgbatoimg(Memimage*, ulong);
9290 static ulong pixelbits(Memimage*, Point);
9391
94−#define DBG if(0)
9592 void
9693 memimagedraw(Memimage *dst, Rectangle r, Memimage *src, Point p0, Memimage *mask, Point p1, int op)
9794 {
@@ -100,19 +97,11 @@ memimagedraw(Memimage *dst, Rectangle r, Memimage *src, Point p0, Memimage *mask · 2 unmodified lines
10097 if(mask == nil)
10198 mask = memopaque;
10299
103−DBG print("memimagedraw %p/%luX %R @ %p %p/%luX %P %p/%luX %P... ", dst, dst->chan, r, dst->data->bdata, src, src->chan, p0, mask, mask->chan, p1);
104−
105− if(drawclip(dst, &r, src, &p0, mask, &p1, &par.sr, &par.mr) == 0){
106−// if(drawdebug)
107−// iprint("empty clipped rectangle\n");
100+ if(drawclip(dst, &r, src, &p0, mask, &p1, &par.sr, &par.mr) == 0)
108101 return;
109− }
110102
111− if(op < Clear || op > SoverD){
112−// if(drawdebug)
113−// iprint("op out of range: %d\n", op);
103+ if(op < Clear || op > SoverD)
114104 return;
115− }
116105
117106 par.op = op;
118107 par.dst = dst;
@@ -130,10 +119,8 @@ DBG print("memimagedraw %p/%luX %R @ %p %p/%luX %P %p/%luX %P... ", dst, dst->ch · 11 unmodified lines
130119 par.state |= Simplesrc;
131120 par.srgba = imgtorgba(src, par.sval);
132121 par.sdval = rgbatoimg(dst, par.srgba);
133− if((par.srgba&0xFF) == 0 && (op&DoutS)){
134−// if (drawdebug) iprint("fill with transparent source\n");
122+ if((par.srgba&0xFF) == 0 && (op&DoutS))
135123 return; /* no-op successfully handled */
136− }
137124 }
138125 }
139126
@@ -141,10 +128,8 @@ DBG print("memimagedraw %p/%luX %R @ %p %p/%luX %P %p/%luX %P... ", dst, dst->ch · 1 unmodified line
141128 par.state |= Replmask;
142129 if(Dx(mask->r)==1 && Dy(mask->r)==1){
143130 par.mval = pixelbits(mask, mask->r.min);
144− if(par.mval == 0 && (op&DoutS)){
145−// if(drawdebug) iprint("fill with zero mask\n");
131+ if(par.mval == 0 && (op&DoutS))
146132 return; /* no-op successfully handled */
147− }
148133 par.state |= Simplemask;
149134 if(par.mval == ~0)
150135 par.state |= Fullmask;
@@ -152,10 +137,6 @@ DBG print("memimagedraw %p/%luX %R @ %p %p/%luX %P %p/%luX %P... ", dst, dst->ch · 1 unmodified line
152137 }
153138 }
154139
155−// if(drawdebug)
156−// iprint("dr %R sr %R mr %R...", r, par.sr, par.mr);
157−DBG print("draw dr %R sr %R mr %R %lux\n", r, par.sr, par.mr, par.state);
158−
159140 /*
160141 * Now that we've clipped the parameters down to be consistent, we
161142 * simply try sub-drawing routines in order until we find one that was able
@@ -168,42 +149,27 @@ DBG print("draw dr %R sr %R mr %R %lux\n", r, par.sr, par.mr, par.state); · 6 unmodified lines
168149 * which checks to see if there is anything it can help with.
169150 * There could be an if around this checking to see if dst is in video memory.
170151 */
171−DBG print("test hwdraw\n");
172− if(hwdraw(&par)){
173−//if(drawdebug) iprint("hw handled\n");
174−DBG print("hwdraw handled\n");
152+ if(hwdraw(&par))
175153 return;
176− }
154+
177155 /*
178156 * Optimizations using memmove and memset.
179157 */
180−DBG print("test memoptdraw\n");
181− if(memoptdraw(&par)){
182−//if(drawdebug) iprint("memopt handled\n");
183−DBG print("memopt handled\n");
158+ if(memoptdraw(&par))
184159 return;
185− }
186160
187161 /*
188162 * Character drawing.
189163 * Solid source color being painted through a boolean mask onto a high res image.
190164 */
191−DBG print("test chardraw\n");
192− if(chardraw(&par)){
193−//if(drawdebug) iprint("chardraw handled\n");
194−DBG print("chardraw handled\n");
165+ if(chardraw(&par))
195166 return;
196− }
197167
198168 /*
199169 * General calculation-laden case that does alpha for each pixel.
200170 */
201−DBG print("do alphadraw\n");
202171 alphadraw(&par);
203−//if(drawdebug) iprint("alphadraw handled\n");
204−DBG print("alphadraw handled\n");
205172 }
206−#undef DBG
207173
208174
209175 /*
@@ -573,40 +539,6 @@ clipy(Memimage *img, int *y) · 363 unmodified lines
573539 assert(0 <= *y && *y < dy);
574540 }
575541
576−static void
577−dumpbuf(char *s, Buffer b, int n)
578−{
579− int i;
580− uchar *p;
581−
582− print("%s", s);
583− for(i=0; i<n; i++){
584− print(" ");
585− if(p=b.grey){
586− print(" k%.2uX", *p);
587− b.grey += b.delta;
588− }else{
589− if(p=b.red){
590− print(" r%.2uX", *p);
591− b.red += b.delta;
592− }
593− if(p=b.grn){
594− print(" g%.2uX", *p);
595− b.grn += b.delta;
596− }
597− if(p=b.blu){
598− print(" b%.2uX", *p);
599− b.blu += b.delta;
600− }
601− }
602− if((p=b.alpha) != &ones){
603− print(" α%.2uX", *p);
604− b.alpha += b.delta;
605− }
606− }
607− print("\n");
608−}
609−
610542 /*
611543 * For each scan line, we expand the pixels from source, mask, and destination
612544 * into byte-aligned red, green, blue, alpha, and grey channels. If buffering is not
@@ -622,7 +554,6 @@ dumpbuf(char *s, Buffer b, int n) · 9 unmodified lines
622554 * the calculator, and that buffer is passed to a function to write it to the destination.
623555 * If the buffer is already pointing at the destination, the writing function is a no-op.
624556 */
625−#define DBG if(0)
626557 static int
627558 alphadraw(Memdrawparam *par)
628559 {
@@ -686,9 +617,7 @@ alphadraw(Memdrawparam *par) · 57 unmodified lines
686617 * but it avoids a fair amount of code duplication to make this a case here
687618 * rather than have a separate booldraw.
688619 */
689−//if(drawdebug) iprint("flag %lud mchan %lux=?%x dd %d\n", src->flags&Falpha, mask->chan, GREY1, dst->depth);
690620 if(!(src->flags&Falpha) && mask->chan == GREY1 && dst->depth >= 8 && op == SoverD){
691−//if(drawdebug) iprint("boolcopy...");
692621 rdsrc = convfn(dst, &z->dpar, src, &z->spar, &ndrawbuf);
693622 rddst = readptr;
694623 rdmask = readfn(mask);
@@ -788,13 +717,8 @@ alphadraw(Memdrawparam *par) · 93 unmodified lines
788717 clipy(mask, &masky);
789718
790719 bsrc = rdsrc(&z->spar, z->spar.bufbase, srcy);
791−DBG print("[");
792720 bmask = rdmask(&z->mpar, z->mpar.bufbase, masky);
793−DBG print("]\n");
794721 bdst = rddst(&z->dpar, z->dpar.bufbase, dsty);
795−DBG dumpbuf("src", bsrc, dx);
796−DBG dumpbuf("mask", bmask, dx);
797−DBG dumpbuf("dst", bdst, dx);
798722 bdst = calc(bdst, bsrc, bmask, dx, isgrey, op);
799723 wrdst(&z->dpar, z->dpar.bytermin+dsty*z->dpar.bwidth, bdst);
800724 }
@@ -802,7 +726,6 @@ DBG dumpbuf("dst", bdst, dx); · 1 unmodified line
802726 z->inuse = 0;
803727 return 1;
804728 }
805−#undef DBG
806729
807730 static Buffer
808731 alphacalc0(Buffer bdst, Buffer b1, Buffer b2, int dx, int grey, int op)
@@ -1329,7 +1252,6 @@ greymaskread(Param *p, uchar *buf, int y) · 520 unmodified lines
13291252 return b;
13301253 }
13311254
1332−#define DBG if(0)
13331255 static Buffer
13341256 readnbit(Param *p, uchar *buf, int y)
13351257 {
@@ -1358,22 +1280,18 @@ readnbit(Param *p, uchar *buf, int y) · 22 unmodified lines
13581280 n = p->img->r.max.x - x;
13591281
13601282 r = p->bytermin + y*p->bwidth;
1361−DBG print("readnbit dx %d %p=%p+%d*%d, *r=%d fetch %d ", dx, r, p->bytermin, y, p->bwidth, *r, n);
13621283 bits = *r++;
13631284 nbits = 8;
13641285 if(i=x&(npack-1)){
1365−DBG print("throwaway %d...", i);
13661286 bits <<= depth*i;
13671287 nbits -= depth*i;
13681288 }
13691289 for(i=0; i<n; i++){
13701290 if(nbits == 0){
1371−DBG print("(%.2ux)...", *r);
13721291 bits = *r++;
13731292 nbits = 8;
13741293 }
13751294 *w++ = repl[bits>>sh];
1376−DBG print("bit %x...", repl[bits>>sh]);
13771295 bits <<= depth;
13781296 nbits -= depth;
13791297 }
@@ -1390,24 +1308,20 @@ DBG print("bit %x...", repl[bits>>sh]); · 10 unmodified lines
13901308 n = p->r.min.x - x;
13911309
13921310 r = p->bytey0s + y*p->bwidth;
1393−DBG print("x=%d r=%p...", x, r);
13941311 bits = *r++;
13951312 nbits = 8;
13961313 if(i=x&(npack-1)){
13971314 bits <<= depth*i;
13981315 nbits -= depth*i;
13991316 }
1400−DBG print("nbits=%d...", nbits);
14011317 for(i=0; i<n; i++){
14021318 if(nbits == 0){
14031319 bits = *r++;
14041320 nbits = 8;
14051321 }
14061322 *w++ = repl[bits>>sh];
1407−DBG print("bit %x...", repl[bits>>sh]);
14081323 bits <<= depth;
14091324 nbits -= depth;
1410−DBG print("bits %x nbits %d...", bits, nbits);
14111325 }
14121326 dx -= n;
14131327 if(dx == 0)
@@ -1421,9 +1335,7 @@ DBG print("bits %x nbits %d...", bits, nbits); · 7 unmodified lines
14211335
14221336 return b;
14231337 }
1424−#undef DBG
14251338
1426−#define DBG if(0)
14271339 static void
14281340 writenbit(Param *p, uchar *w, Buffer src)
14291341 {
@@ -1446,7 +1358,6 @@ writenbit(Param *p, uchar *w, Buffer src) · 16 unmodified lines
14461358
14471359 for(; x<ex; x++){
14481360 bits <<= depth;
1449−DBG print(" %x", *r);
14501361 bits |= (*r++ >> sh);
14511362 nbits += depth;
14521363 if(nbits == 8){
@@ -1461,10 +1372,8 @@ DBG print(" %x", *r); · 8 unmodified lines
14611372 bits |= *w & ((1<<sh)-1);
14621373 *w = bits;
14631374 }
1464−DBG print("\n");
14651375 return;
14661376 }
1467−#undef DBG
14681377
14691378 static Buffer
14701379 readcmap(Param *p, uchar *buf, int y)
@@ -1562,7 +1471,6 @@ writecmap(Param *p, uchar *w, Buffer src) · 91 unmodified lines
15621471 }
15631472 }
15641473
1565−#define DBG if(0)
15661474 static Buffer
15671475 readbyte(Param *p, uchar *buf, int y)
15681476 {
@@ -1587,7 +1495,6 @@ readbyte(Param *p, uchar *buf, int y) · 18 unmodified lines
15871495 alphaonly = p->alphaonly;
15881496 copyalpha = (img->flags&Falpha) != 0;
15891497
1590−DBG print("copyalpha %d alphaonly %d convgrey %d isgrey %d\n", copyalpha, alphaonly, convgrey, isgrey);
15911498 /* if we can, avoid processing everything */
15921499 if(!(img->flags&Frepl) && !convgrey && (img->flags&Fbytes)){
15931500 memset(&b, 0, sizeof b);
@@ -1612,7 +1519,6 @@ DBG print("copyalpha %d alphaonly %d convgrey %d isgrey %d\n", copyalpha, alphao · 18 unmodified lines
16121519 return b;
16131520 }
16141521
1615−DBG print("2\n");
16161522 rrepl = replbit[img->nbits[CRed]];
16171523 grepl = replbit[img->nbits[CGreen]];
16181524 brepl = replbit[img->nbits[CBlue]];
@@ -1623,7 +1529,6 @@ DBG print("2\n"); · 4 unmodified lines
16231529 u = r[0] | (r[1]<<8) | (r[2]<<16) | (r[3]<<24);
16241530 if(copyalpha) {
16251531 *w++ = arepl[(u>>img->shift[CAlpha]) & img->mask[CAlpha]];
1626−DBG print("a %x\n", w[-1]);
16271532 }
16281533
16291534 if(isgrey)
@@ -1633,9 +1538,7 @@ DBG print("a %x\n", w[-1]); · 3 unmodified lines
16331538 ugrn = grepl[(u >> img->shift[CGreen]) & img->mask[CGreen]];
16341539 ublu = brepl[(u >> img->shift[CBlue]) & img->mask[CBlue]];
16351540 if(convgrey){
1636−DBG print("g %x %x %x\n", ured, ugrn, ublu);
16371541 *w++ = RGB2K(ured, ugrn, ublu);
1638−DBG print("%x\n", w[-1]);
16391542 }else{
16401543 w[0] = ublu;
16411544 w[1] = ugrn;
@@ -1659,7 +1562,6 @@ DBG print("%x\n", w[-1]); · 17 unmodified lines
16591562 b.grey = buf+copyalpha;
16601563 b.red = b.grn = b.blu = buf+copyalpha;
16611564 b.delta = copyalpha+1;
1662−DBG print("alpha %x grey %x\n", *b.alpha, *b.grey);
16631565 }else{
16641566 b.blu = buf+copyalpha;
16651567 b.grn = buf+copyalpha+1;
@@ -1669,9 +1571,7 @@ DBG print("alpha %x grey %x\n", *b.alpha, *b.grey); · 3 unmodified lines
16691571 }
16701572 return b;
16711573 }
1672−#undef DBG
16731574
1674−#define DBG if(0)
16751575 static void
16761576 writebyte(Param *p, uchar *w, Buffer src)
16771577 {
@@ -1732,12 +1632,9 @@ writebyte(Param *p, uchar *w, Buffer src) · 54 unmodified lines
17321632 mask = (nb==4) ? 0 : ~((1<<img->depth)-1);
17331633 for(i=0; i<dx; i++){
17341634 u = w[0] | (w[1]<<8) | (w[2]<<16) | (w[3]<<24);
1735−DBG print("u %.8lux...", u);
17361635 u &= mask;
1737−DBG print("&mask %.8lux...", u);
17381636 if(isgrey){
17391637 u |= ((*grey >> (8-img->nbits[CGrey])) & img->mask[CGrey]) << img->shift[CGrey];
1740−DBG print("|grey %.8lux...", u);
17411638 grey += delta;
17421639 }else{
17431640 u |= ((*red >> (8-img->nbits[CRed])) & img->mask[CRed]) << img->shift[CRed];
@@ -1746,13 +1643,11 @@ DBG print("|grey %.8lux...", u); · 2 unmodified lines
17461643 red += delta;
17471644 grn += delta;
17481645 blu += delta;
1749−DBG print("|rgb %.8lux...", u);
17501646 }
17511647
17521648 if(isalpha){
17531649 u |= ((*alpha >> (8-img->nbits[CAlpha])) & img->mask[CAlpha]) << img->shift[CAlpha];
17541650 alpha += adelta;
1755−DBG print("|alpha %.8lux...", u);
17561651 }
17571652
17581653 w[0] = u;
@@ -1762,7 +1657,6 @@ DBG print("|alpha %.8lux...", u); · 3 unmodified lines
17621657 w += nb;
17631658 }
17641659 }
1765−#undef DBG
17661660
17671661 static Readfn*
17681662 readfn(Memimage *img)
@@ -1935,14 +1829,11 @@ genconv(Param *p, uchar *buf, int y) · 166 unmodified lines
19351829 static Readfn*
19361830 convfn(Memimage *dst, Param *dpar, Memimage *src, Param *spar, int *ndrawbuf)
19371831 {
1938− if(dst->chan == src->chan && !(src->flags&Frepl)){
1939−//if(drawdebug) iprint("readptr...");
1832+ if(dst->chan == src->chan && !(src->flags&Frepl))
19401833 return readptr;
1941− }
19421834
19431835 if(dst->chan==CMAP8 && (src->chan==GREY1||src->chan==GREY2||src->chan==GREY4)){
19441836 /* cheat because we know the replicated value is exactly the color map entry. */
1945−//if(drawdebug) iprint("Readnbit...");
19461837 return readnbit;
19471838 }
19481839
@@ -1959,7 +1850,6 @@ convfn(Memimage *dst, Param *dpar, Memimage *src, Param *spar, int *ndrawbuf) · 10 unmodified lines
19591850 spar->dx = Dx(spar->img->r);
19601851 }
19611852
1962−//if(drawdebug) iprint("genconv...");
19631853 return genconv;
19641854 }
19651855
@@ -2170,11 +2060,9 @@ rgbatoimg(Memimage *img, ulong rgba) · 204 unmodified lines
21702060 }
21712061 d += nb;
21722062 }
2173−// print("rgba2img %.8lux = %.*lux\n", rgba, 2*d/8, v);
21742063 return v;
21752064 }
21762065
2177−#define DBG if(0)
21782066 static int
21792067 memoptdraw(Memdrawparam *par)
21802068 {
@@ -2189,7 +2077,6 @@ memoptdraw(Memdrawparam *par) · 8 unmodified lines
21892077 dst = par->dst;
21902078 op = par->op;
21912079
2192−DBG print("state %lux mval %lux dd %d\n", par->state, par->mval, dst->depth);
21932080 /*
21942081 * If we have an opaque mask and source is one opaque pixel we can convert to the
21952082 * destination format and just replicate with memset.
@@ -2199,11 +2086,9 @@ DBG print("state %lux mval %lux dd %d\n", par->state, par->mval, dst->depth); · 3 unmodified lines
21992086 int d, dwid, ppb, np, nb;
22002087 uchar *dp, lm, rm;
22012088
2202−DBG print("memopt, dst %p, dst->data->bdata %p\n", dst, dst->data->bdata);
22032089 dwid = dst->width*sizeof(ulong);
22042090 dp = byteaddr(dst, par->r.min);
22052091 v = par->sdval;
2206−DBG print("sdval %lud, depth %d\n", v, dst->depth);
22072092 switch(dst->depth){
22082093 case 1:
22092094 case 2:
@@ -2217,16 +2102,13 @@ DBG print("sdval %lud, depth %d\n", v, dst->depth); · 7 unmodified lines
22172102 dx -= (ppb-np);
22182103 nb = 8 - np * dst->depth; /* no. bits used on right side of word */
22192104 lm = (1<<nb)-1;
2220−DBG print("np %d x %d nb %d lm %ux ppb %d m %ux\n", np, par->r.min.x, nb, lm, ppb, m);
22212105
22222106 /* right edge */
22232107 np = par->r.max.x&m; /* no. pixels used on left side of word */
22242108 dx -= np;
22252109 nb = 8 - np * dst->depth; /* no. bits unused on right side of word */
22262110 rm = ~((1<<nb)-1);
2227−DBG print("np %d x %d nb %d rm %ux ppb %d m %ux\n", np, par->r.max.x, nb, rm, ppb, m);
22282111
2229−DBG print("dx %d Dx %d\n", dx, Dx(par->r));
22302112 /* lm, rm are masks that are 1 where we should touch the bits */
22312113 if(dx < 0){ /* just one byte */
22322114 lm &= rm;
@@ -2238,7 +2120,6 @@ DBG print("dx %d Dx %d\n", dx, Dx(par->r)); · 5 unmodified lines
22382120
22392121 for(y=0; y<dy; y++, dp+=dwid){
22402122 if(lm){
2241−DBG print("dp %p v %lux lm %ux (v ^ *dp) & lm %lux\n", dp, v, lm, (v^*dp)&lm);
22422123 *dp ^= (v ^ *dp) & lm;
22432124 dp++;
22442125 }
@@ -2412,13 +2293,11 @@ DBG print("dp %p v %lux lm %ux (v ^ *dp) & lm %lux\n", dp, v, lm, (v^*dp)&lm); · 167 unmodified lines
24122293 }
24132294 return 0;
24142295 }
2415−#undef DBG
24162296
24172297 /*
24182298 * Boolean character drawing.
24192299 * Solid opaque color through a 1-bit greyscale mask.
24202300 */
2421−#define DBG if(0)
24222301 static int
24232302 chardraw(Memdrawparam *par)
24242303 {
@@ -2431,10 +2310,6 @@ chardraw(Memdrawparam *par) · 6 unmodified lines
24312310 Rectangle r, mr;
24322311 Memimage *mask, *src, *dst;
24332312
2434−if(0) if(drawdebug) iprint("chardraw? mf %lux md %d sf %lux dxs %d dys %d dd %d ddat %p sdat %p\n",
2435− par->mask->flags, par->mask->depth, par->src->flags,
2436− Dx(par->src->r), Dy(par->src->r), par->dst->depth, par->dst->data, par->src->data);
2437−
24382313 mask = par->mask;
24392314 src = par->src;
24402315 dst = par->dst;
@@ -2447,8 +2322,6 @@ if(0) if(drawdebug) iprint("chardraw? mf %lux md %d sf %lux dxs %d dys %d dd %d · 6 unmodified lines
24472322 || op != SoverD)
24482323 return 0;
24492324
2450−//if(drawdebug) iprint("chardraw...");
2451−
24522325 depth = mask->depth;
24532326 maskwid = mask->width*sizeof(ulong);
24542327 rp = byteaddr(mask, mr.min);
@@ -2457,7 +2330,6 @@ if(0) if(drawdebug) iprint("chardraw? mf %lux md %d sf %lux dxs %d dys %d dd %d · 2 unmodified lines
24572330
24582331 wp = byteaddr(dst, r.min);
24592332 dstwid = dst->width*sizeof(ulong);
2460−DBG print("bsh %d\n", bsh);
24612333 dy = Dy(r);
24622334 dx = Dx(r);
24632335
@@ -2483,20 +2355,17 @@ DBG print("bsh %d\n", bsh); · 19 unmodified lines
24832355 sp[2] = v>>16;
24842356 sp[3] = v>>24;
24852357
2486−//print("sp %x %x %x %x\n", sp[0], sp[1], sp[2], sp[3]);
24872358 for(y=0; y<dy; y++, rp+=maskwid, wp+=dstwid){
24882359 q = rp;
24892360 if(bsh)
24902361 bits = *q++;
24912362 switch(ddepth){
24922363 case 8:
2493−//if(drawdebug) iprint("8loop...");
24942364 wc = wp;
24952365 for(x=bx; x>ex; x--, wc++){
24962366 i = x&7;
24972367 if(i == 8-1)
24982368 bits = *q++;
2499−DBG print("bits %lux sh %d...", bits, i);
25002369 if((bits>>i)&1)
25012370 *wc = v;
25022371 }
@@ -2508,7 +2377,6 @@ DBG print("bits %lux sh %d...", bits, i); · 5 unmodified lines
25082377 i = x&7;
25092378 if(i == 8-1)
25102379 bits = *q++;
2511−DBG print("bits %lux sh %d...", bits, i);
25122380 if((bits>>i)&1)
25132381 *ws = v;
25142382 }
@@ -2519,7 +2387,6 @@ DBG print("bits %lux sh %d...", bits, i); · 4 unmodified lines
25192387 i = x&7;
25202388 if(i == 8-1)
25212389 bits = *q++;
2522−DBG print("bits %lux sh %d...", bits, i);
25232390 if((bits>>i)&1){
25242391 wc[0] = sp[0];
25252392 wc[1] = sp[1];
@@ -2534,18 +2401,14 @@ DBG print("bits %lux sh %d...", bits, i); · 8 unmodified lines
25342401 i = x&7;
25352402 if(i == 8-1)
25362403 bits = *q++;
2537−DBG iprint("bits %lux sh %d...", bits, i);
25382404 if((bits>>i)&1)
25392405 *wl = v;
25402406 }
25412407 break;
25422408 }
25432409 }
2544−
2545−DBG print("\n");
25462410 return 1;
25472411 }
2548−#undef DBG
25492412
25502413
25512414 void
libmemdraw/iprint.c+0−12
@@ -1,12 +0,0 @@
1−#include <u.h>
2−#include <libc.h>
3−#include <draw.h>
4−#include <memdraw.h>
5−
6−int
7−iprint(char *fmt,...)
8−{
9− USED(fmt);
10− return -1;
11−}
12−
libmemlayer/draw.c+2−9
@@ -57,16 +57,11 @@ memdraw(Memimage *dst, Rectangle r, Memimage *src, Point p0, Memimage *mask, Poi · 56 unmodified lines
5757 Rectangle srcr, tr, mr;
5858 Memlayer *dl, *sl;
5959
60− if(drawdebug)
61− iprint("memdraw %p %R %p %P %p %P\n", dst, r, src, p0, mask, p1);
62−
6360 if(mask == nil)
6461 mask = memopaque;
6562
66− if(mask->layer){
67−if(drawdebug) iprint("mask->layer != nil\n");
63+ if(mask->layer)
6864 return; /* too hard, at least for now */
69− }
7065
7166 Top:
7267 if(dst->layer==nil && src->layer==nil){
@@ -74,10 +69,8 @@ if(drawdebug) iprint("mask->layer != nil\n"); · 1 unmodified line
7469 return;
7570 }
7671
77− if(drawclipnorepl(dst, &r, src, &p0, mask, &p1, &srcr, &mr) == 0){
78−if(drawdebug) iprint("drawclip dstcr %R srccr %R maskcr %R\n", dst->clipr, src->clipr, mask->clipr);
72+ if(drawclipnorepl(dst, &r, src, &p0, mask, &p1, &srcr, &mr) == 0)
7973 return;
80− }
8174
8275 /*
8376 * Convert to screen coordinates.

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t