mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 16:31:11 +02:00
framebuffer: implement alphablending for non-accelerated devices
This commit is contained in:
committed by
Michael Liebmann
parent
a5412a0202
commit
820426eaaa
@@ -1808,8 +1808,17 @@ void CFrameBuffer::blit2FB(void *fbbuff, uint32_t width, uint32_t height, uint32
|
|||||||
d2 = (fb_pixel_t *) d;
|
d2 = (fb_pixel_t *) d;
|
||||||
for (int count2 = 0; count2 < xc; count2++ ) {
|
for (int count2 = 0; count2 < xc; count2++ ) {
|
||||||
fb_pixel_t pix = *(pixpos + xp);
|
fb_pixel_t pix = *(pixpos + xp);
|
||||||
if (!transp || (pix != 0)) {
|
if (!transp || (pix & 0xff000000) == 0xff000000)
|
||||||
*d2 = pix;
|
*d2 = pix;
|
||||||
|
else {
|
||||||
|
uint8_t *in = (uint8_t *)(pixpos + xp);
|
||||||
|
uint8_t *out = (uint8_t *)d2;
|
||||||
|
int a = in[3]; /* TODO: big/little endian */
|
||||||
|
*out = (*out + ((*in - *out) * a) / 256);
|
||||||
|
in++; out++;
|
||||||
|
*out = (*out + ((*in - *out) * a) / 256);
|
||||||
|
in++; out++;
|
||||||
|
*out = (*out + ((*in - *out) * a) / 256);
|
||||||
}
|
}
|
||||||
d2++;
|
d2++;
|
||||||
pixpos++;
|
pixpos++;
|
||||||
|
Reference in New Issue
Block a user