[PATCH] Clear shadow pixmaps before using them.

Keith Packard keithp at keithp.com
Fri Nov 14 14:12:45 PST 2008


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 files changed, 30 insertions(+), 0 deletions(-)

diff --git a/hw/xfree86/modes/xf86Rotate.c b/hw/xfree86/modes/xf86Rotate.c
index dc9ad11..7b49afa 100644
--- a/hw/xfree86/modes/xf86Rotate.c
+++ b/hw/xfree86/modes/xf86Rotate.c
@@ -154,6 +154,35 @@ xf86CrtcDamageShadow (xf86CrtcPtr crtc)
 }
 
 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)
 {
     ScrnInfoPtr		pScrn = xf86Screens[pScreen->myNum];
@@ -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 */
-- 
1.5.6.5




More information about the xorg mailing list