aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/dix/ptrveloc.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2010-01-04 15:34:07 +0000
committermarha <marha@users.sourceforge.net>2010-01-04 15:34:07 +0000
commit33a317f48eb3fe888177235ee49b635fbb8cda2f (patch)
treeef06bc25b3a9d4096e65b8a6a11e7e8f7e7ee3c6 /xorg-server/dix/ptrveloc.c
parent1e723abc27bdc2ad675bce79467a7308c2966861 (diff)
downloadvcxsrv-33a317f48eb3fe888177235ee49b635fbb8cda2f.tar.gz
vcxsrv-33a317f48eb3fe888177235ee49b635fbb8cda2f.tar.bz2
vcxsrv-33a317f48eb3fe888177235ee49b635fbb8cda2f.zip
Git update 4/1/2010
Diffstat (limited to 'xorg-server/dix/ptrveloc.c')
-rw-r--r--xorg-server/dix/ptrveloc.c28
1 files changed, 27 insertions, 1 deletions
diff --git a/xorg-server/dix/ptrveloc.c b/xorg-server/dix/ptrveloc.c
index 6fb9e2122..c2f43784c 100644
--- a/xorg-server/dix/ptrveloc.c
+++ b/xorg-server/dix/ptrveloc.c
@@ -868,6 +868,31 @@ SmoothLinearProfile(
}
+/**
+ * From 0 to threshold, the response graduates smoothly from min_accel to
+ * acceleration. Beyond threshold it is exactly the specified acceleration.
+ */
+static float
+SmoothLimitedProfile(
+ DeviceIntPtr dev,
+ DeviceVelocityPtr vel,
+ float velocity,
+ float threshold,
+ float acc)
+{
+ float res;
+
+ if(velocity >= threshold || threshold == 0.0f)
+ return acc;
+
+ velocity /= threshold; /* should be [0..1[ now */
+
+ res = CalcPenumbralGradient(velocity) * (acc - vel->min_acceleration);
+
+ return vel->min_acceleration + res;
+}
+
+
static float
LinearProfile(
DeviceIntPtr dev,
@@ -879,7 +904,6 @@ LinearProfile(
return acc * velocity;
}
-
static float
NoProfile(
DeviceIntPtr dev,
@@ -911,6 +935,8 @@ GetAccelerationProfile(
return PowerProfile;
case AccelProfileLinear:
return LinearProfile;
+ case AccelProfileSmoothLimited:
+ return SmoothLimitedProfile;
case AccelProfileNone:
return NoProfile;
default: