[PATCH 18/20] dix: split softening and constant deceleration into two functions

Simon Thum simon.thum at gmx.de
Wed Apr 20 16:58:24 PDT 2011


On 04/20/2011 08:28 AM, Peter Hutterer wrote:
> Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
> ---
>  dix/ptrveloc.c |   15 ++++++++++-----
>  1 files changed, 10 insertions(+), 5 deletions(-)
> 
> diff --git a/dix/ptrveloc.c b/dix/ptrveloc.c
> index 8320834..f4fcd39 100644
> --- a/dix/ptrveloc.c
> +++ b/dix/ptrveloc.c
> @@ -713,7 +713,7 @@ ApplySimpleSoftening(int prev_delta, int delta)
>  
>  
>  static void
> -ApplySofteningAndConstantDeceleration(
> +ApplySoftening(
>          DeviceVelocityPtr vel,
>          int dx,
>          int dy,
> @@ -728,7 +728,11 @@ ApplySofteningAndConstantDeceleration(
>          *fdx = dx;
>          *fdy = dy;
>      }
> +}
>  
> +static void
> +ApplyConstantDeceleration(DeviceVelocityPtr vel, float *fdx, float *fdy)
> +{
>      *fdx *= vel->const_acceleration;
>      *fdy *= vel->const_acceleration;
>  }
> @@ -1153,10 +1157,11 @@ acceleratePointerPredictable(
>                                              (float)dev->ptrfeed->ctrl.den);
>  
>              if(mult != 1.0f || velocitydata->const_acceleration != 1.0f) {
> -                ApplySofteningAndConstantDeceleration(velocitydata,
> -                                                      dx, dy,
> -                                                      &fdx, &fdy,
> -                                                      (mult > 1.0f) && soften);
> +                ApplySoftening(velocitydata,
> +                               dx, dy,
> +                               &fdx, &fdy,
> +                               (mult > 1.0f) && soften);
> +                ApplyConstantDeceleration(velocitydata, &fdx, &fdy);
>  
>                  /* Calculate the new delta (with accel) and drop it back
>                   * into the valuator masks */
Reviewed-by: Simon Thum <simon.thum at gmx.de>

for the rest of the series [16-18] as well.

Cheers,

Simon



More information about the xorg-devel mailing list