On Thu, Apr 16, 2015 at 02:41:33PM -0400, Benjamin Tissoires wrote: > No functional code. Allows to reuse the linear filtering in other > acceleration profiles. > > Signed-off-by: Benjamin Tissoires <benjamin.tissoi...@gmail.com> > --- > no changes since v1 > > src/filter.c | 20 +++++++++++++++----- > 1 files changed, 15 insertions(+), 5 deletions(-) > > diff --git a/src/filter.c b/src/filter.c > index 962d74d..f7ff426 100644 > --- a/src/filter.c > +++ b/src/filter.c > @@ -305,6 +305,20 @@ create_pointer_accelerator_filter(accel_profile_func_t > profile) > return &filter->base; > } > > +static double > +accel_profile_linear(double speed_in, > + const double max_accel, > + const double threshold, > + const double incline) > +{ > + double s1, s2; > + > + s1 = min(1, speed_in * 5); > + s2 = 1 + (speed_in - threshold) * incline; > + > + return min(max_accel, s2 > 1 ? s2 : s1); > +} > +
thinking about this again, I'm not sure we should do this. for the archives, we had a couple of meetings where we agreed on that if we need model specific pointer acceleration we will write it once, get it to work and then leave it untouched for eternity. while we may tweak pointer acceleration over time, model-specific ones will stay static to avoid an explosion of the test matrix or accidentally breaking a device that we don't have access to (anymore). With that in mind, I think we should just drop this patch and copy the code for the x230 acceleration method. Cheers, Peter > double > pointer_accel_profile_linear(struct motion_filter *filter, > void *data, > @@ -314,15 +328,11 @@ pointer_accel_profile_linear(struct motion_filter > *filter, > struct pointer_accelerator *accel_filter = > (struct pointer_accelerator *)filter; > > - double s1, s2; > const double max_accel = accel_filter->accel; /* unitless factor */ > const double threshold = accel_filter->threshold; /* units/ms */ > const double incline = accel_filter->incline; > > - s1 = min(1, speed_in * 5); > - s2 = 1 + (speed_in - threshold) * incline; > - > - return min(max_accel, s2 > 1 ? s2 : s1); > + return accel_profile_linear(speed_in, max_accel, threshold, incline); > } > > double > -- > 1.7.1 _______________________________________________ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel