diff options
author | Keith Packard <keithp@keithp.com> | 2008-04-29 08:29:42 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2008-11-24 13:24:41 -0800 |
commit | c4b9ab6bf56139fdd8c7c584a6f523c6766cddd6 (patch) | |
tree | db5240f90ba48ef609d0c650a4cf993732ebc370 /hw | |
parent | 9c7679240ad90367693a462e288308b3fdc08f26 (diff) |
Handle transform failure when computing shadow damage area.
PictureTransformBounds can fail, when this happens, damage the entire screen
so that the shadow gets repainted correctly.
Diffstat (limited to 'hw')
-rw-r--r-- | hw/xfree86/modes/xf86Rotate.c | 49 |
1 files changed, 30 insertions, 19 deletions
diff --git a/hw/xfree86/modes/xf86Rotate.c b/hw/xfree86/modes/xf86Rotate.c index 75f4a55bb..865d59c41 100644 --- a/hw/xfree86/modes/xf86Rotate.c +++ b/hw/xfree86/modes/xf86Rotate.c @@ -135,25 +135,6 @@ xf86RotateCrtcRedisplay (xf86CrtcPtr crtc, RegionPtr region) } static void -xf86CrtcDamageShadow (xf86CrtcPtr crtc) -{ - ScrnInfoPtr pScrn = crtc->scrn; - BoxRec damage_box; - RegionRec damage_region; - ScreenPtr pScreen = pScrn->pScreen; - - damage_box.x1 = 0; - damage_box.x2 = crtc->mode.HDisplay; - damage_box.y1 = 0; - damage_box.y2 = crtc->mode.VDisplay; - PictureTransformBounds (&damage_box, &crtc->crtc_to_framebuffer); - REGION_INIT (pScreen, &damage_region, &damage_box, 1); - DamageRegionAppend(&(*pScreen->GetScreenPixmap)(pScreen)->drawable, - &damage_region); - REGION_UNINIT (pScreen, &damage_region); -} - -static void xf86CrtcShadowClear (xf86CrtcPtr crtc) { PixmapPtr dst_pixmap = crtc->rotatedPixmap; @@ -185,6 +166,36 @@ xf86CrtcShadowClear (xf86CrtcPtr crtc) } static void +xf86CrtcDamageShadow (xf86CrtcPtr crtc) +{ + ScrnInfoPtr pScrn = crtc->scrn; + BoxRec damage_box; + RegionRec damage_region; + ScreenPtr pScreen = pScrn->pScreen; + + damage_box.x1 = 0; + damage_box.x2 = crtc->mode.HDisplay; + damage_box.y1 = 0; + damage_box.y2 = crtc->mode.VDisplay; + if (!PictureTransformBounds (&damage_box, &crtc->crtc_to_framebuffer)) + { + damage_box.x1 = 0; + damage_box.y1 = 0; + damage_box.x2 = pScreen->width; + damage_box.y2 = pScreen->height; + } + if (damage_box.x1 < 0) damage_box.x1 = 0; + if (damage_box.y1 < 0) damage_box.y1 = 0; + if (damage_box.x2 > pScreen->width) damage_box.x2 = pScreen->width; + if (damage_box.y2 > pScreen->height) damage_box.y2 = pScreen->height; + REGION_INIT (pScreen, &damage_region, &damage_box, 1); + DamageRegionAppend (&(*pScreen->GetScreenPixmap)(pScreen)->drawable, + &damage_region); + REGION_UNINIT (pScreen, &damage_region); + xf86CrtcShadowClear (crtc); +} + +static void xf86RotatePrepare (ScreenPtr pScreen) { ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; |