fix fading

This commit is contained in:
TangoCash
2021-04-23 16:49:40 +02:00
committed by Thilo Graf
parent 9a26168454
commit 3a1d3f16a0
3 changed files with 24 additions and 2 deletions

View File

@@ -212,6 +212,8 @@ class CFbAccelARM
int scale2Res(int size);
bool fullHdAvailable();
void setOsdResolutions();
void setBlendMode(uint8_t mode);
void setBlendLevel(int level);
#if ENABLE_ARM_ACC
void paintRect(const int x, const int y, const int dx, const int dy, const fb_pixel_t col);
#endif

View File

@@ -316,6 +316,26 @@ void CFbAccelARM::setOsdResolutions()
}
}
/* original interface: 1 == pixel alpha, 2 == global alpha premultiplied */
void CFbAccelARM::setBlendMode(uint8_t mode)
{
/* mode = 1 => reset to no extra transparency */
if (mode == 1)
setBlendLevel(0);
}
/* level = 100 -> transparent, level = 0 -> nontransparent */
void CFbAccelARM::setBlendLevel(int level)
{
char tmp[3]={0x0};
int _level = 0xff - ( level * 0xff / 100);
sprintf(tmp,"%d", _level);
int pfd = open("/proc/stb/video/alpha", O_WRONLY);
if (pfd)
write(pfd, tmp, sizeof(tmp));
close(pfd);
}
int CFbAccelARM::setMode(unsigned int nxRes, unsigned int nyRes, unsigned int nbpp)
{
if (!available&&!active)

View File

@@ -739,12 +739,12 @@ int COsdSetup::showOsdSetup()
mc->setHint("", LOCALE_MENU_HINT_ROUNDED_CORNERS);
osd_menu->addItem(mc);
#endif
#if !HAVE_ARM_HARDWARE //FIXME: make it usable for AX51
// fade windows
mc = new CMenuOptionChooser(LOCALE_COLORMENU_FADE, &g_settings.widget_fade, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true );
mc->setHint("", LOCALE_MENU_HINT_FADE);
osd_menu->addItem(mc);
#endif
// window size
memset(window_size_value, 0, sizeof(window_size_value));
snprintf(window_size_value, sizeof(window_size_value), "%d / %d", g_settings.window_width, g_settings.window_height);