summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2008-03-18 15:25:31 -0700
committerKeith Packard <keithp@keithp.com>2008-11-24 13:24:39 -0800
commite86c34663ef97e946a1129450105efa89a123af6 (patch)
tree6821d520ab67db5f5792508127dc7e5da3ac2d9b /hw
parent97ab0c6eff870b52c0383b63a78cec49059b2545 (diff)
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.
Diffstat (limited to 'hw')
-rw-r--r--hw/xfree86/modes/xf86Rotate.c30
1 files changed, 30 insertions, 0 deletions
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
@@ -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 */