Changeset d410328 in mainline for uspace/srv/fb/fb.c
- Timestamp:
- 2008-12-22T22:32:53Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 7c64e23
- Parents:
- a728ed3
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fb/fb.c
ra728ed3 rd410328 224 224 } 225 225 226 /** Draw a filled rectangle. */ 226 /** Draw a filled rectangle. 227 * 228 * @note Need real implementation that does not access VRAM twice. 229 */ 227 230 static void draw_filled_rect(unsigned int x0, unsigned int y0, unsigned int x1, 228 231 unsigned int y1, uint32_t color) 229 232 { 230 233 unsigned int x, y; 234 unsigned int copy_bytes; 235 236 uint8_t *sp, *dp; 231 237 uint8_t cbuf[4]; 232 238 239 if (y0 >= y1 || x0 >= x1) return; 233 240 screen.rgb_conv(cbuf, color); 234 241 235 for (y = y0; y < y1; y++) { 236 for (x = x0; x < x1; x++) { 237 memcpy(&screen.fb_addr[FB_POS(x, y)], cbuf, 238 screen.pixelbytes); 239 } 242 sp = &screen.fb_addr[FB_POS(x0, y0)]; 243 dp = sp; 244 245 /* Draw the first line. */ 246 for (x = x0; x < x1; x++) { 247 memcpy(dp, cbuf, screen.pixelbytes); 248 dp += screen.pixelbytes; 249 } 250 251 dp = sp + screen.scanline; 252 copy_bytes = (x1 - x0) * screen.pixelbytes; 253 254 /* Draw the remaining lines by copying. */ 255 for (y = y0 + 1; y < y1; y++) { 256 memcpy(dp, sp, copy_bytes); 257 dp += screen.scanline; 240 258 } 241 259 }
Note:
See TracChangeset
for help on using the changeset viewer.