diff options
author | Keith Packard <keithp@keithp.com> | 2008-03-15 00:36:45 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2008-11-24 13:24:36 -0800 |
commit | f50349e1930e620cacdf27a6f8585fcb9cb5199a (patch) | |
tree | d72ced5c7796a7143f8ef56f0b99f5429f486113 /hw | |
parent | acda790e430b2a18c7c35379f6e538f3d01ff221 (diff) |
[RANDR] Support filters in CRTC transforms.
Create new RRTransform datatype to hold all of the transform related
information, use that in lots of places to pass filters around.
Diffstat (limited to 'hw')
-rw-r--r-- | hw/xfree86/modes/xf86Crtc.h | 3 | ||||
-rw-r--r-- | hw/xfree86/modes/xf86Rotate.c | 31 |
2 files changed, 30 insertions, 4 deletions
diff --git a/hw/xfree86/modes/xf86Crtc.h b/hw/xfree86/modes/xf86Crtc.h index ef8589ed1..a5bb11b12 100644 --- a/hw/xfree86/modes/xf86Crtc.h +++ b/hw/xfree86/modes/xf86Crtc.h @@ -306,6 +306,9 @@ struct _xf86Crtc { */ PictTransform crtc_to_framebuffer; PictTransform framebuffer_to_crtc; + PictFilterPtr filter; + xFixed *params; + int nparams; Bool transform_in_use; /** * Bounding box in screen space diff --git a/hw/xfree86/modes/xf86Rotate.c b/hw/xfree86/modes/xf86Rotate.c index 7967e5b28..f201ae3be 100644 --- a/hw/xfree86/modes/xf86Rotate.c +++ b/hw/xfree86/modes/xf86Rotate.c @@ -109,6 +109,9 @@ xf86RotateCrtcRedisplay (xf86CrtcPtr crtc, RegionPtr region) error = SetPictureTransform (src, &crtc->crtc_to_framebuffer); if (error) return; + if (crtc->transform_in_use && crtc->filter) + SetPicturePictFilter (src, crtc->filter, + crtc->params, crtc->nparams); while (n--) { @@ -380,13 +383,33 @@ xf86CrtcRotate (xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotation) } #ifdef RANDR_12_INTERFACE + if (crtc->randr_crtc) { - PictTransform user_forward, user_reverse; - if (crtc->randr_crtc && RRCrtcGetTransform (crtc->randr_crtc, &user_forward, &user_reverse)) + xFixed *new_params = NULL; + int new_nparams = 0; + PictFilterPtr new_filter = NULL; + + RRTransformPtr transform = RRCrtcGetTransform (crtc->randr_crtc); + if (transform) { - PictureTransformMultiply (&crtc_to_fb, &user_forward, &crtc_to_fb); - PictureTransformMultiply (&fb_to_crtc, &fb_to_crtc, &user_reverse); + if (transform->nparams) { + new_params = xalloc (transform->nparams * sizeof (xFixed)); + if (new_params) { + memcpy (new_params, transform->params, + transform->nparams * sizeof (xFixed)); + new_nparams = transform->nparams; + new_filter = transform->filter; + } + } else + new_filter = transform->filter; + PictureTransformMultiply (&crtc_to_fb, &transform->transform, &crtc_to_fb); + PictureTransformMultiply (&fb_to_crtc, &fb_to_crtc, &transform->inverse); } + if (crtc->params) + xfree (crtc->params); + crtc->params = new_params; + crtc->nparams = new_nparams; + crtc->filter = new_filter; } #endif /* |