[w3m-dev 03931] Re: clear image
Hironori SAKAMOTO <[email protected]>
| Newsgroups | gmane.comp.web.w3m.devel |
|---|---|
| Message-ID | <[email protected]> |
> > > > rxvt(aterm,Eterm,etc) mlterm CVS > > > > frame buffer > > > (_ _) CVS ----------------------------------- <[email protected]> http://www2u.biglobe.ne.jp/~hsaka/ diff -u w3mimgdisplay.c.orig w3mimgdisplay.c --- w3mimgdisplay.c.orig Tue Jul 8 19:23:49 2003 +++ w3mimgdisplay.c Tue Jul 8 19:36:13 2003 @@ -324,5 +324,5 @@ for (; isdigit(*p); p++) h = 10 * h + (*p - '0'); - w_op->clear(w_op, x, y, w, h); + w_op->clear(w_op, x + offset_x, y + offset_y, w, h); } diff -u w3mimg/fb/fb.c.orig w3mimg/fb/fb.c --- w3mimg/fb/fb.c.orig Tue Jul 8 19:25:55 2003 +++ w3mimg/fb/fb.c Tue Jul 8 19:37:01 2003 @@ -368,8 +368,8 @@ int fb_clear(int x, int y, int w, int h, int r, int g, int b) { - unsigned long bg; - int i, offset_fb; + unsigned long work; + int i, j, offset_fb; if (is_open != TRUE || x > fb_width() || y > fb_height()) return 1; @@ -379,11 +379,12 @@ h = fb_height() - y; offset_fb = fscinfo.line_length * y + pixel_size * x; - bg = ((r >> (CHAR_BIT - vscinfo.red.length)) << vscinfo.red.offset) + - ((g >> (CHAR_BIT - vscinfo.green.length)) << vscinfo.green.offset) + - ((b >> (CHAR_BIT - vscinfo.blue.length)) << vscinfo.blue.offset); + work = ((r >> (CHAR_BIT - vscinfo.red.length)) << vscinfo.red.offset) + + ((g >> (CHAR_BIT - vscinfo.green.length)) << vscinfo.green.offset) + + ((b >> (CHAR_BIT - vscinfo.blue.length)) << vscinfo.blue.offset); for (i = 0; i < h; i++) { - memcpy(buf + offset_fb, bg, pixel_size * w); + for (j = 0; j < w; j++) + memcpy(buf + offset_fb + pixel_size * j, &work, pixel_size); offset_fb += fscinfo.line_length; } return 0;