Changeset 7c64e23 in mainline


Ignore:
Timestamp:
2008-12-22T22:48:52Z (16 years ago)
Author:
Jiri Svoboda <jirik.svoboda@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
47acd58
Parents:
d410328
Message:

Revert c3724 as it actually made scrolling slower on some arches.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/fb/fb.c

    rd410328 r7c64e23  
    309309static void vport_scroll(viewport_t *vport, int lines)
    310310{
     311        unsigned int row, col;
     312
    311313        /*
    312314         * Scroll backbuffer.
     
    314316
    315317        if (lines > 0) {
    316                 memmove(vport->backbuf, vport->backbuf + vport->cols * lines,
     318                memcpy(vport->backbuf, vport->backbuf + vport->cols * lines,
    317319                    vport->cols * (vport->rows - lines));
    318320                memset(&vport->backbuf[BB_POS(vport, 0, vport->rows - lines)],
    319321                    0, vport->cols * lines);
    320322        } else {
    321                 memmove(vport->backbuf - vport->cols * lines, vport->backbuf,
     323                memcpy(vport->backbuf - vport->cols * lines, vport->backbuf,
    322324                    vport->cols * (vport->rows + lines));
    323325                memset(vport->backbuf, 0, - vport->cols * lines);
    324326        }
    325327
    326         /* 
    327          * Scroll pixels.
     328        /*
     329         * Redraw.
    328330         */
    329331
    330         unsigned int dist, height, alines;
    331         unsigned int y, ry;
    332         uint8_t *sp, *dp;
    333 
    334         alines = lines > 0 ? lines : -lines;
    335         dist = alines * FONT_SCANLINES;
    336         height = (vport->rows - alines) * FONT_SCANLINES;
    337 
    338         if (lines > 0) {
    339                 dp = &screen.fb_addr[FB_POS(vport->x, vport->y + 0)];
    340                 sp = &screen.fb_addr[FB_POS(vport->x, vport->y + dist)];
    341                 ry = height;
    342         } else {
    343                 dp = &screen.fb_addr[FB_POS(vport->x, vport->y + dist)];
    344                 sp = &screen.fb_addr[FB_POS(vport->x, vport->y + 0)];
    345                 ry = 0;
    346         }
    347 
    348         /* Move pixels line by line. */
    349         for (y = 0; y < height; y++) {
    350                 memcpy(dp, sp, vport->cols * FONT_WIDTH
    351                     * screen.pixelbytes);
    352 
    353                 sp += screen.scanline;
    354                 dp += screen.scanline;
    355         }
    356 
    357         /* Fill emptied area with background color. */
    358         draw_filled_rect(vport->x, vport->y + ry,
    359             vport->x + COL2X(vport->cols), vport->y + ry + dist,
    360             vport->style.bg_color);
     332        for (row = 0; row < vport->rows; row++) {
     333                for (col = 0; col < vport->cols; col++) {
     334                        draw_glyph(vport, false, col, row);
     335                }
     336        }
    361337}
    362338
Note: See TracChangeset for help on using the changeset viewer.