mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-31 01:11:12 +02:00
framebuffer: implement setBlendLevel() and setBlendMode() for TripleDragon
This commit is contained in:
@@ -536,6 +536,7 @@ void CFrameBuffer::setTransparency( int /*tr*/ )
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if !HAVE_TRIPLEDRAGON
|
||||||
void CFrameBuffer::setBlendMode(uint8_t mode)
|
void CFrameBuffer::setBlendMode(uint8_t mode)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_COOL_HARDWARE
|
#ifdef HAVE_COOL_HARDWARE
|
||||||
@@ -560,6 +561,34 @@ void CFrameBuffer::setBlendLevel(int level)
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
/* TRIPLEDRAGON */
|
||||||
|
void CFrameBuffer::setBlendMode(uint8_t mode)
|
||||||
|
{
|
||||||
|
Stb04GFXOsdControl g;
|
||||||
|
ioctl(gfxfd, STB04GFX_OSD_GETCONTROL, &g);
|
||||||
|
g.use_global_alpha = (mode == 2); /* 1 == pixel alpha, 2 == global alpha */
|
||||||
|
ioctl(gfxfd, STB04GFX_OSD_SETCONTROL, &g);
|
||||||
|
}
|
||||||
|
|
||||||
|
void CFrameBuffer::setBlendLevel(int blev1, int /*blev2*/)
|
||||||
|
{
|
||||||
|
/* this is bypassing directfb, but faster and easier */
|
||||||
|
Stb04GFXOsdControl g;
|
||||||
|
ioctl(gfxfd, STB04GFX_OSD_GETCONTROL, &g);
|
||||||
|
if (g.use_global_alpha == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (blev1 < 0 || blev1 > 100)
|
||||||
|
return;
|
||||||
|
|
||||||
|
/* this is the same as convertSetupAlpha2Alpha(), but non-float */
|
||||||
|
g.global_alpha = 255 - (255 * blev1 / 100);
|
||||||
|
ioctl(gfxfd, STB04GFX_OSD_SETCONTROL, &g);
|
||||||
|
if (blev1 == 100) // sucks
|
||||||
|
usleep(20000);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void CFrameBuffer::setAlphaFade(int in, int num, int tr)
|
void CFrameBuffer::setAlphaFade(int in, int num, int tr)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user