Changeset 7c64e23 in mainline
- Timestamp:
- 2008-12-22T22:48:52Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 47acd58
- Parents:
- d410328
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fb/fb.c
rd410328 r7c64e23 309 309 static void vport_scroll(viewport_t *vport, int lines) 310 310 { 311 unsigned int row, col; 312 311 313 /* 312 314 * Scroll backbuffer. … … 314 316 315 317 if (lines > 0) { 316 mem move(vport->backbuf, vport->backbuf + vport->cols * lines,318 memcpy(vport->backbuf, vport->backbuf + vport->cols * lines, 317 319 vport->cols * (vport->rows - lines)); 318 320 memset(&vport->backbuf[BB_POS(vport, 0, vport->rows - lines)], 319 321 0, vport->cols * lines); 320 322 } else { 321 mem move(vport->backbuf - vport->cols * lines, vport->backbuf,323 memcpy(vport->backbuf - vport->cols * lines, vport->backbuf, 322 324 vport->cols * (vport->rows + lines)); 323 325 memset(vport->backbuf, 0, - vport->cols * lines); 324 326 } 325 327 326 /* 327 * Scroll pixels.328 /* 329 * Redraw. 328 330 */ 329 331 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 } 361 337 } 362 338
Note:
See TracChangeset
for help on using the changeset viewer.