diff options
author | Thomas Hellstrom <unichrome@shipmail.org> | 2005-09-04 18:40:17 +0000 |
---|---|---|
committer | Thomas Hellstrom <unichrome@shipmail.org> | 2005-09-04 18:40:17 +0000 |
commit | abc0e917679610d610e85331a326a69caf78fc16 (patch) | |
tree | 85653ec09c0fc9b4ebd0f48e9afd82229c0d0124 | |
parent | 24ed194157a39bf4d19edda8a14d0c83fe75721e (diff) |
via: Responsiveness fix: Don't update video overlay when not strictly
necessary
-rw-r--r-- | src/via_priv.h | 2 | ||||
-rw-r--r-- | src/via_swov.c | 4 | ||||
-rw-r--r-- | src/via_video.c | 18 |
3 files changed, 23 insertions, 1 deletions
diff --git a/src/via_priv.h b/src/via_priv.h index ac7c64d..2f0cf31 100644 --- a/src/via_priv.h +++ b/src/via_priv.h @@ -155,6 +155,8 @@ typedef struct { /* For panning mode use */ int panning_x; int panning_y; + int oldPanningX; + int oldPanningY; } swovRec, *swovPtr; #endif /* _VIA_PRIV_H_ */ diff --git a/src/via_swov.c b/src/via_swov.c index 7bba031..530622c 100644 --- a/src/via_swov.c +++ b/src/via_swov.c @@ -1922,7 +1922,9 @@ VIAVidUpdateOverlay(ScrnInfoPtr pScrn, LPDDUPDATEOVERLAY pUpdate) panDX = pVia->swov.panning_x; - panDY = pVia->swov.panning_y; + panDY = pVia->swov.panning_y; + pVia->swov.oldPanningX = pVia->swov.panning_x; + pVia->swov.oldPanningY = pVia->swov.panning_y; pUpdate->DstLeft -= panDX; pUpdate->DstTop -= panDY; diff --git a/src/via_video.c b/src/via_video.c index 0315df6..dfce4d6 100644 --- a/src/via_video.c +++ b/src/via_video.c @@ -502,6 +502,10 @@ void viaInitVideo(ScreenPtr pScreen) ViaInitXVMC(pScreen); #endif viaSetColorSpace(pVia,0,0,0,0,TRUE); + pVia->swov.panning_x = 0; + pVia->swov.panning_y = 0; + pVia->swov.oldPanningX = 0; + pVia->swov.oldPanningY = 0; } } @@ -550,7 +554,21 @@ viaReputImage(ScrnInfoPtr pScrn, DDUPDATEOVERLAY UpdateOverlay_Video; LPDDUPDATEOVERLAY lpUpdateOverlay = &UpdateOverlay_Video; viaPortPrivPtr pPriv = (viaPortPrivPtr)data; + VIAPtr pVia = VIAPTR(pScrn); + if(!RegionsEqual(&pPriv->clip, clipBoxes)) { + REGION_COPY(pScrn->pScreen, &pPriv->clip, clipBoxes); + if (pPriv->autoPaint) + xf86XVFillKeyHelper(pScrn->pScreen, pPriv->colorKey, clipBoxes); + } + + if (drw_x == pPriv->old_drw_x && + drw_y == pPriv->old_drw_y && + pVia->swov.oldPanningX == pVia->swov.panning_x && + pVia->swov.oldPanningY == pVia->swov.panning_y) + + return Success; + lpUpdateOverlay->SrcLeft = pPriv->old_src_x; lpUpdateOverlay->SrcTop = pPriv->old_src_y; lpUpdateOverlay->SrcRight = pPriv->old_src_x + pPriv->old_src_w; |