- fb_accel_arm/mips: simplify setBlendLevel()

This commit is contained in:
vanhofen
2022-11-24 21:48:23 +01:00
committed by Thilo Graf
parent 07a41bcef6
commit f294c8f318
2 changed files with 2 additions and 6 deletions

View File

@@ -329,10 +329,8 @@ void CFbAccelARM::setBlendMode(uint8_t mode)
/* level = 100 -> transparent, level = 0 -> nontransparent */
void CFbAccelARM::setBlendLevel(int level)
{
char buf[16];
int value = 255 - (level * 255 / 100);
int len = snprintf(buf, sizeof(buf), "%d", value);
proc_put("/proc/stb/video/alpha", buf, len);
proc_put("/proc/stb/video/alpha", value);
}
int CFbAccelARM::setMode(unsigned int nxRes, unsigned int nyRes, unsigned int nbpp)

View File

@@ -330,10 +330,8 @@ void CFbAccelMIPS::setBlendMode(uint8_t mode)
/* level = 100 -> transparent, level = 0 -> nontransparent */
void CFbAccelMIPS::setBlendLevel(int level)
{
char buf[16];
int value = 255 - (level * 255 / 100);
int len = snprintf(buf, sizeof(buf), "%d", value);
proc_put("/proc/stb/video/alpha", buf, len);
proc_put("/proc/stb/video/alpha", value);
}
int CFbAccelMIPS::setMode(unsigned int nxRes, unsigned int nyRes, unsigned int nbpp)