From e86c34663ef97e946a1129450105efa89a123af6 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Tue, 18 Mar 2008 15:25:31 -0700 Subject: [PATCH] Clear shadow pixmaps before using them. This eliminates some ugly flashing, as well as clearing the borders when the shadow will not be completely painted. --- hw/xfree86/modes/xf86Rotate.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/hw/xfree86/modes/xf86Rotate.c b/hw/xfree86/modes/xf86Rotate.c index dc9ad1177..7b49afa4b 100644 --- a/hw/xfree86/modes/xf86Rotate.c +++ b/hw/xfree86/modes/xf86Rotate.c @@ -153,6 +153,35 @@ xf86CrtcDamageShadow (xf86CrtcPtr crtc) REGION_UNINIT (pScreen, &damage_region); } +static void +xf86CrtcShadowClear (xf86CrtcPtr crtc) +{ + PixmapPtr dst_pixmap = crtc->rotatedPixmap; + ScrnInfoPtr scrn = crtc->scrn; + ScreenPtr screen = scrn->pScreen; + PicturePtr dst; + PictFormatPtr format = compWindowFormat (WindowTable[screen->myNum]); + static xRenderColor black = { 0, 0, 0, 0 }; + xRectangle rect; + int error; + + dst = CreatePicture (None, + &dst_pixmap->drawable, + format, + 0L, + NULL, + serverClient, + &error); + if (!dst) + return; + rect.x = 0; + rect.y = 0; + rect.width = dst_pixmap->drawable.width; + rect.height = dst_pixmap->drawable.height; + CompositeRects (PictOpSrc, dst, &black, 1, &rect); + FreePicture (dst, None); +} + static void xf86RotatePrepare (ScreenPtr pScreen) { @@ -170,6 +199,7 @@ xf86RotatePrepare (ScreenPtr pScreen) crtc->rotatedData, crtc->mode.HDisplay, crtc->mode.VDisplay); + xf86CrtcShadowClear (crtc); if (!xf86_config->rotation_damage_registered) { /* Hook damage to screen pixmap */