[PATCH 18/20] dix: split softening and constant deceleration into two functions
Peter Hutterer
peter.hutterer at who-t.net
Tue Apr 19 23:28:27 PDT 2011
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 */
--
1.7.4.4
More information about the xorg-devel
mailing list