mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-13 18:17:39 -04:00
bitmap drawing: Support alpha blend if image over the framebuffer contents.
If DRMODE_FG now the alpha channel in bitmaps can be used to draw the bitmap over the framebuffer, so that e.g. a line selector isn't cleared for for transparent bitmap pixels. Change-Id: I09d59a09d2f3c90450a0fe2b83c6c59d757b686b
This commit is contained in:
parent
68d3ce2acd
commit
bd67f3dc6b
1 changed files with 14 additions and 6 deletions
|
@ -930,14 +930,12 @@ static void ICODE_ATTR lcd_alpha_bitmap_part_mix(const fb_data* image,
|
|||
drmode &= DRMODE_SOLID; /* mask out inversevid */
|
||||
}
|
||||
if (drmode == DRMODE_BG)
|
||||
{
|
||||
dmask = ~dmask;
|
||||
}
|
||||
/* Set to DRMODE_BG as we use its code path in the switch below */
|
||||
/* If drawmode is FG use a separate special case that blends the image
|
||||
* onto the current framebuffer contents. Otherwise BG is forced that
|
||||
* blends the image with the backdrop (if any, otherwise background color )*/
|
||||
if (image != NULL)
|
||||
{
|
||||
drmode = DRMODE_BG;
|
||||
}
|
||||
drmode = (drmode == DRMODE_FG) ? DRMODE_FG|DRMODE_INT_MOD : DRMODE_BG;
|
||||
/* Use extra bit to avoid if () in the switch-cases below */
|
||||
if ((drmode & DRMODE_BG) && lcd_backdrop)
|
||||
drmode |= DRMODE_INT_MOD;
|
||||
|
@ -1049,6 +1047,16 @@ static void ICODE_ATTR lcd_alpha_bitmap_part_mix(const fb_data* image,
|
|||
}
|
||||
while (--col);
|
||||
break;
|
||||
case DRMODE_FG|DRMODE_INT_MOD:
|
||||
do
|
||||
{
|
||||
*dst = blend_two_colors(*dst, *image, data & ALPHA_COLOR_LOOKUP_SIZE );
|
||||
dst += COL_INC;
|
||||
image += STRIDE_MAIN(1, stride_image);
|
||||
UPDATE_SRC_ALPHA;
|
||||
}
|
||||
while (--col);
|
||||
break;
|
||||
case DRMODE_FG:
|
||||
fg = current_vp->fg_pattern;
|
||||
do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue