Changeset 7e38970d in mainline for uspace/drv/fb/amdm37x_dispc/amdm37x_dispc.c
- Timestamp:
- 2020-12-07T00:08:37Z (4 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 25f26600
- Parents:
- 7a873f0 (diff), 8596474 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/fb/amdm37x_dispc/amdm37x_dispc.c
r7a873f0 r7e38970d 383 383 384 384 /* Check that we support all required flags */ 385 if ((params->flags & ~ bmpf_color_key) != 0)385 if ((params->flags & ~(bmpf_color_key | bmpf_colorize)) != 0) 386 386 return ENOTSUP; 387 387 … … 392 392 gfx_coord2_subtract(¶ms->rect.p1, ¶ms->rect.p0, &dim); 393 393 dcbm->rect = params->rect; 394 dcbm->flags = params->flags; 394 395 395 396 if (alloc == NULL) { … … 487 488 gfx_rect_clip(&srect, &skfbrect, &crect); 488 489 489 // XXX bmpf_color_key 490 for (pos.y = crect.p0.y; pos.y < crect.p1.y; pos.y++) { 491 for (pos.x = crect.p0.x; pos.x < crect.p1.x; pos.x++) { 492 gfx_coord2_subtract(&pos, &dcbm->rect.p0, &sp); 493 gfx_coord2_add(&pos, &offs, &dp); 494 495 color = pixelmap_get_pixel(&pbm, sp.x, sp.y); 496 dispc->active_fb.pixel2visual(dispc->fb_data + 497 FB_POS(dispc, dp.x, dp.y), color); 490 if ((dcbm->flags & bmpf_color_key) == 0) { 491 /* Simple copy */ 492 for (pos.y = crect.p0.y; pos.y < crect.p1.y; pos.y++) { 493 for (pos.x = crect.p0.x; pos.x < crect.p1.x; pos.x++) { 494 gfx_coord2_subtract(&pos, &dcbm->rect.p0, &sp); 495 gfx_coord2_add(&pos, &offs, &dp); 496 497 color = pixelmap_get_pixel(&pbm, sp.x, sp.y); 498 dispc->active_fb.pixel2visual(dispc->fb_data + 499 FB_POS(dispc, dp.x, dp.y), color); 500 } 501 } 502 } else if ((dcbm->flags & bmpf_colorize) == 0) { 503 /* Color key */ 504 for (pos.y = crect.p0.y; pos.y < crect.p1.y; pos.y++) { 505 for (pos.x = crect.p0.x; pos.x < crect.p1.x; pos.x++) { 506 gfx_coord2_subtract(&pos, &dcbm->rect.p0, &sp); 507 gfx_coord2_add(&pos, &offs, &dp); 508 509 color = pixelmap_get_pixel(&pbm, sp.x, sp.y); 510 if (color != dcbm->key_color) { 511 dispc->active_fb.pixel2visual(dispc->fb_data + 512 FB_POS(dispc, dp.x, dp.y), color); 513 } 514 } 515 } 516 } else { 517 /* Color key & colorize */ 518 for (pos.y = crect.p0.y; pos.y < crect.p1.y; pos.y++) { 519 for (pos.x = crect.p0.x; pos.x < crect.p1.x; pos.x++) { 520 gfx_coord2_subtract(&pos, &dcbm->rect.p0, &sp); 521 gfx_coord2_add(&pos, &offs, &dp); 522 523 color = pixelmap_get_pixel(&pbm, sp.x, sp.y); 524 if (color != dcbm->key_color) { 525 dispc->active_fb.pixel2visual(dispc->fb_data + 526 FB_POS(dispc, dp.x, dp.y), 527 dcbm->dispc->color); 528 } 529 } 498 530 } 499 531 }
Note:
See TracChangeset
for help on using the changeset viewer.