Eliminate the shadow clear on transform change
When the crtc transformation changes, the entire crtc must be repainted. This was being done by clearing the shadow and then painting the rectangle containing the screen image; the clear being required as the screen image may not fill the crtc. When changing the transform rapidly, this leads to flashing. Eliminate the clear by painting the entire crtc instead of just the screen rectangle. Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
parent
76f18b94bd
commit
5394b7e662
|
@ -357,6 +357,10 @@ struct _xf86Crtc {
|
||||||
* Added in ABI version 3
|
* Added in ABI version 3
|
||||||
*/
|
*/
|
||||||
Bool active;
|
Bool active;
|
||||||
|
/**
|
||||||
|
* Clear the shadow
|
||||||
|
*/
|
||||||
|
Bool shadowClear;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct _xf86OutputFuncs {
|
typedef struct _xf86OutputFuncs {
|
||||||
|
|
|
@ -113,22 +113,33 @@ xf86RotateCrtcRedisplay (xf86CrtcPtr crtc, RegionPtr region)
|
||||||
SetPicturePictFilter (src, crtc->filter,
|
SetPicturePictFilter (src, crtc->filter,
|
||||||
crtc->params, crtc->nparams);
|
crtc->params, crtc->nparams);
|
||||||
|
|
||||||
while (n--)
|
if (crtc->shadowClear)
|
||||||
{
|
{
|
||||||
BoxRec dst_box;
|
|
||||||
|
|
||||||
dst_box = *b;
|
|
||||||
dst_box.x1 -= crtc->filter_width >> 1;
|
|
||||||
dst_box.x2 += crtc->filter_width >> 1;
|
|
||||||
dst_box.y1 -= crtc->filter_height >> 1;
|
|
||||||
dst_box.y2 += crtc->filter_height >> 1;
|
|
||||||
pixman_f_transform_bounds (&crtc->f_framebuffer_to_crtc, &dst_box);
|
|
||||||
CompositePicture (PictOpSrc,
|
CompositePicture (PictOpSrc,
|
||||||
src, NULL, dst,
|
src, NULL, dst,
|
||||||
dst_box.x1, dst_box.y1, 0, 0, dst_box.x1, dst_box.y1,
|
0, 0, 0, 0, 0, 0,
|
||||||
dst_box.x2 - dst_box.x1,
|
crtc->mode.HDisplay, crtc->mode.VDisplay);
|
||||||
dst_box.y2 - dst_box.y1);
|
crtc->shadowClear = FALSE;
|
||||||
b++;
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
while (n--)
|
||||||
|
{
|
||||||
|
BoxRec dst_box;
|
||||||
|
|
||||||
|
dst_box = *b;
|
||||||
|
dst_box.x1 -= crtc->filter_width >> 1;
|
||||||
|
dst_box.x2 += crtc->filter_width >> 1;
|
||||||
|
dst_box.y1 -= crtc->filter_height >> 1;
|
||||||
|
dst_box.y2 += crtc->filter_height >> 1;
|
||||||
|
pixman_f_transform_bounds (&crtc->f_framebuffer_to_crtc, &dst_box);
|
||||||
|
CompositePicture (PictOpSrc,
|
||||||
|
src, NULL, dst,
|
||||||
|
dst_box.x1, dst_box.y1, 0, 0, dst_box.x1, dst_box.y1,
|
||||||
|
dst_box.x2 - dst_box.x1,
|
||||||
|
dst_box.y2 - dst_box.y1);
|
||||||
|
b++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
FreePicture (src, None);
|
FreePicture (src, None);
|
||||||
FreePicture (dst, None);
|
FreePicture (dst, None);
|
||||||
|
@ -192,7 +203,7 @@ xf86CrtcDamageShadow (xf86CrtcPtr crtc)
|
||||||
DamageRegionAppend (&(*pScreen->GetScreenPixmap)(pScreen)->drawable,
|
DamageRegionAppend (&(*pScreen->GetScreenPixmap)(pScreen)->drawable,
|
||||||
&damage_region);
|
&damage_region);
|
||||||
REGION_UNINIT (pScreen, &damage_region);
|
REGION_UNINIT (pScreen, &damage_region);
|
||||||
xf86CrtcShadowClear (crtc);
|
crtc->shadowClear = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Reference in New Issue
Block a user