this patch allows libframe to take advantage of accellerated stringbg drawing. Reference: /n/sources/patch/applied/libframe-alpha Date: Sat May 13 17:24:00 CES 2006 Signed-off-by: quanstro@quanstro.net --- /sys/src/libframe/frdraw.c Sat May 13 17:19:24 2006 +++ /sys/src/libframe/frdraw.c Sat May 13 17:19:20 2006 @@ -6,7 +6,7 @@ #include void -_frredraw(Frame *f, Point pt) +_frredraw(Frame *f, Point pt, Image *text, Image *back) { Frbox *b; int nb; @@ -15,7 +15,7 @@ for(nb=0,b=f->box; nbnbox; nb++, b++){ _frcklinewrap(f, &pt, b); if(b->nrune >= 0){ - string(f->b, pt, f->cols[TEXT], ZP, f->font, (char *)b->ptr); + stringbg(f->b, pt, text, ZP, f->font, (char *)b->ptr, back, ZP); } pt.x += b->wid; } @@ -78,6 +78,7 @@ if(p >= p0){ qt = pt; _frcklinewrap(f, &pt, b); + // fill in the end of a wrapped line if(pt.y > qt.y) draw(f->b, Rect(qt.x, qt.y, f->r.max.x, pt.y), back, nil, qt); } @@ -101,7 +102,7 @@ x = f->r.max.x; draw(f->b, Rect(pt.x, pt.y, x, pt.y+f->font->height), back, nil, pt); if(b->nrune >= 0) - stringn(f->b, pt, text, ZP, f->font, ptr, nr); + stringnbg(f->b, pt, text, ZP, f->font, ptr, nr, back, ZP); pt.x += w; Continue: b++; --- /sys/src/libframe/frinsert.c Sat May 13 17:19:46 2006 +++ /sys/src/libframe/frinsert.c Sat May 13 17:19:40 2006 @@ -262,7 +262,7 @@ else col = f->cols[BACK]; frselectpaint(f, ppt0, ppt1, col); - _frredraw(&frame, ppt0); + _frredraw(&frame, ppt0, f->cols[TEXT], col); _fraddbox(f, nn0, frame.nbox); for(n=0; nbox[nn0+n] = frame.box[n]; --- /sys/include/frame.h Sat May 13 17:20:10 2006 +++ /sys/include/frame.h Sat May 13 17:20:06 2006 @@ -80,7 +80,7 @@ int _frnewwid(Frame*, Point, Frbox*); int _frnewwid0(Frame*, Point, Frbox*); void _frclean(Frame*, Point, int, int); -void _frredraw(Frame*, Point); +void _frredraw(Frame*, Point, Image*, Image*); void _fraddbox(Frame*, int, int); Point _frptofcharptb(Frame*, ulong, Point, int); Point _frptofcharnb(Frame*, ulong, int); --- /sys/src/cmd/rio/wind.c Sat May 13 17:20:55 2006 +++ /sys/src/cmd/rio/wind.c Sat May 13 17:20:39 2006 @@ -709,11 +709,8 @@ wrepaint(Window *w) { wsetcols(w); - if(!w->mouseopen){ - if(font->maxdepth > 1) - draw(w->Frame.b, w->Frame.r, cols[BACK], nil, ZP); - _frredraw(w, w->Frame.r.min); - } + if(!w->mouseopen) + _frredraw(w, w->Frame.r.min, w->Frame.cols[TEXT], w->Frame.cols[BACK]); if(w == input){ wborder(w, Selborder); wsetcursor(w, 0);