mirror of
https://github.com/jojo61/vdr-plugin-softhdcuvid.git
synced 2025-12-27 07:21:07 +01:00
Fix for Layer0 Pixmap alpha
This commit is contained in:
@@ -726,14 +726,15 @@ bool cOglCmdDeleteFb::Execute(void) {
|
||||
|
||||
//------------------ cOglCmdRenderFbToBufferFb --------------------
|
||||
cOglCmdRenderFbToBufferFb::cOglCmdRenderFbToBufferFb(cOglFb *fb, cOglFb *buffer, GLint x, GLint y, GLint transparency,
|
||||
GLint drawPortX, GLint drawPortY)
|
||||
GLint drawPortX, GLint drawPortY, bool alphablending)
|
||||
: cOglCmd(fb) {
|
||||
this->buffer = buffer;
|
||||
this->x = (GLfloat)x;
|
||||
this->y = (GLfloat)y;
|
||||
this->drawPortX = (GLfloat)drawPortX;
|
||||
this->drawPortY = (GLfloat)drawPortY;
|
||||
this->transparency = transparency;
|
||||
this->transparency = (alphablending ? transparency : ALPHA_OPAQUE);
|
||||
this->alphablending = alphablending;
|
||||
}
|
||||
|
||||
bool cOglCmdRenderFbToBufferFb::Execute(void) {
|
||||
@@ -773,11 +774,14 @@ bool cOglCmdRenderFbToBufferFb::Execute(void) {
|
||||
|
||||
if (!fb->BindTexture())
|
||||
return false;
|
||||
|
||||
if (!alphablending)
|
||||
VertexBuffers[vbTexture]->DisableBlending();
|
||||
VertexBuffers[vbTexture]->Bind();
|
||||
VertexBuffers[vbTexture]->SetVertexData(quadVertices);
|
||||
VertexBuffers[vbTexture]->DrawArrays();
|
||||
VertexBuffers[vbTexture]->Unbind();
|
||||
if (!alphablending)
|
||||
VertexBuffers[vbTexture]->EnableBlending();
|
||||
buffer->Unbind();
|
||||
|
||||
return true;
|
||||
@@ -2096,6 +2100,14 @@ cPixmap *cOglOsd::CreatePixmap(int Layer, const cRect &ViewPort, const cRect &Dr
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
extern "C" {void VideoSetOsdSize(int, int ) ;}
|
||||
|
||||
void SetOsdPosition(int Left, int Top, int Width, int Height) {
|
||||
printf("Set OSD Position %d %d\n",Width,Height);
|
||||
VideoSetOsdSize( Width, Height) ;
|
||||
}
|
||||
|
||||
void cOglOsd::DestroyPixmap(cPixmap *Pixmap) {
|
||||
if (!oglThread->Active())
|
||||
return;
|
||||
@@ -2141,10 +2153,16 @@ void cOglOsd::Flush(void) {
|
||||
for (int i = 0; i < oglPixmaps.Size(); i++) {
|
||||
if (oglPixmaps[i]) {
|
||||
if (oglPixmaps[i]->Layer() == layer) {
|
||||
oglThread->DoCmd(new cOglCmdRenderFbToBufferFb(
|
||||
oglPixmaps[i]->Fb(), bFb, oglPixmaps[i]->ViewPort().X(),
|
||||
(!isSubtitleOsd) ? oglPixmaps[i]->ViewPort().Y() : 0, oglPixmaps[i]->Alpha(),
|
||||
oglPixmaps[i]->DrawPort().X(), oglPixmaps[i]->DrawPort().Y()));
|
||||
bool alphablending = layer == 0 ? false : true; // Decide wether to render (with alpha) or copy a pixmap
|
||||
oglThread->DoCmd(new cOglCmdRenderFbToBufferFb( oglPixmaps[i]->Fb(),
|
||||
bFb,
|
||||
oglPixmaps[i]->ViewPort().X(),
|
||||
(!isSubtitleOsd) ? oglPixmaps[i]->ViewPort().Y() : 0,
|
||||
oglPixmaps[i]->Alpha(),
|
||||
oglPixmaps[i]->DrawPort().X(),
|
||||
oglPixmaps[i]->DrawPort().Y(),
|
||||
alphablending
|
||||
));
|
||||
oglPixmaps[i]->SetDirty(false);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user