framebuffer_spark: implement setBlendLevel()

This commit is contained in:
Stefan Seyfried
2012-07-07 19:37:50 +02:00
parent 770ab77eac
commit d3920eb21d

View File

@@ -459,30 +459,28 @@ void CFrameBuffer::setTransparency( int /*tr*/ )
{ {
} }
void CFrameBuffer::setBlendMode(uint8_t /*mode*/) /* original interfaceL: 1 == pixel alpha, 2 == global alpha premultiplied */
void CFrameBuffer::setBlendMode(uint8_t mode)
{ {
#if 0 /* mode = 1 => reset to no extra transparency */
//g.use_global_alpha = (mode == 2); /* 1 == pixel alpha, 2 == global alpha */ if (mode == 1)
if (ioctl(fd, FBIO_SETBLENDMODE, mode)) setBlendLevel(0);
printf("FBIO_SETBLENDMODE failed.\n");
#endif
} }
void CFrameBuffer::setBlendLevel(int /*level*/) /* level = 100 -> transparent, level = 0 -> nontransperent */
void CFrameBuffer::setBlendLevel(int level)
{ {
#if 0 struct stmfbio_var_screeninfo_ex v;
//printf("CFrameBuffer::setBlendLevel %d\n", level); memset(&v, 0, sizeof(v));
unsigned char value = 0xFF; /* set to 0 already...
if((level >= 0) && (level <= 100)) v.layerid = 0;
value = convertSetupAlpha2Alpha(level); v.activate = STMFBIO_ACTIVATE_IMMEDIATE; // == 0
v.premultiplied_alpha = 0;
if (ioctl(fd, FBIO_SETOPACITY, value)) */
printf("FBIO_SETOPACITY failed.\n"); v.caps = STMFBIO_VAR_CAPS_OPACITY | STMFBIO_VAR_CAPS_PREMULTIPLIED;
#if 1 v.opacity = 0xff - (level * 0xff / 100);
if(level == 100) // TODO: sucks. if (ioctl(fd, STMFBIO_SET_VAR_SCREENINFO_EX, &v) < 0)
usleep(20000); perror("[fb:setBlendLevel] STMFBIO");
#endif
#endif
} }
void CFrameBuffer::setAlphaFade(int in, int num, int tr) void CFrameBuffer::setAlphaFade(int in, int num, int tr)