mirror of
https://github.com/vdr-projects/vdr.git
synced 2025-03-01 10:50:46 +00:00
Fixed rendering pixmaps in case there is more than one dirty rectangle
This commit is contained in:
parent
8253754cc3
commit
cd3c26b815
16
osd.c
16
osd.c
@ -4,7 +4,7 @@
|
||||
* See the main source file 'vdr.c' for copyright information and
|
||||
* how to reach the author.
|
||||
*
|
||||
* $Id: osd.c 2.15 2011/02/27 10:14:43 kls Exp $
|
||||
* $Id: osd.c 2.16 2011/02/27 11:57:37 kls Exp $
|
||||
*/
|
||||
|
||||
#include "osd.h"
|
||||
@ -949,7 +949,7 @@ void cPixmap::SetLayer(int Layer)
|
||||
esyslog("ERROR: pixmap layer %d limited to %d", Layer, MAXPIXMAPLAYERS - 1);
|
||||
Layer = MAXPIXMAPLAYERS - 1;
|
||||
}
|
||||
if (Layer && Layer != layer) {
|
||||
if (Layer != layer) {
|
||||
if (Layer > 0 || layer > 0)
|
||||
MarkViewPortDirty(viewPort);
|
||||
layer = Layer;
|
||||
@ -1089,7 +1089,7 @@ void cPixmapMemory::Fill(tColor Color)
|
||||
Unlock();
|
||||
}
|
||||
|
||||
void cPixmap::DrawPixmap(const cPixmap *Pixmap, const cRect &Dirty, bool Opaque)
|
||||
void cPixmap::DrawPixmap(const cPixmap *Pixmap, const cRect &Dirty)
|
||||
{
|
||||
if (Pixmap->Tile() && (Pixmap->DrawPort().Point() != cPoint(0, 0) || Pixmap->DrawPort().Size() < Pixmap->ViewPort().Size())) {
|
||||
cPoint t0 = Pixmap->DrawPort().Point().Shifted(Pixmap->ViewPort().Point()); // the origin of the draw port in absolute OSD coordinates
|
||||
@ -1112,7 +1112,7 @@ void cPixmap::DrawPixmap(const cPixmap *Pixmap, const cRect &Dirty, bool Opaque)
|
||||
Source.Shift(Delta); // Source is now back at the pixmap's draw port location, still in absolute OSD coordinates
|
||||
Source.Shift(-Pixmap->ViewPort().Point()); // Source is now relative to the pixmap's view port again
|
||||
Source.Shift(-Pixmap->DrawPort().Point()); // Source is now relative to the pixmap's data
|
||||
if (Opaque)
|
||||
if (Pixmap->Layer() == 0)
|
||||
Copy(Pixmap, Source, Dest); // this is the "background" pixmap
|
||||
else
|
||||
Render(Pixmap, Source, Dest); // all others are alpha blended over the background
|
||||
@ -1132,7 +1132,7 @@ void cPixmap::DrawPixmap(const cPixmap *Pixmap, const cRect &Dirty, bool Opaque)
|
||||
cPoint Dest = Source.Point().Shifted(-ViewPort().Point()); // remember the destination point
|
||||
Source.Shift(-Pixmap->ViewPort().Point()); // Source is now relative to the pixmap's draw port again
|
||||
Source.Shift(-Pixmap->DrawPort().Point()); // Source is now relative to the pixmap's data
|
||||
if (Opaque)
|
||||
if (Pixmap->Layer() == 0)
|
||||
Copy(Pixmap, Source, Dest); // this is the "background" pixmap
|
||||
else
|
||||
Render(Pixmap, Source, Dest); // all others are alpha blended over the background
|
||||
@ -1662,7 +1662,6 @@ cPixmapMemory *cOsd::RenderPixmaps(void)
|
||||
cPixmapMemory *Pixmap = NULL;
|
||||
if (isTrueColor) {
|
||||
LOCK_PIXMAPS;
|
||||
for (;;) {
|
||||
// Collect overlapping dirty rectangles:
|
||||
cRect d;
|
||||
for (int i = 0; i < numPixmaps; i++) {
|
||||
@ -1674,8 +1673,7 @@ cPixmapMemory *cOsd::RenderPixmaps(void)
|
||||
}
|
||||
}
|
||||
}
|
||||
if (d.IsEmpty())
|
||||
break;
|
||||
if (!d.IsEmpty()) {
|
||||
//#define DebugDirty
|
||||
#ifdef DebugDirty
|
||||
static cRect OldDirty;
|
||||
@ -1690,7 +1688,7 @@ cPixmapMemory *cOsd::RenderPixmaps(void)
|
||||
for (int i = 0; i < numPixmaps; i++) {
|
||||
cPixmap *pm = pixmaps[i];
|
||||
if (pm->Layer() == Layer)
|
||||
Pixmap->DrawPixmap(pm, d, i == 0);
|
||||
Pixmap->DrawPixmap(pm, d);
|
||||
}
|
||||
}
|
||||
#ifdef DebugDirty
|
||||
|
12
osd.h
12
osd.h
@ -4,7 +4,7 @@
|
||||
* See the main source file 'vdr.c' for copyright information and
|
||||
* how to reach the author.
|
||||
*
|
||||
* $Id: osd.h 2.8 2011/02/26 14:10:30 kls Exp $
|
||||
* $Id: osd.h 2.9 2011/02/27 11:40:02 kls Exp $
|
||||
*/
|
||||
|
||||
#ifndef __OSD_H
|
||||
@ -465,9 +465,11 @@ protected:
|
||||
///< The coordinates of Point are relative to the pixmap's draw port.
|
||||
///< If Point is within the currently visible view port of this pixmap,
|
||||
///< MarkViewPortDirty() is called with the appropriate value.
|
||||
virtual void DrawPixmap(const cPixmap *Pixmap, const cRect &Dirty, bool Opaque);
|
||||
///< Draws the Dirty part of the given Pixmap into this pixmap. If Opaque
|
||||
///< is true, the Pixmap is copied, otherwise it is rendered into this
|
||||
void SetClean(void);
|
||||
///< Resets the "dirty" rectangles of this pixmap.
|
||||
virtual void DrawPixmap(const cPixmap *Pixmap, const cRect &Dirty);
|
||||
///< Draws the Dirty part of the given Pixmap into this pixmap. If the
|
||||
///< Pixmap's layer is 0, it is copied, otherwise it is rendered into this
|
||||
///< pixmap. This function is used only to implement the tile handling
|
||||
///< in the final rendering to the OSD.
|
||||
public:
|
||||
@ -524,8 +526,6 @@ public:
|
||||
///< the surrounding rectangle around all pixels that have been modified since the
|
||||
///< last time this pixmap has been rendered to the OSD. The rectangle is
|
||||
///< relative to the draw port's origin.
|
||||
void SetClean(void);
|
||||
///< Resets the "dirty" rectangles of this pixmap.
|
||||
virtual void SetLayer(int Layer);
|
||||
///< Sets the layer of this pixmap to the given value.
|
||||
///< If the new layer is greater than zero, the pixmap will be visible.
|
||||
|
Loading…
x
Reference in New Issue
Block a user