Changeset a728ed3 in mainline
- Timestamp:
- 2008-12-22T22:13:11Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- d410328
- Parents:
- 2d32081
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fb/fb.c
r2d32081 ra728ed3 272 272 273 273 274 /** Clear viewport 274 /** Clear viewport. 275 275 * 276 276 * @param vport Viewport to clear … … 283 283 } 284 284 285 /** Scroll viewport by given number of lines285 /** Scroll viewport by the specified number of lines. 286 286 * 287 287 * @param vport Viewport to scroll … … 291 291 static void vport_scroll(viewport_t *vport, int lines) 292 292 { 293 unsigned int row, col; 293 /* 294 * Scroll backbuffer. 295 */ 294 296 295 297 if (lines > 0) { 296 mem cpy(vport->backbuf, vport->backbuf + vport->cols * lines,298 memmove(vport->backbuf, vport->backbuf + vport->cols * lines, 297 299 vport->cols * (vport->rows - lines)); 298 300 memset(&vport->backbuf[BB_POS(vport, 0, vport->rows - lines)], 299 301 0, vport->cols * lines); 300 302 } else { 301 mem cpy(vport->backbuf - vport->cols * lines, vport->backbuf,303 memmove(vport->backbuf - vport->cols * lines, vport->backbuf, 302 304 vport->cols * (vport->rows + lines)); 303 305 memset(vport->backbuf, 0, - vport->cols * lines); 304 306 } 305 307 306 for (row = 0; row < vport->rows; row++) { 307 for (col = 0; col < vport->cols; col++) { 308 draw_glyph(vport, false, col, row); 309 } 310 } 308 /* 309 * Scroll pixels. 310 */ 311 312 unsigned int dist, height, alines; 313 unsigned int y, ry; 314 uint8_t *sp, *dp; 315 316 alines = lines > 0 ? lines : -lines; 317 dist = alines * FONT_SCANLINES; 318 height = (vport->rows - alines) * FONT_SCANLINES; 319 320 if (lines > 0) { 321 dp = &screen.fb_addr[FB_POS(vport->x, vport->y + 0)]; 322 sp = &screen.fb_addr[FB_POS(vport->x, vport->y + dist)]; 323 ry = height; 324 } else { 325 dp = &screen.fb_addr[FB_POS(vport->x, vport->y + dist)]; 326 sp = &screen.fb_addr[FB_POS(vport->x, vport->y + 0)]; 327 ry = 0; 328 } 329 330 /* Move pixels line by line. */ 331 for (y = 0; y < height; y++) { 332 memcpy(dp, sp, vport->cols * FONT_WIDTH 333 * screen.pixelbytes); 334 335 sp += screen.scanline; 336 dp += screen.scanline; 337 } 338 339 /* Fill emptied area with background color. */ 340 draw_filled_rect(vport->x, vport->y + ry, 341 vport->x + COL2X(vport->cols), vport->y + ry + dist, 342 vport->style.bg_color); 311 343 } 312 344
Note:
See TracChangeset
for help on using the changeset viewer.