diff options
author | Christian Gmeiner <christian.gmeiner@gmail.com> | 2009-10-21 19:41:23 +0200 |
---|---|---|
committer | Christian Gmeiner <christian.gmeiner@gmail.com> | 2009-10-21 19:41:23 +0200 |
commit | 98bc88108cf229baf010d23f2c380f0fbd4146f3 (patch) | |
tree | c47da01082b584af3c251dd6b0b779d1ff7de031 | |
parent | 1cdd70c625125f935d2e15d388d7add9443fa6b6 (diff) | |
download | vdr-plugin-dxr3-98bc88108cf229baf010d23f2c380f0fbd4146f3.tar.gz vdr-plugin-dxr3-98bc88108cf229baf010d23f2c380f0fbd4146f3.tar.bz2 |
fix flickering if we need to scale and osd does not change
The problem was that we dont called Clean() of the source bitmap
if we do scaling.
-rw-r--r-- | dxr3osd.c | 18 |
1 files changed, 13 insertions, 5 deletions
@@ -191,6 +191,12 @@ void cDxr3Osd::Flush() bmap = mergedBitmap; } + // if our final bitmap is not dirty, we need + // not to scale and draw it + if (!bmap->Dirty(x1, y1, x2, y2)) { + return; + } + uint32_t horizontal, vertical; cDxr3Interface::instance()->dimension(horizontal, vertical); @@ -217,19 +223,21 @@ void cDxr3Osd::Flush() left = horizontal / alpha; top = vertical / beta; + // scale and set used colors cBitmap *scaled = cScaler::scaleBitmap(bmap, width, height); scaled->Replace(*Palette); + // mark source bitmap as clean + bmap->Clean(); + scaling = true; bmap = scaled; } // encode bitmap - if (bmap->Dirty(x1, y1, x2, y2)) { - cSpuEncoder::instance()->encode(bmap, top, left); - shown = true; - bmap->Clean(); - } + cSpuEncoder::instance()->encode(bmap, top, left); + shown = true; + bmap->Clean(); // check if we need to free the bitmap allocated by the method // cScaler::scaleBitmap |