From 98bc88108cf229baf010d23f2c380f0fbd4146f3 Mon Sep 17 00:00:00 2001 From: Christian Gmeiner Date: Wed, 21 Oct 2009 19:41:23 +0200 Subject: 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. --- dxr3osd.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'dxr3osd.c') diff --git a/dxr3osd.c b/dxr3osd.c index 9573d62..bfac213 100644 --- a/dxr3osd.c +++ b/dxr3osd.c @@ -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 -- cgit v1.2.3