chromiumos/platform/gestures.git
15 months agoFingerMetrics: Try to avoid crash. 24/66424/2 master
Andrew de los Reyes [Tue, 20 Aug 2013 21:07:14 +0000 (14:07 -0700)]
FingerMetrics: Try to avoid crash.

When updating finger metrics, make sure we have a FingerState.  I'm
hopeful that this fixes a crash we see, but as I have no repro, I'm
not sure.

BUG=chromium:254786
TEST=unittests pass

Change-Id: I9d31b268d2fa0c904ba016f4fd2f5d4a3fd25336
Reviewed-on: https://gerrit.chromium.org/gerrit/66424
Reviewed-by: Charlie Mooney <charliemooney@chromium.org>
Tested-by: Andrew de los Reyes <adlr@chromium.org>
Commit-Queue: Andrew de los Reyes <adlr@chromium.org>

15 months agoImmediateInterpreter: Loosen two fingers gesturing requirement. 82/60482/4 release-R30-4537.B stabilize-4512.B
Andrew de los Reyes [Wed, 26 Jun 2013 17:51:46 +0000 (10:51 -0700)]
ImmediateInterpreter: Loosen two fingers gesturing requirement.

Historically if we were seeing if two fingers were gesturing, if one
was in the bottom zone and they were vertically aligned, we wouldn't
consider them gesturing. We now also require, when considering for
gestures (scroll) but not clicks, that the bottom finger has higher
pressure to be considered not a two finger gesture.

BUG=chromium:236687
TEST=unittests pass. With other CLs in this batch, the following regression test changes:
                                                 Test Results
+-------------------- Test ---------------------+- reference score --+---- new score -----+------ delta -------+
|  link/base_scroll_up                          |  success (0.9457)  |  success (0.9604)  |      +0.0147       |
|  link/base_scroll_up_regardless_prior_state   |  success (0.9606)  |  success (0.9318)  |      -0.0288       |
|  link/scroll_with_upper_thumb                 |  failure           |  success (1.0000)  |      +1.0000       |
|  link/simple_3f_swipe                         |  success (0.9942)  |  success (0.9780)  |      -0.0161       |
|  lumpy/scroll_with_upper_thumb                |  failure           |  success (1.0000)  |      +1.0000       |
|  mario/base_scroll_right                      |  bad (0.4108)      |  success (1.0000)  |      +0.5892       |
|  mario/base_scroll_up                         |  failure           |  success (0.9900)  |      +0.9900       |
|  mario/base_scroll_up_regardless_prior_state  |  success (0.8795)  |  success (1.0000)  |      +0.1205       |
|  spring1/move_then_scroll                     |  failure           |  success (0.9811)  |      +0.9811       |
|  spring1/scroll_fail3                         |  success (0.7372)  |  success (1.0000)  |      +0.2628       |
+-----------------------------------------------+--------------------+--------------------+--------------------+

Change-Id: I61332f6205d17f041ffc4f4a63184e7552dc492f
Reviewed-on: https://gerrit.chromium.org/gerrit/60482
Reviewed-by: Dennis Kempin <denniskempin@chromium.org>
Tested-by: Andrew de los Reyes <adlr@chromium.org>
Commit-Queue: Andrew de los Reyes <adlr@chromium.org>

15 months agoImmediateInterpreter: Non-gesturing fingers must move to gesture 81/60481/4
Andrew de los Reyes [Fri, 21 Jun 2013 01:15:42 +0000 (18:15 -0700)]
ImmediateInterpreter: Non-gesturing fingers must move to gesture

If there are many fingers on the pad, and some are determined to be
gesturing (e.g. scrolling), we put the remainder in
non_gs_fingers_. Once here, they can’t cause gestures until they begin
to move.

BUG=chromium:236687
TEST=unittests pass. With other CLs in this batch, the following regression test changes:
                                                 Test Results
+-------------------- Test ---------------------+- reference score --+---- new score -----+------ delta -------+
|  link/base_scroll_up                          |  success (0.9457)  |  success (0.9604)  |      +0.0147       |
|  link/base_scroll_up_regardless_prior_state   |  success (0.9606)  |  success (0.9318)  |      -0.0288       |
|  link/scroll_with_upper_thumb                 |  failure           |  success (1.0000)  |      +1.0000       |
|  link/simple_3f_swipe                         |  success (0.9942)  |  success (0.9780)  |      -0.0161       |
|  lumpy/scroll_with_upper_thumb                |  failure           |  success (1.0000)  |      +1.0000       |
|  mario/base_scroll_right                      |  bad (0.4108)      |  success (1.0000)  |      +0.5892       |
|  mario/base_scroll_up                         |  failure           |  success (0.9900)  |      +0.9900       |
|  mario/base_scroll_up_regardless_prior_state  |  success (0.8795)  |  success (1.0000)  |      +0.1205       |
|  spring1/move_then_scroll                     |  failure           |  success (0.9811)  |      +0.9811       |
|  spring1/scroll_fail3                         |  success (0.7372)  |  success (1.0000)  |      +0.2628       |
+-----------------------------------------------+--------------------+--------------------+--------------------+

Change-Id: I9173992493c6bda4d0667a5b5f38a154077de119
Reviewed-on: https://gerrit.chromium.org/gerrit/60481
Reviewed-by: Dennis Kempin <denniskempin@chromium.org>
Tested-by: Andrew de los Reyes <adlr@chromium.org>
Commit-Queue: Andrew de los Reyes <adlr@chromium.org>

15 months agoImmediateInterpreter: Improve thumb detection 80/60480/4
Andrew de los Reyes [Fri, 21 Jun 2013 01:15:14 +0000 (18:15 -0700)]
ImmediateInterpreter: Improve thumb detection

When looking at the distance a contact has travelled, we were looking
at the distance since fingers changed, but we do a better job if using
the distance travelled since each finger touched down.

BUG=chromium:236687
TEST=unittests pass. With other CLs in this batch, the following regression test changes:
                                                 Test Results
+-------------------- Test ---------------------+- reference score --+---- new score -----+------ delta -------+
|  link/base_scroll_up                          |  success (0.9457)  |  success (0.9604)  |      +0.0147       |
|  link/base_scroll_up_regardless_prior_state   |  success (0.9606)  |  success (0.9318)  |      -0.0288       |
|  link/scroll_with_upper_thumb                 |  failure           |  success (1.0000)  |      +1.0000       |
|  link/simple_3f_swipe                         |  success (0.9942)  |  success (0.9780)  |      -0.0161       |
|  lumpy/scroll_with_upper_thumb                |  failure           |  success (1.0000)  |      +1.0000       |
|  mario/base_scroll_right                      |  bad (0.4108)      |  success (1.0000)  |      +0.5892       |
|  mario/base_scroll_up                         |  failure           |  success (0.9900)  |      +0.9900       |
|  mario/base_scroll_up_regardless_prior_state  |  success (0.8795)  |  success (1.0000)  |      +0.1205       |
|  spring1/move_then_scroll                     |  failure           |  success (0.9811)  |      +0.9811       |
|  spring1/scroll_fail3                         |  success (0.7372)  |  success (1.0000)  |      +0.2628       |
+-----------------------------------------------+--------------------+--------------------+--------------------+

Change-Id: If291a4850d097777b83f56f267d87655169866c6
Reviewed-on: https://gerrit.chromium.org/gerrit/60480
Reviewed-by: Dennis Kempin <denniskempin@chromium.org>
Tested-by: Andrew de los Reyes <adlr@chromium.org>
Commit-Queue: Andrew de los Reyes <adlr@chromium.org>

15 months agoImmediateInterpreter: Improve multifinger gesture detection 79/60479/4
Andrew de los Reyes [Fri, 21 Jun 2013 01:09:59 +0000 (18:09 -0700)]
ImmediateInterpreter: Improve multifinger gesture detection

Previously we would look at the number of gesturing fingers, and
consider the topmost (closest to the keyboard) 3 or 2 for 3 or 2
finger gestures.

With this change, we sort fingers by proximity. We then look for
multi-finger gestures, starting with many fingers and working down to
few fingers, each iteration discarding a finger so that we end up with
the two closest fingers.

Also, since we are no longer just assuming that a given gesture is
always performed by the fingers closest to the keyboard, we return the
fingers used from UpdateCurrentGestureType(). These are then passed
into the function that fills the resulting gesture.

BUG=chromium:236687
TEST=unittests pass. With other CLs in this batch, the following regression test changes:
                                                 Test Results
+-------------------- Test ---------------------+- reference score --+---- new score -----+------ delta -------+
|  link/base_scroll_up                          |  success (0.9457)  |  success (0.9604)  |      +0.0147       |
|  link/base_scroll_up_regardless_prior_state   |  success (0.9606)  |  success (0.9318)  |      -0.0288       |
|  link/scroll_with_upper_thumb                 |  failure           |  success (1.0000)  |      +1.0000       |
|  link/simple_3f_swipe                         |  success (0.9942)  |  success (0.9780)  |      -0.0161       |
|  lumpy/scroll_with_upper_thumb                |  failure           |  success (1.0000)  |      +1.0000       |
|  mario/base_scroll_right                      |  bad (0.4108)      |  success (1.0000)  |      +0.5892       |
|  mario/base_scroll_up                         |  failure           |  success (0.9900)  |      +0.9900       |
|  mario/base_scroll_up_regardless_prior_state  |  success (0.8795)  |  success (1.0000)  |      +0.1205       |
|  spring1/move_then_scroll                     |  failure           |  success (0.9811)  |      +0.9811       |
|  spring1/scroll_fail3                         |  success (0.7372)  |  success (1.0000)  |      +0.2628       |
+-----------------------------------------------+--------------------+--------------------+--------------------+

Change-Id: I923b46a6515c784fe200b358755540adf2eb0ebf
Reviewed-on: https://gerrit.chromium.org/gerrit/60479
Reviewed-by: Dennis Kempin <denniskempin@chromium.org>
Tested-by: Andrew de los Reyes <adlr@chromium.org>
Commit-Queue: Andrew de los Reyes <adlr@chromium.org>

15 months agoImmediateInterpreter: Improve 2-fingers gesturing heuristics 78/60478/4
Andrew de los Reyes [Fri, 21 Jun 2013 01:00:59 +0000 (18:00 -0700)]
ImmediateInterpreter: Improve 2-fingers gesturing heuristics

- If two fingers have very different pressures, only disqualify these
  fingers from gesturing together if the lower one is the one with
  high pressure (likely thumb).

- Look for fingers that are trending together, and consider them to be
  gesturing together. Specifically, three conditions must be met:
  - fingers trending in same direction
  - the finger that moving more has moved enough, or is in moving_
  - if damp zone is occupied, the damp finger has moved enough is in
    moving_

BUG=chromium:236687
TEST=unittests pass. With other CLs in this batch, the following regression test changes:
                                                 Test Results
+-------------------- Test ---------------------+- reference score --+---- new score -----+------ delta -------+
|  link/base_scroll_up                          |  success (0.9457)  |  success (0.9604)  |      +0.0147       |
|  link/base_scroll_up_regardless_prior_state   |  success (0.9606)  |  success (0.9318)  |      -0.0288       |
|  link/scroll_with_upper_thumb                 |  failure           |  success (1.0000)  |      +1.0000       |
|  link/simple_3f_swipe                         |  success (0.9942)  |  success (0.9780)  |      -0.0161       |
|  lumpy/scroll_with_upper_thumb                |  failure           |  success (1.0000)  |      +1.0000       |
|  mario/base_scroll_right                      |  bad (0.4108)      |  success (1.0000)  |      +0.5892       |
|  mario/base_scroll_up                         |  failure           |  success (0.9900)  |      +0.9900       |
|  mario/base_scroll_up_regardless_prior_state  |  success (0.8795)  |  success (1.0000)  |      +0.1205       |
|  spring1/move_then_scroll                     |  failure           |  success (0.9811)  |      +0.9811       |
|  spring1/scroll_fail3                         |  success (0.7372)  |  success (1.0000)  |      +0.2628       |
+-----------------------------------------------+--------------------+--------------------+--------------------+

Change-Id: Ia8d612feb93536dc907098d59e66cec7e12c92ea
Reviewed-on: https://gerrit.chromium.org/gerrit/60478
Reviewed-by: Dennis Kempin <denniskempin@chromium.org>
Tested-by: Andrew de los Reyes <adlr@chromium.org>
Commit-Queue: Andrew de los Reyes <adlr@chromium.org>

15 months agoImmediateInterpreter: Trigger 3-finger swipe after any finger moves enough. 77/60477/3
Andrew de los Reyes [Fri, 21 Jun 2013 00:49:41 +0000 (17:49 -0700)]
ImmediateInterpreter: Trigger 3-finger swipe after any finger moves enough.

Previously we required that all fingers moved enough, but we relax
this requirement and require only one finger to have moved enough.

BUG=chromium:236687
TEST=unittests pass. With other CLs in this batch, the following regression test changes:
                                                 Test Results
+-------------------- Test ---------------------+- reference score --+---- new score -----+------ delta -------+
|  link/base_scroll_up                          |  success (0.9457)  |  success (0.9604)  |      +0.0147       |
|  link/base_scroll_up_regardless_prior_state   |  success (0.9606)  |  success (0.9318)  |      -0.0288       |
|  link/scroll_with_upper_thumb                 |  failure           |  success (1.0000)  |      +1.0000       |
|  link/simple_3f_swipe                         |  success (0.9942)  |  success (0.9780)  |      -0.0161       |
|  lumpy/scroll_with_upper_thumb                |  failure           |  success (1.0000)  |      +1.0000       |
|  mario/base_scroll_right                      |  bad (0.4108)      |  success (1.0000)  |      +0.5892       |
|  mario/base_scroll_up                         |  failure           |  success (0.9900)  |      +0.9900       |
|  mario/base_scroll_up_regardless_prior_state  |  success (0.8795)  |  success (1.0000)  |      +0.1205       |
|  spring1/move_then_scroll                     |  failure           |  success (0.9811)  |      +0.9811       |
|  spring1/scroll_fail3                         |  success (0.7372)  |  success (1.0000)  |      +0.2628       |
+-----------------------------------------------+--------------------+--------------------+--------------------+

Change-Id: I5dcada980e0efbd5bda677e9f11ce33423b0f6f2
Reviewed-on: https://gerrit.chromium.org/gerrit/60477
Reviewed-by: Dennis Kempin <denniskempin@chromium.org>
Tested-by: Andrew de los Reyes <adlr@chromium.org>
Commit-Queue: Andrew de los Reyes <adlr@chromium.org>

15 months agoImmediateInterpreter: Don't generate flings if didn't scroll 76/60476/3
Andrew de los Reyes [Fri, 21 Jun 2013 00:11:21 +0000 (17:11 -0700)]
ImmediateInterpreter: Don't generate flings if didn't scroll

Future CLs will switch to scroll mode more readily and thus generate
more 0-magnitude flings (when doing such small scrolls that they end
up not happening). We filter out these unnecessary flings.

BUG=chromium:255062
TEST=unittests/regression tests pass

Change-Id: Ic93431ab0d2524a551861b812713dbd0bb8e2cf0
Reviewed-on: https://gerrit.chromium.org/gerrit/60476
Reviewed-by: Dennis Kempin <denniskempin@chromium.org>
Tested-by: Andrew de los Reyes <adlr@chromium.org>
Commit-Queue: Andrew de los Reyes <adlr@chromium.org>

15 months agoset.h: SetSubtract function 75/60475/3
Andrew de los Reyes [Fri, 21 Jun 2013 00:02:20 +0000 (17:02 -0700)]
set.h: SetSubtract function

BUG=chromium:255066
TEST=unittest

Change-Id: I475138709e1dcfb9de24164764f096cd09dcdb9f
Reviewed-on: https://gerrit.chromium.org/gerrit/60475
Reviewed-by: Dennis Kempin <denniskempin@chromium.org>
Tested-by: Andrew de los Reyes <adlr@chromium.org>
Commit-Queue: Andrew de los Reyes <adlr@chromium.org>

16 months agoLogging: Updated MTStat API 92/61592/2 factory-4455.B factory-pit-4471.B firmware-pit-4482.B stabilize-4443.B
Dennis Kempin [Thu, 11 Jul 2013 18:15:43 +0000 (11:15 -0700)]
Logging: Updated MTStat API

The MTSTat logging api has been extended and updated to reflect the
latest MTStats update.

BUG=chromium:248274
TEST=manual test

Change-Id: I50affc39ad35a5a94bc6399826ddfdef7a793c72
Reviewed-on: https://gerrit.chromium.org/gerrit/61592
Reviewed-by: Andrew de los Reyes <adlr@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@chromium.org>
Tested-by: Dennis Kempin <denniskempin@chromium.org>
16 months agocr48_profile_sensor_filter_interpreter_unittest.cc: Fix stack overflow 36/61636/2
Chung-yih Wang [Fri, 12 Jul 2013 02:26:14 +0000 (10:26 +0800)]
cr48_profile_sensor_filter_interpreter_unittest.cc: Fix stack overflow

AddressSanitizer: stack-buffer-overflow happens in ASAN build

BUG=chromium:258110
TEST=gestures build successfully for ASAN

Change-Id: Iea5327da07b2d8c1f192bd119bc27cba4e271723
Reviewed-on: https://gerrit.chromium.org/gerrit/61636
Reviewed-by: Andrew de los Reyes <adlr@chromium.org>
Commit-Queue: Chung-yih Wang <cywang@chromium.org>
Tested-by: Chung-yih Wang <cywang@chromium.org>
16 months agoTrendClassifyingFilterInterpreter: Fix indent 74/60474/2 factory-pit-4390.B firmware-falco_peppy-4389.B firmware-leon-4389.26.B firmware-wolf-4389.24.B
Andrew de los Reyes [Fri, 21 Jun 2013 00:07:28 +0000 (17:07 -0700)]
TrendClassifyingFilterInterpreter: Fix indent

BUG=chromium:255059
TEST=unittests pass; no change in regression tests

Change-Id: I711b34b61f50edd0e48b8ff965aa4183a41cb3e3
Reviewed-on: https://gerrit.chromium.org/gerrit/60474
Reviewed-by: Tai-Hsu Lin <sheckylin@chromium.org>
Commit-Queue: Tai-Hsu Lin <sheckylin@chromium.org>
Tested-by: Tai-Hsu Lin <sheckylin@chromium.org>
16 months agoNameForFingerStateFlag: Log Trend finger flags 73/60473/2
Andrew de los Reyes [Fri, 21 Jun 2013 00:03:09 +0000 (17:03 -0700)]
NameForFingerStateFlag: Log Trend finger flags

These flags were missed in this logging command when they were added.

BUG=chromium:255058
TEST=Saw flags properly logged while debugging

Change-Id: I946264b94a60383cd79e1abf533ff6d4b23240a6
Reviewed-on: https://gerrit.chromium.org/gerrit/60473
Reviewed-by: Tai-Hsu Lin <sheckylin@chromium.org>
Commit-Queue: Tai-Hsu Lin <sheckylin@chromium.org>
Tested-by: Tai-Hsu Lin <sheckylin@chromium.org>
16 months agosrc/activity_log.cc: fix crash during feedback generating 42/60042/2
Chung-yih Wang [Wed, 26 Jun 2013 07:34:45 +0000 (15:34 +0800)]
src/activity_log.cc: fix crash during feedback generating

BUG=chromium:254352
TEST=on arrow, have more than 5 fingers on the touchpad, then
  press alt-shift-i and browser/X should not crash.

Change-Id: I7e75debac53b6185c916c5c86998b31b8d96f723
Reviewed-on: https://gerrit.chromium.org/gerrit/60042
Reviewed-by: Andrew de los Reyes <adlr@chromium.org>
Commit-Queue: Chung-yih Wang <cywang@chromium.org>
Tested-by: Chung-yih Wang <cywang@chromium.org>
16 months agoCompile with larger activity_log for in-place builds 26/59926/3
Dennis Kempin [Tue, 25 Jun 2013 17:19:38 +0000 (10:19 -0700)]
Compile with larger activity_log for in-place builds

evdev logs are longer than activity logs. This CL increases the size of
acitivty logs for in-place builds only. This will allow any evdev log to
fit into an activity log after replay.
This only affects local developer tools, not the end-user build.

BUG=chromium:253947
TEST=manual test with mtstat

Change-Id: I0ec4d76d65302a971db7bc8494a30caa6e5515a5
Reviewed-on: https://gerrit.chromium.org/gerrit/59926
Reviewed-by: Andrew de los Reyes <adlr@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@chromium.org>
Tested-by: Dennis Kempin <denniskempin@chromium.org>
16 months agologging.h: Added MTStatLog helper 18/59918/3
Dennis Kempin [Tue, 25 Jun 2013 16:11:39 +0000 (09:11 -0700)]
logging.h: Added MTStatLog helper

Formats log lines for use with the MTStat tool.
Only for local use during debugging, no references in the repository.

BUG=chromium:253947
TEST=none

Change-Id: Iaf82464dbbe485ea140cc5af8c2412cf3e52630f
Reviewed-on: https://gerrit.chromium.org/gerrit/59918
Reviewed-by: Andrew de los Reyes <adlr@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@chromium.org>
Tested-by: Dennis Kempin <denniskempin@chromium.org>
16 months agosrc/activity_log.cc: fix the naming conflict of 'kKeyGestureMetricsType' 75/59875/2
Chung-yih Wang [Tue, 25 Jun 2013 03:55:41 +0000 (11:55 +0800)]
src/activity_log.cc: fix the naming conflict of 'kKeyGestureMetricsType'

It is a coincidence that the keyword for kKeyGestureMetricsType
is the same as the generic keyword 'type' of the event type in the log.

BUG=None
TEST=None

Change-Id: I58eaa5555a1b09c45637dd971fb998284f350ffc
Reviewed-on: https://gerrit.chromium.org/gerrit/59875
Reviewed-by: Tai-Hsu Lin <sheckylin@chromium.org>
Commit-Queue: Chung-yih Wang <cywang@chromium.org>
Tested-by: Chung-yih Wang <cywang@chromium.org>
17 months agoAccelFilterInterpreter: Expose custom accel params via array prop 34/59134/5 release-R29-4319.B
Andrew de los Reyes [Tue, 18 Jun 2013 22:13:06 +0000 (15:13 -0700)]
AccelFilterInterpreter: Expose custom accel params via array prop

Instead of parsing a string, which can only be changed by restarting
the UI, use array properties for the custom curves. This allows
on-the-fly changes at the expense of not being able to persist them in
an xorg.conf file.

BUG=chromium:251407
TEST=Unittests pass. Tested that using xinput to change array values
works correctly, in that both xinput gives the correct values back and
gestures library sees the correct values. Regression tests show no
change in the first 4 significant digits of all scores.

Change-Id: Ia412bfe20a52f6173783fcfbc6b999fdb9f15164
Reviewed-on: https://gerrit.chromium.org/gerrit/59134
Reviewed-by: Andrew de los Reyes <adlr@chromium.org>
Tested-by: Andrew de los Reyes <adlr@chromium.org>
Commit-Queue: Andrew de los Reyes <adlr@chromium.org>

17 months agoProperties: Array properties support 33/59133/5
Andrew de los Reyes [Tue, 18 Jun 2013 21:25:31 +0000 (14:25 -0700)]
Properties: Array properties support

Add new support for array-based properties. This entails a few things:

- The C-API for gestures changes so that all properties include a
  count of elements. Existing properties will use this API with a
  count of 1, while new array-based properties will pass other
  numbers.

- Support for logging array values when dumping properties.

BUG=chromium:251407
TEST=Unittests pass. Tested that using xinput to change array values
works correctly, in that both xinput gives the correct values back and
gestures library sees the correct values. Regression tests show no
change in the first 4 significant digits of all scores.
CQ-DEPEND=CL:59135, CL:59138

Change-Id: I68933060f72109d3d10dd1eb88b423c738bc5b57
Reviewed-on: https://gerrit.chromium.org/gerrit/59133
Reviewed-by: Andrew de los Reyes <adlr@chromium.org>
Tested-by: Andrew de los Reyes <adlr@chromium.org>
Commit-Queue: Andrew de los Reyes <adlr@chromium.org>

17 months agoCr48Filter: Persistent tracking id for existing fingers 88/58688/3 factory-4290.B stabilize-4287.B
Dennis Kempin [Fri, 14 Jun 2013 16:51:26 +0000 (09:51 -0700)]
Cr48Filter: Persistent tracking id for existing fingers

When a second finger is added the Cr48 filter assumed that the existing
finger will stay in the same slot. This is not the case anymore.
The new logic compares the distance of both fingers to previously
existing finger and copies over the tracking id to the closest one.
This way fingers don't get mixed up which caused cursor or scroll jumps.

BUG=chromium:249491
TEST=mario2/click_jumpy_cursor
there was a regression reported in
mario/base_scroll_regardless_of_previous_state. However the new behavior
is an improvment, as the old behavior had a horizontal scroll jump due
to mixed up fingers. The new behavior shows a slight cursor movement
before the scroll.

Change-Id: I68696abeed29d8c3334bbf649a6a65c9a7bec949
Reviewed-on: https://gerrit.chromium.org/gerrit/58688
Commit-Queue: Dennis Kempin <denniskempin@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@chromium.org>
Tested-by: Dennis Kempin <denniskempin@chromium.org>
17 months agoTraceMarker: Don't log errors when open fails 38/58138/2 factory-pit-4280.B factory-spring-4262.B
Dennis Kempin [Mon, 10 Jun 2013 23:37:22 +0000 (16:37 -0700)]
TraceMarker: Don't log errors when open fails

Trace Marker is currently not used but prints out error messages during
regression tests.
This CL simply demotes the message to info level.

BUG=chromium:246704
TEST=none

Change-Id: I285d67ec045c067a8a4260a3b76c4f7a8d6f5e63
Reviewed-on: https://gerrit.chromium.org/gerrit/58138
Reviewed-by: Andrew de los Reyes <adlr@chromium.org>
Tested-by: Dennis Kempin <denniskempin@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@chromium.org>

17 months agoGestures: Add min distance for palm points on edge 01/58201/3
Charlie Mooney [Tue, 11 Jun 2013 15:41:01 +0000 (08:41 -0700)]
Gestures: Add min distance for palm points on edge

Previously the assumption was that if there was two points close to
eachother on the edge of the pad, then they were probably two separate
fingers.  It'd be weird to have your palm on the pad and scoot a real
finger right next to it without moving and expect it to work.  However
it looks like you can get your palm to split in a wierd way on the edges
sometimes that puts it as two very close points with low pressure/size.
Since the pressure and whatnot looks reasonable, the only thing to check
really is how close they are to eachother, which is very very close.

Any fingers that are on the edge and closer than 4mm apart get
classified as palms from this change.  Since it's exceedingly difficult
to make this happen (the TP will just merge your fingers if you actually
get them that close together) this is pretty safe and finds this oddly
split palms.

BUG=chromium:248237
TEST=manual testing, regression tests, and unit tests

Change-Id: I7b5fa3112f640ca6404141ef655c846562c6e6b4
Signed-off-by: Charlie Mooney <charliemooney@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/58201

17 months agoRemove unused member declaration 93/57793/2 stabilize-4255.B
Charlie Mooney [Thu, 6 Jun 2013 17:02:51 +0000 (10:02 -0700)]
Remove unused member declaration

There is a function declared in the cr-48 sensor filter header that
seems to no longer be defined/used in the source file.  This just
removes the declaration in the header to clean it up a bit.

BUG=chromium:247388
TEST=rebuilt gestures without it and it compiled fine.  Similarly
replaying the regression tests still work and grepping for the function
name returned only this header file.

Change-Id: I1c3cfe350e7f3fe7905d06fb18725fbb1b14cd93
Signed-off-by: Charlie Mooney <charliemooney@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/57793
Reviewed-by: Chung-yih Wang <cywang@chromium.org>
17 months agoAccelFilterInterpreter: Put bounds on start/end time 59/57659/3
Andrew de los Reyes [Wed, 5 Jun 2013 20:57:19 +0000 (13:57 -0700)]
AccelFilterInterpreter: Put bounds on start/end time

We've found that on Magic Mouse, sometimes a Bluetooth packet is
resent, and that leads to inconsistent timing (long period followed by
very short period). The very short period looks like super fast
movement and get accelerated a lot.

With this CL, we fake in a reasonable period when we get a suspicious
one.

BUG=chromium:247133
TEST=magicmouse/move_with_resent_packets regression test

Change-Id: I269caedcedb0af370172de02a3838f69cfd16b3f
Reviewed-on: https://gerrit.chromium.org/gerrit/57659
Reviewed-by: Dennis Kempin <denniskempin@chromium.org>
Commit-Queue: Andrew de los Reyes <adlr@chromium.org>
Tested-by: Andrew de los Reyes <adlr@chromium.org>
17 months agoImmediateInterpreter: no jump for finger arrival 91/57591/2
Chung-yih Wang [Wed, 5 Jun 2013 07:41:24 +0000 (15:41 +0800)]
ImmediateInterpreter: no jump for finger arrival

There is a big pressure change and jump on stout when a fat finger
arrives. The patch tries to reuse high-pressure-change detector to
suppress cursor jumps.

BUG=chromium:236879
TEST=touchtests stout/cursor_jump_when_arrival

Change-Id: I1c028d6576c7c65ebae4e05406405291fab96936
Reviewed-on: https://gerrit.chromium.org/gerrit/57591
Reviewed-by: Andrew de los Reyes <adlr@chromium.org>
Commit-Queue: Chung-yih Wang <cywang@chromium.org>
Tested-by: Chung-yih Wang <cywang@chromium.org>
17 months agoFixed 1F with resting thumb click on T5R2/SemiMT touchpads 29/56829/5
Dennis Kempin [Tue, 28 May 2013 20:05:42 +0000 (13:05 -0700)]
Fixed 1F with resting thumb click on T5R2/SemiMT touchpads

We now use the same 2F button logic as for every other touchpad.
However to prevent issues on SemiMI touchpads where a lot of finger
warps happen on 2 finger clicks, we have to update the DistanceTravelled
logic to ignore movement caused by warps.
This introduces a few minor score regressions on already poorly rated
scroll test cases, but also fixed a 2F click test case on parrot.

BUG=chromium:243852
TEST=zgb/1f_click_with_resting_thumb

Change-Id: I98bed964ec82e773b8dcb7b0aefbf2cd6c48d174
Reviewed-on: https://gerrit.chromium.org/gerrit/56829
Reviewed-by: Andrew de los Reyes <adlr@chromium.org>
Tested-by: Dennis Kempin <denniskempin@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@chromium.org>

17 months agoRemoved MemoryManaged 99/57399/5
Dennis Kempin [Tue, 4 Jun 2013 00:40:57 +0000 (17:40 -0700)]
Removed MemoryManaged

The MemoryManaged class relied on static initialization. It has been
removed and it's usage has been replaced by manually declaring a memory
manager where it is needed.

BUG=chromium:246369
TEST=no regressions in touchtests. manual test on link.

Change-Id: I22dcc2e7e2cd56398eaee7f8f9337f67cdbf3214
Reviewed-on: https://gerrit.chromium.org/gerrit/57399
Reviewed-by: Andrew de los Reyes <adlr@chromium.org>
Tested-by: Dennis Kempin <denniskempin@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@chromium.org>

17 months agoAdd StationaryWiggleFilterInterpreter 44/56944/5
Chung-yih Wang [Mon, 20 May 2013 10:51:01 +0000 (18:51 +0800)]
Add StationaryWiggleFilterInterpreter

As cursor wiggling is caused by noise signal when a finger is stationary,
the patch adds a stationary wiggle interpreter to detect if a finger is
moving or stationary by its signal energy.

BUG=chromium:236879
TEST=stout/wiggle* pass

Change-Id: I65322b543c506339e25985e07661a14886847bfa
Reviewed-on: https://gerrit.chromium.org/gerrit/56944
Reviewed-by: Chung-yih Wang <cywang@chromium.org>
Tested-by: Chung-yih Wang <cywang@chromium.org>
Commit-Queue: Chung-yih Wang <cywang@chromium.org>

17 months agoactivity_replay: Make rel_ parsing optional for old logging data 43/56943/5
Chung-yih Wang [Tue, 21 May 2013 01:55:44 +0000 (09:55 +0800)]
activity_replay: Make rel_ parsing optional for old logging data

BUG=none
TEST=Given an old feedback url which does not have rel_x entries in its
  touchpad_activity_log.txt and create a test case with touchtests command

  touchtests platform/test_name -c feedback_url

  Find a gesture to shrink the log data, the utility will try to replay the
gesture. With the patch, the test case should be created successfully.

Change-Id: Iafd5af82bf2d93667e06817cbb04a481c83d9d12
Reviewed-on: https://gerrit.chromium.org/gerrit/56943
Reviewed-by: Tai-Hsu Lin <sheckylin@chromium.org>
Tested-by: Chung-yih Wang <cywang@chromium.org>
Commit-Queue: Chung-yih Wang <cywang@chromium.org>

18 months agoAdd GestureMetrics for collecting UMA touchpad noise stats 27/55727/7
Tai-Hsu Lin [Sat, 18 May 2013 08:39:53 +0000 (16:39 +0800)]
Add GestureMetrics for collecting UMA touchpad noise stats

This patch adds the metrics gesture (GestureMetrics) which is used
to deliver interesting patterns that we would like to collect with
the UMA system. Due to the deadlock problem, we need to pump the
found instances up into Chrome and send them with the UMA utilities
there. A new filter, MetricsFilterInterpreter, is added accordingly
to catch interested patterns and produce metrics gestures. We
currently catches only the touchpad ground noise pattern in the
filter, which is defined as two consecutive big moves in opposite
directions within a short period of time.

BUG=chromium:237683
TEST=Pass regression tests, no regression.
To test it on real devices, one needs the following patch on CMT:
https://gerrit.chromium.org/gerrit/55729/

On link:
$ DISPLAY=:0.0 xinput list-props 11 | grep "Metrics"

One should see:
        Metrics Noisy Ground Distance (403):    10.000000
        Metrics Noisy Ground Time (404):        0.100000

To watch for the metrics gesture, use command:
$ DISPLAY=:0.0 xinput test-xi2 11 | grep "9:"

With the default distance threshold (10.0), it should be impossible
to trigger the check. Try to quickly move finger on the touchpad and
make sure no line shows up. Now, change the threshold value to 0.1 with
the following line:

$ DISPLAY=:0.0 xinput set-float-prop 11 403 0.1

Quickly move finger back and forth on the touchpad again, one should
now see various lines coming up with the above watch command:

$ DISPLAY=:0.0 xinput test-xi2 11 | grep "9:"
                      Detail for Valuator 9:
                9: 0.00 (0.00)
                9: 0.00 (0.00)
                9: 0.00 (0.00)
                9: 0.00 (0.00)
                ...

Change-Id: I5e6c9bd5489f4e5aeb90e0d7d7f48cd3e068d08f
Reviewed-on: https://gerrit.chromium.org/gerrit/55727
Reviewed-by: Andrew de los Reyes <adlr@chromium.org>
Commit-Queue: Tai-Hsu Lin <sheckylin@chromium.org>
Tested-by: Tai-Hsu Lin <sheckylin@chromium.org>
18 months agoTrack pressure and touch_major in TrendClassifyingFilter 61/50961/8
Tai-Hsu Lin [Sun, 12 May 2013 09:32:56 +0000 (17:32 +0800)]
Track pressure and touch_major in TrendClassifyingFilter

The patch extends the TrendClassifyingFilterInterpreter to track
both the pressure and the touch_major of a finger. The classification
result is further used in the ImmediateFilterInterpreter to suppress
unintentional cursor move caused by palm-like contacts.

BUG=chromium:239683
TEST=Passed regression test, improved the result upon
https://gerrit.chromium.org/gerrit/50747/

|  spring1/move_while_typing                    |      +1.0000       |

Change-Id: I270454611331f2fc5199b2f3b3396f391e032d7b
Reviewed-on: https://gerrit.chromium.org/gerrit/50961
Reviewed-by: Andrew de los Reyes <adlr@chromium.org>
Commit-Queue: Tai-Hsu Lin <sheckylin@chromium.org>
Tested-by: Tai-Hsu Lin <sheckylin@chromium.org>
18 months agoActivityReplay: Replay logs correct 12/51212/2
Andrew de los Reyes [Wed, 8 May 2013 23:42:52 +0000 (16:42 -0700)]
ActivityReplay: Replay logs correct

Updates ActivityReplay to use the new interpreter API (which can
produce multiple gestures per SyncInterpret/HandleTimer call).  Also,
updates ActivityReplay and ActivityLog to store/load ordinal values.
With this, I can replay logs and have them match exactly.

BUG=chromium:239295
TEST=replayed log from same version w/o differences.

Change-Id: I798e4e0ec3e12240c1c3a8bca961fa1a8d9d7678
Reviewed-on: https://gerrit.chromium.org/gerrit/51212
Reviewed-by: Dennis Kempin <denniskempin@chromium.org>
Commit-Queue: Andrew de los Reyes <adlr@chromium.org>
Tested-by: Andrew de los Reyes <adlr@chromium.org>
18 months agoSeperate the logic for 2f gesturing and left/right click 53/50953/4 factory-spring-4131.B
Tai-Hsu Lin [Sat, 11 May 2013 10:58:29 +0000 (18:58 +0800)]
Seperate the logic for 2f gesturing and left/right click

The function TwoFingersGesturing is used both for deciding
2f gesture type and for deciding whether it is a left or a
right click. This sometimes causes the problem because the
ideal logic for both use cases may not always be the same.
The patch adds an option to the function to distinguish the
two different cases.

BUG=chromium:240044
TEST=pass regression test

|  link/left_click_with_resting_thumb           |      +1.0000       |

Change-Id: I5efb6d0d3a0bcfb867e47eeef781557baae79c13
Reviewed-on: https://gerrit.chromium.org/gerrit/50953
Commit-Queue: Tai-Hsu Lin <sheckylin@chromium.org>
Reviewed-by: Tai-Hsu Lin <sheckylin@chromium.org>
Tested-by: Tai-Hsu Lin <sheckylin@chromium.org>
18 months agogestures.cc: Use persistent HardwareProperties 43/50743/2 factory-4128.B
Andrew de los Reyes [Fri, 10 May 2013 00:16:09 +0000 (17:16 -0700)]
gestures.cc: Use persistent HardwareProperties

BUG=chromium:239678
TEST=No regression test regressions; unittests pass

Change-Id: Ife97534d99747d6ca70cfb1353c1dd6b83df7fae
Reviewed-on: https://gerrit.chromium.org/gerrit/50743
Reviewed-by: Chung-yih Wang <cywang@chromium.org>
Commit-Queue: Andrew de los Reyes <adlr@chromium.org>
Tested-by: Andrew de los Reyes <adlr@chromium.org>
18 months agoRevert "Fix weird touchpad behavior on Cr48" 42/50742/2
Andrew de los Reyes [Fri, 10 May 2013 00:15:13 +0000 (17:15 -0700)]
Revert "Fix weird touchpad behavior on Cr48"

This reverts commit daf12af728625c8b89565896b7e63d8a280ee3d8.

BUG=chromium:239678
TEST=No regression test regressions; unittests pass

Change-Id: Iebaf4373baf7da02939b363474d743cd4e77d1ce
Reviewed-on: https://gerrit.chromium.org/gerrit/50742
Reviewed-by: Chung-yih Wang <cywang@chromium.org>
Commit-Queue: Andrew de los Reyes <adlr@chromium.org>
Tested-by: Andrew de los Reyes <adlr@chromium.org>
18 months agoAdd TrendClassifyingFilterInterpreter 18/48218/12
Tai-Hsu Lin [Tue, 16 Apr 2013 09:34:26 +0000 (17:34 +0800)]
Add TrendClassifyingFilterInterpreter

The patch adds a filter that tries to distinguish between resting
thumbs and fingers that the user intentionally moved. This can
eliminate the un-intended initial cursor movement during the 2f
scroll gesture when one of the finger is in the bottom zone.

BUG=chromium:219126
TEST=pass regression test
Improve the result upon https://gerrit.chromium.org/gerrit/#/c/48362/

|  link/scrolling_with_low_press_fingers_10     |      +0.9807       |
|  link/scrolling_with_low_press_fingers_2      |      +0.9716       |
|  link/scrolling_with_low_press_fingers_3      |      +0.9886       |
|  link/scrolling_with_low_press_fingers_4      |      +0.9920       |
|  link/scrolling_with_low_press_fingers_5      |      +0.9562       |
|  link/scrolling_with_low_press_fingers_6      |      +0.9808       |
|  link/scrolling_with_low_press_fingers_7      |      +0.9657       |
|  link/scrolling_with_low_press_fingers_8      |      +0.9607       |
|  link/scrolling_with_low_press_fingers_9      |      +0.9739       |

Change-Id: I01d1668d63853be1ceb4a58f71c1f74427482f83
Reviewed-on: https://gerrit.chromium.org/gerrit/48218
Commit-Queue: Tai-Hsu Lin <sheckylin@chromium.org>
Tested-by: Tai-Hsu Lin <sheckylin@chromium.org>
Reviewed-by: Andrew de los Reyes <adlr@chromium.org>
18 months agoFix weird touchpad behavior on Cr48 28/50428/2
Chung-yih Wang [Wed, 8 May 2013 05:59:34 +0000 (13:59 +0800)]
Fix weird touchpad behavior on Cr48

HardwareProperties messed up on Cr48 which causes weird behaviors such
as stumble cursor move, right click when tap-to-click intended. The root
cause is incorrect backup of HardwareProperties which points to
somewhere in stack.

BUG=chromium:238778
TEST=on Cr48, cursor move smoothly, no right click when ttc intended

Change-Id: I395862e885b8950ed37fbc1e6ee0c6583974b367
Reviewed-on: https://gerrit.chromium.org/gerrit/50428
Reviewed-by: Joseph Shyh-In Hwang <josephsih@chromium.org>
Commit-Queue: Chung-yih Wang <cywang@chromium.org>
Tested-by: Chung-yih Wang <cywang@chromium.org>
18 months agoIncrease vertical range for 2finger taps 91/49491/2
Charlie Mooney [Mon, 29 Apr 2013 17:49:40 +0000 (10:49 -0700)]
Increase vertical range for 2finger taps

Per a missed click report where two fingers were slightly too vertically
alligned to register as a 2f click this CL increases the range a little
in the Y direction from 30mm to 35mm.

For two fingers to be tapping together the second finger has to fall
within an elipse of the first finger on the pad.  This elipse is wider
than it is tall, so in this report the fingers were skewed vertically
more than horizontally and it interpreted it as a left click instead.

BUG=chromium:236446
TEST=regression tests (no regressions detected)

Change-Id: Icbf8d455d8668c5a95a3dc9fb0ba4dabe14e39d4
Signed-off-by: Charlie Mooney <charliemooney@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/49491
Reviewed-by: Andrew de los Reyes <adlr@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@chromium.org>
18 months agoMultitouchMouseInterpreter: Prevent unintended small scrolls 94/49994/6
Andrew de los Reyes [Fri, 3 May 2013 00:31:17 +0000 (17:31 -0700)]
MultitouchMouseInterpreter: Prevent unintended small scrolls

This CL introduces a new technique to prevent unintended small scrolls
on a multitouch mouse. First, it requires that a finger deviate from
it's initial position before it can cause gestures. Also, when the
mouse is moving significantly, the start positions are reset to their
current positions.

In practice, this does a good job of limiting accidental scrolls.

BUG=chromium:237692
TEST=Manually tested on device; magicmouse/no_scrolls test

Change-Id: I0c4ef55beb77074d832d8e38db39cdc08e904d41
Reviewed-on: https://gerrit.chromium.org/gerrit/49994
Reviewed-by: Andrew de los Reyes <adlr@chromium.org>
Tested-by: Andrew de los Reyes <adlr@chromium.org>
Commit-Queue: Andrew de los Reyes <adlr@chromium.org>

18 months agoActivityLog/Replay: Log/replay mouse relative events. 93/49993/4
Andrew de los Reyes [Fri, 3 May 2013 00:07:17 +0000 (17:07 -0700)]
ActivityLog/Replay: Log/replay mouse relative events.

BUG=chromium:237685
TEST=Saw rel events in log

Change-Id: I6f5564e58ecd82c03d0b633d710b04c9654a6cce
Reviewed-on: https://gerrit.chromium.org/gerrit/49993
Reviewed-by: Andrew de los Reyes <adlr@chromium.org>
Tested-by: Andrew de los Reyes <adlr@chromium.org>
Commit-Queue: Andrew de los Reyes <adlr@chromium.org>

18 months agoUnittestUtils: Fix use of uninitialized memory 94/50094/2
Andrew de los Reyes [Sat, 4 May 2013 01:47:11 +0000 (18:47 -0700)]
UnittestUtils: Fix use of uninitialized memory

mprops_ holds properties, which hold a reference to their
PropRegistry. By resetting prop_reg_ before mprops_, this caused
mprops_ (in the props' dtors) to call into random memory for where the
old prop registry was.

BUG=chromium:238032
TEST=unittest don't have double-free/segfaults anymore.

Change-Id: If80f7cd9eec4a1c5e0d8b2ee1d05fc0a136e4c3f
Reviewed-on: https://gerrit.chromium.org/gerrit/50094
Reviewed-by: Andrew de los Reyes <adlr@chromium.org>
Tested-by: Andrew de los Reyes <adlr@chromium.org>
Commit-Queue: Andrew de los Reyes <adlr@chromium.org>

18 months agoScrollManager: Do not report high pressure change when fast swiping 95/49695/4
Che-Liang Chiou [Wed, 1 May 2013 00:25:02 +0000 (17:25 -0700)]
ScrollManager: Do not report high pressure change when fast swiping

A fast-swiping finger may generate rapidly changing pressure and this
should not be confused with a finger leaving the touchpad; instead, we
consider this finger not stationary and do not report high pressure
changes in such cases.

BUG=chromium:235968
TEST=manual
* Pass regression test generated from the logs of
  https://feedback.corp.google.com/#/Report/812524363?context=ri
* No regressions of regression tests from the logs of
  https://feedback.corp.google.com/#/Report/786686567?context=ri
  https://feedback.corp.google.com/#/Report/786691579?context=ri
* Pass unit tests

Change-Id: I8b545790d78214131d6f35a2842a11b7e0d218bc
Reviewed-on: https://gerrit.chromium.org/gerrit/49695
Tested-by: Che-Liang Chiou <clchiou@chromium.org>
Reviewed-by: Andrew de los Reyes <adlr@chromium.org>
Commit-Queue: Che-Liang Chiou <clchiou@chromium.org>

18 months agogestures: fix conflict between struct and class 24/49724/3
Yunlian Jiang [Wed, 1 May 2013 00:03:51 +0000 (17:03 -0700)]
gestures: fix conflict between struct and class

This fixes the conflict of definition and declaration of struct and class.
This also fixes the warning of "variable length array of non-POD element type"

BUG=chromium:237039
TEST=FEATURES="test" CFLAGS="-clang" emerge-lumpy gestures passes.

Change-Id: I8512793c9c27bfbeb987352a88b18f2635ccc9c0
Reviewed-on: https://gerrit.chromium.org/gerrit/49724
Reviewed-by: Andrew de los Reyes <adlr@chromium.org>
Tested-by: Yunlian Jiang <yunlian@chromium.org>
Commit-Queue: Yunlian Jiang <yunlian@chromium.org>

18 months agobox_filter_interpreter: Add box height 33/49533/2
Che-Liang Chiou [Mon, 29 Apr 2013 21:54:03 +0000 (14:54 -0700)]
box_filter_interpreter: Add box height

So now boxes not only have widths but also have heights, and they could
be rectangular shaped.

BUG=chromium:235971
TEST=make test && ./test # unit tests passed

Change-Id: I242f3003577938e791b8f453141aaf036222a694
Reviewed-on: https://gerrit.chromium.org/gerrit/49533
Tested-by: Che-Liang Chiou <clchiou@chromium.org>
Reviewed-by: Andrew de los Reyes <adlr@chromium.org>
Commit-Queue: Che-Liang Chiou <clchiou@chromium.org>

18 months agonew class: FingerMetrics/Metrics 39/49539/4
Dennis Kempin [Mon, 29 Apr 2013 22:35:41 +0000 (15:35 -0700)]
new class: FingerMetrics/Metrics

Metrics is a class to persistently store information on fingers and
derive common metrics from this information.
Each interpreter can get access to a Metrics class by setting
requires_metrics_ = true, if it cannot get Metrics from the previous
interpreter in the filter chain it will create one.
Note that some interpreter (scaling, lookahead) invalidate existing
metrics information and pass NULL to their next_ to have it create a new
instance if it needs one.
As properties can only be registered once, we require a separate
MetricsProperties class that has to be passed to the filter chain.

BUG=chromium:226699
TEST=check for regressions

Change-Id: I0a3bcd3fdb4b1706f86e3eedcddb726335b103c4
Reviewed-on: https://gerrit.chromium.org/gerrit/49539
Commit-Queue: Dennis Kempin <denniskempin@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@chromium.org>
Tested-by: Dennis Kempin <denniskempin@chromium.org>
18 months agoRefactoring: Initialize instead of SetHwProps/SetGestureConsumer 03/49403/5
Dennis Kempin [Sat, 27 Apr 2013 01:00:54 +0000 (18:00 -0700)]
Refactoring: Initialize instead of SetHwProps/SetGestureConsumer

The initialize method is called after the filter chain has been set up.
This allows easier extension of the filter chain setup process without
having to update every single unittest.
Also to make unittest independent of the way a filter chain is set up
this CL updates all unittests to use TestInterpreterWrapper for creating
the test interpreter.

BUG=chromium:226699
TEST=unit tests pass / touchtests shows no regressions / test by
gmerging onto a device.

Change-Id: Ib8ed36bf08cc65a4f03de3ca9f0ba292f6607273
Reviewed-on: https://gerrit.chromium.org/gerrit/49403
Commit-Queue: Dennis Kempin <denniskempin@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@chromium.org>
Tested-by: Dennis Kempin <denniskempin@chromium.org>
18 months agoScalingFilterInterpreter: Remove zero area fingers 28/49128/6 stabilize-4068.0.B
Che-Liang Chiou [Thu, 25 Apr 2013 00:26:30 +0000 (17:26 -0700)]
ScalingFilterInterpreter: Remove zero area fingers

Sometimes magic mouse reports fingers with zero area, which should be
removed.

BUG=none
TEST=Feed log from feedback report and see that zero area fingers are
     removed

Change-Id: If71ecd8dc2597a412a46cba4dcdf655089336267
Reviewed-on: https://gerrit.chromium.org/gerrit/49128
Tested-by: Che-Liang Chiou <clchiou@chromium.org>
Reviewed-by: Andrew de los Reyes <adlr@chromium.org>
Commit-Queue: Che-Liang Chiou <clchiou@chromium.org>

18 months agoMultitouchMouseInterpreter: No small scroll after click 47/47947/5
Che-Liang Chiou [Thu, 11 Apr 2013 23:32:16 +0000 (16:32 -0700)]
MultitouchMouseInterpreter: No small scroll after click

In general, finger movements are interpreted as scroll, but as clicks
and scrolls on multi-touch mice are both single-finger gesture, we have
to recognize and separate clicks from scrolls, when a user is actually
clicking.

This is how we do for now: We look for characteristic patterns of
clicks, and if we find one, we hold off emitting scroll gesture for a
few time frames to prevent premature scrolls.

The patterns we look for:
* Small finger movements when button is down
* Finger movements after button goes up

BUG=none
TEST=manual, see no small scrolls in 9 out of 10 clicks

Change-Id: I96ee96ab2edfb545d603dad74e029b6331c2e381
Reviewed-on: https://gerrit.chromium.org/gerrit/47947
Commit-Queue: Che-Liang Chiou <clchiou@chromium.org>
Reviewed-by: Che-Liang Chiou <clchiou@chromium.org>
Tested-by: Che-Liang Chiou <clchiou@chromium.org>
19 months agoImmediateInterpreter: In buttons timer callback, check if valid button 80/48580/2
Andrew de los Reyes [Thu, 18 Apr 2013 23:58:14 +0000 (16:58 -0700)]
ImmediateInterpreter: In buttons timer callback, check if valid button

A recent change went in (6864bbd60695b7807984b11e5683e86044071e4a)
that relaxed the checks in the button handling timer callback to allow
for any button. With this CL, we make it be any valid button.

BUG=chromium:231984
TEST=lumpy/2f_scroll_fail

Change-Id: Ieb56d7811cbc1891e55aae17907e876b5eb3d6f7
Reviewed-on: https://gerrit.chromium.org/gerrit/48580
Reviewed-by: Dennis Kempin <denniskempin@chromium.org>
Commit-Queue: Andrew de los Reyes <adlr@chromium.org>
Tested-by: Andrew de los Reyes <adlr@chromium.org>
19 months agonew class: vector and FilteredRange 28/47828/5 stabilize-4008.0.B stabilize-4035.0.B
Dennis Kempin [Thu, 11 Apr 2013 01:55:11 +0000 (18:55 -0700)]
new class: vector and FilteredRange

Adds a std::vector-like class that works on a fixed-size array similar
to gestures::set.
Also adds a FilteredRange class that can be used to create iterable
containers that skip certain elements. This can be used for a helper
method to iterate over all pointing fingers by skipping fingers with
certain flags. In combination with c++11 range-based for loops this
will reduce a lot of repetitive code in the filter interpreter.
Note: This CL changes the compilation standard to GNU C++11.

BUG=chromium:226699
TEST=src/vector_unittest.cc

Change-Id: I4118c92b878923d398513c5d2645da41ab84a395
Reviewed-on: https://gerrit.chromium.org/gerrit/47828
Reviewed-by: Andrew de los Reyes <adlr@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@chromium.org>
Tested-by: Dennis Kempin <denniskempin@chromium.org>
19 months agogestures: allow callback to be set and reset 13/47913/3
Dennis Kempin [Thu, 11 Apr 2013 21:48:42 +0000 (14:48 -0700)]
gestures: allow callback to be set and reset

The previous refactoring expected the callback to be set only once
during init. However when switching VT's the device is turned off by CMT
which will reset the callback to NULL.
This caused assertion failures.

BUG=chromium:230293
TEST=gmerge gestures
switch VT between terminal and X multiple times. check the logs for
assertion failed errors.

Change-Id: I59f3826fd3984273fad8db0b7191956856fe8159
Reviewed-on: https://gerrit.chromium.org/gerrit/47913
Reviewed-by: Andrew de los Reyes <adlr@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@chromium.org>
Tested-by: Dennis Kempin <denniskempin@chromium.org>
19 months agoPalmClassifyingFilterInterpreter: fix false positive 47/47847/2
Chung-yih Wang [Thu, 11 Apr 2013 09:57:46 +0000 (17:57 +0800)]
PalmClassifyingFilterInterpreter: fix false positive

We have false positive case especially for a sensor jump with a
finger merge case where the merged finger doubles its pressure
only for that event. The patch tries to skip UpdatePalmState()
for the state of the number of finger decreases.

BUG=chrome-os-partner:12358
TEST=touchtests snow2.3/scrolling_with_sensor_jump
  and no regression on others

Change-Id: Icd712d1a4264cedaf23dc40b15c0f0c117db31a4
Reviewed-on: https://gerrit.chromium.org/gerrit/47847
Reviewed-by: Andrew de los Reyes <adlr@chromium.org>
Commit-Queue: Chung-yih Wang <cywang@chromium.org>
Tested-by: Chung-yih Wang <cywang@chromium.org>
19 months agoImmediateInterpreter: Don't warn delaying button down on non-left button. 63/47763/3
Andrew de los Reyes [Wed, 10 Apr 2013 19:54:40 +0000 (12:54 -0700)]
ImmediateInterpreter: Don't warn delaying button down on non-left button.

We used to only delay deciding to send a button down if the current
button would be a left click, but now we may wait even on 2-finger
click (right click) in case a third finger arrives. Thus, this old
warning doesn't make any sense anymore.

Also, when the timer does fire and it's time to send a button down,
send the proper one.

BUG=chromium:225994
TEST=Replayed the log and saw no error messages.

Change-Id: I2fe81ea95a83338e285d1d25d6f8d0ba84b8c0da
Reviewed-on: https://gerrit.chromium.org/gerrit/47763
Reviewed-by: Dennis Kempin <denniskempin@chromium.org>
Commit-Queue: Andrew de los Reyes <adlr@chromium.org>
Tested-by: Andrew de los Reyes <adlr@chromium.org>
19 months agoImmediateInterpreter: Fix right when left click intended 34/47634/3
Chung-yih Wang [Tue, 9 Apr 2013 09:21:46 +0000 (17:21 +0800)]
ImmediateInterpreter: Fix right when left click intended

When a moving finger moves back to its starting point and then clicks
the pad, current logic can not detect it is a moving finger as
previous moving indicator is cleared right after the click happened.
This patch reserves previous moving finger set with the variable
'prev_moving_', so it could be used to detect if a finger is 'hot' one.

BUG=chromium:219399
TEST=link/right_when_left_click_intended
CQ-DEPEND=I69d48303cfb8ac30add6ce08480c18bbca1bcc35

Change-Id: I9346cc53a351366fc226ff5fa423e2b885def531
Reviewed-on: https://gerrit.chromium.org/gerrit/47634
Reviewed-by: Andrew de los Reyes <adlr@chromium.org>
Commit-Queue: Chung-yih Wang <cywang@chromium.org>
Tested-by: Chung-yih Wang <cywang@chromium.org>
19 months agoRefactoring: Updated unit tests to work with the new API 08/47508/7
Dennis Kempin [Sat, 6 Apr 2013 01:09:38 +0000 (18:09 -0700)]
Refactoring: Updated unit tests to work with the new API

After refactoring the interpreter api to use a GestureConsumer instead
of returning gestures, the unit tests had to be updated to use the same
API.

BUG=chromium:226699
TEST=make test && ./test
All pass

Change-Id: I4740185889f26afe1c5e2e78b48c9ecb76454719
Reviewed-on: https://gerrit.chromium.org/gerrit/47508
Reviewed-by: Dennis Kempin <denniskempin@chromium.org>
Tested-by: Dennis Kempin <denniskempin@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@chromium.org>

19 months agoRefactoring: Removed Gesture* return value from API 74/47474/7
Dennis Kempin [Fri, 5 Apr 2013 21:33:21 +0000 (14:33 -0700)]
Refactoring: Removed Gesture* return value from API

All filters are nore exclusively using Produce/Consume gesture.
No regressions.

BUG=chromium:226699
TEST=check for regressions

Change-Id: Iae981c90af0e305d6b8dca29c7fcc42100f7aef4
Reviewed-on: https://gerrit.chromium.org/gerrit/47474
Reviewed-by: Dennis Kempin <denniskempin@chromium.org>
Tested-by: Dennis Kempin <denniskempin@chromium.org>
Reviewed-by: Andrew de los Reyes <adlr@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@chromium.org>

19 months agoRefactoring: Updated rest of filter chain to use GestureConsumer 50/47450/10
Dennis Kempin [Fri, 5 Apr 2013 20:24:05 +0000 (13:24 -0700)]
Refactoring: Updated rest of filter chain to use GestureConsumer

The remaining filters have been updated to use the GestureConsumer API.
All filters now return NULL in sync interpret, but still catch possible
sync interpret return values until the API is removed.
Note: The changes to LookAheadFilter introduce slightly lower scores on
3 test cases (score delta < 0.01) due to gestures that are being
produced with the new API that had to be dropped before. This is an
improvment.

BUG=chromium:26699
TEST=check for regressions: touchtests -r before

Change-Id: I4e96a17e8698bdaa35d9c6730c7a1b7f9676a031
Reviewed-on: https://gerrit.chromium.org/gerrit/47450
Reviewed-by: Dennis Kempin <denniskempin@chromium.org>
Tested-by: Dennis Kempin <denniskempin@chromium.org>
Reviewed-by: Andrew de los Reyes <adlr@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@chromium.org>

19 months agoRefactoring: Transition of filter chain to GestureConsumer 83/47383/9
Dennis Kempin [Thu, 4 Apr 2013 23:55:09 +0000 (16:55 -0700)]
Refactoring: Transition of filter chain to GestureConsumer

Updated all filters before the LookAheadFilter to use the
new GestureConsumer API for returning gestures.
Every filter has temporary code to convert a Gesture that might be
returned by SyncInterpret into ConsumeGesture calls.
This code will be removed when the return value of SyncInterPret is
removed from the API.

BUG=chromium:226699
TEST=run touchtests to check for regressions

Change-Id: Iee1d5fe42138adda055a0e128693932f403433cc
Reviewed-on: https://gerrit.chromium.org/gerrit/47383
Reviewed-by: Dennis Kempin <denniskempin@chromium.org>
Tested-by: Dennis Kempin <denniskempin@chromium.org>
Reviewed-by: Andrew de los Reyes <adlr@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@chromium.org>

19 months agoNew interface: GestureConsumer 62/47362/11
Dennis Kempin [Thu, 4 Apr 2013 21:13:16 +0000 (14:13 -0700)]
New interface: GestureConsumer

The gesture consumer interface describes an object that can receive
gestures for processing. All interpreters gain a method ProduceGesture
to send a gesture to a GestureConsumer, and all FilterInterpreters
implement this interface to pass it backwards through the filter chain.
The end point of this backwards chain is a private class
GestureInterpreterConsumer that sends the gesture to the GestureReady
callback.
This CL does not make use of this new way of generating gestures yet,
but only provides the interface and methods to do so.

BUG=chromium:26699
TEST=touchtests should not show any regressions!

Change-Id: I9d9e629d7c8ae37cb4a6d0a9923e5641b1a0998b
Reviewed-on: https://gerrit.chromium.org/gerrit/47362
Tested-by: Dennis Kempin <denniskempin@chromium.org>
Reviewed-by: Andrew de los Reyes <adlr@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@chromium.org>

19 months agogestures: New Assert/AssertReturn macros 61/47361/5
Dennis Kempin [Thu, 4 Apr 2013 20:44:53 +0000 (13:44 -0700)]
gestures: New Assert/AssertReturn macros

These macros are used for checking for programming errors to allow
more compact sanity checking during execution.

BUG=chromium:226699
TEST=none

Change-Id: I6a7a5b94e1d43eed14d4fce651b1b5b0e81ab7a5
Reviewed-on: https://gerrit.chromium.org/gerrit/47361
Reviewed-by: Dennis Kempin <denniskempin@chromium.org>
Tested-by: Dennis Kempin <denniskempin@chromium.org>
Reviewed-by: Andrew de los Reyes <adlr@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@chromium.org>

19 months agoFix clang syntax checking error. 61/47561/2
Yunlian Jiang [Mon, 8 Apr 2013 16:56:04 +0000 (09:56 -0700)]
Fix clang syntax checking error.

Removed unused functions.
Added __attribute__ ((noreturn)) to a non-return function.
BUG=chromium:220278
TEST=USE="chrome_internal" CFLAGS="-clang -print-cmdline"
     CXXFLAGS="-clang -print-cmdline" emerge-x86-alex gestures
     passed.

Change-Id: I9e3b5e7aab8366feeca76dfe77d262aaa21d6aa0
Reviewed-on: https://gerrit.chromium.org/gerrit/47561
Reviewed-by: Andrew de los Reyes <adlr@chromium.org>
Commit-Queue: Yunlian Jiang <yunlian@chromium.org>
Tested-by: Yunlian Jiang <yunlian@chromium.org>
19 months agopalm_classifying_filter: Simple logic to detect fat finger 69/47369/3
Yufeng Shen [Thu, 4 Apr 2013 21:11:12 +0000 (17:11 -0400)]
palm_classifying_filter: Simple logic to detect fat finger

We add a simple logic for reclassifying a previous palm as a fat finger:
if the finger's lifetime max pressure is less than
palm_pressure_ * fat_finger_pressure_ratio_ (default 1.4)  and
the finger's lifetime max width is less than
palm_width_ * fat_finger_width_ratio_ (default 1.3)
and the finger has moved more than fat_finger_min_dist_

This is mainly for making a flat thumb to move the cursor. But we
set the controlling parameters very conservative so that the real
palm detection does not regress.

BUG=chrome-os-partner:13144
TEST=1. Manual test on Link & Snow, no obvious regression in palm
        detection, and flat thumb can move the cursor (to a certain
        degree)
     2. Regression test snow2.3/flat_thumb_move passes.

Change-Id: Idf442807b95730cafb4698c5ee1eded39997e6c7
Reviewed-on: https://gerrit.chromium.org/gerrit/47369
Commit-Queue: Yufeng Shen <miletus@chromium.org>
Reviewed-by: Yufeng Shen <miletus@chromium.org>
Tested-by: Yufeng Shen <miletus@chromium.org>
19 months agoImmediateInterpreter: Disable pinch-zoom 62/47062/3
Andrew de los Reyes [Mon, 1 Apr 2013 22:38:41 +0000 (15:38 -0700)]
ImmediateInterpreter: Disable pinch-zoom

We've found that pinch is catching some normal motion. So for now,
we'll disable it.

BUG=chromium:219398
TEST=link/resting_thumb regression test

Change-Id: I751d790ed1daa4604d795bb3a24cacaa3da78550
Reviewed-on: https://gerrit.chromium.org/gerrit/47062
Reviewed-by: Andrew de los Reyes <adlr@chromium.org>
Tested-by: Andrew de los Reyes <adlr@chromium.org>
Commit-Queue: Andrew de los Reyes <adlr@chromium.org>

19 months agoVariable timeout when waiting for FlingStop 23/47123/8
Charlie Mooney [Mon, 1 Apr 2013 23:46:36 +0000 (16:46 -0700)]
Variable timeout when waiting for FlingStop

We have a report from a user who is flinging and re-flinging very
rapidly, but it gets some stutteriness thrown into it due to a couple of
rouge flingstop events.  The user is having one finger hit the pad
before the other and so the fling stop is getting sent out before it
sees the other finger, realizes its a scroll and stops itself.

This CL adds the functionality to add an extra bit of time onto the
timeout when there are 2 fingers on the pad even if they haven't started
to scroll yet.  This allows us to push the base timeout lower so it
speeds up the response in single-finger cases and still lets the window
be open enough that re-flinging works.

BUG=chromium:2173333
TEST=manual testing on Daisy and regression tests + Unit Tests

Change-Id: I9e45422b67ee8d9e2b10951073284fadc509c112
Signed-off-by: Charlie Mooney <charliemooney@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/47123
Reviewed-by: Andrew de los Reyes <adlr@chromium.org>
19 months agoSplitCorrectingFilterInterpreter: Fix tests for invalid tracking numbers. 65/47265/2
Andrew de los Reyes [Wed, 3 Apr 2013 20:10:30 +0000 (13:10 -0700)]
SplitCorrectingFilterInterpreter: Fix tests for invalid tracking numbers.

This code assumed (falsely) that any negative tracking number was
invalid. Actually, 0xffff (aka -1) is the only invalid number. Because
of this mixup, fingers with a high bit set in their tracking ID
weren't considered for finger merging.

BUG=chromium:218293
TEST=lumpy/thumb_split_* regression tests

Change-Id: I3f633d9b02076cb93c2156180bd6da6154b95e9c
Reviewed-on: https://gerrit.chromium.org/gerrit/47265
Reviewed-by: Dennis Kempin <denniskempin@chromium.org>
Commit-Queue: Andrew de los Reyes <adlr@chromium.org>
Tested-by: Andrew de los Reyes <adlr@chromium.org>
19 months agogestures.cc: Replay all gestures generated in timer callback. 46/46946/2
Andrew de los Reyes [Fri, 29 Mar 2013 23:25:06 +0000 (16:25 -0700)]
gestures.cc: Replay all gestures generated in timer callback.

BUG=chromium:225128
TEST=mario/light_ttc regression test

Change-Id: I3b9b1034fb876aac88ff6dff1fb0f0a1a24fd3a6
Reviewed-on: https://gerrit.chromium.org/gerrit/46946
Reviewed-by: Dennis Kempin <denniskempin@chromium.org>
Commit-Queue: Andrew de los Reyes <adlr@chromium.org>
Tested-by: Andrew de los Reyes <adlr@chromium.org>
19 months agoimmediate_interpreter: lock onto moving finger 49/46949/3
Dennis Kempin [Fri, 29 Mar 2013 23:34:50 +0000 (16:34 -0700)]
immediate_interpreter: lock onto moving finger

instead of using the finger closest to the keyboard, we now lock onto a
finger once it has been identified for movement. This way the same
finger will be used for movement even if it moves below another finger.

BUG=chromium:217820
TEST=lumpy/high_thumb_dragging

Change-Id: I499d81cdccb5c4677182790c58163910a58cd850
Reviewed-on: https://gerrit.chromium.org/gerrit/46949
Reviewed-by: Dennis Kempin <denniskempin@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@chromium.org>
Tested-by: Dennis Kempin <denniskempin@chromium.org>
19 months agoimmediate_interpreter: more reliable 2F right click 13/46913/3
Dennis Kempin [Fri, 29 Mar 2013 21:48:27 +0000 (14:48 -0700)]
immediate_interpreter: more reliable 2F right click

When both fingers touch down at the same time we know that they are
probably not finger and thumb. So we send a right click in this case.

BUG=chromium:217358
TEST=lumpy/left_when_right_click_intended

Change-Id: I1b408d787fe907c40ae869ad393aa29d1b74c27b
Reviewed-on: https://gerrit.chromium.org/gerrit/46913
Reviewed-by: Andrew de los Reyes <adlr@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@chromium.org>
Tested-by: Dennis Kempin <denniskempin@chromium.org>
19 months agoactivity_log: value initialize hwprops_ members 02/46802/2
Gaurav Shah [Thu, 28 Mar 2013 21:19:12 +0000 (14:19 -0700)]
activity_log: value initialize hwprops_ members

Without this, the hwprops_ structure is default initialized (with
an indeterminate initial value), which can cause ActivityLogTest.SimpleTest
to fail. EncodeHardwareProperties() will complain and abort if any of
the hwprops_ doubles are NaN values.

BUG=chromium:211445
TEST=FEATURES=test emerge-x86-generic gestures

Change-Id: I7c7210ce48d255da55337cfb9c9f7d4ea27b1534
Reviewed-on: https://gerrit.chromium.org/gerrit/46802
Reviewed-by: Andrew de los Reyes <adlr@chromium.org>
Commit-Queue: Gaurav Shah <gauravsh@chromium.org>
Tested-by: Gaurav Shah <gauravsh@chromium.org>
19 months agoreplay_log: Support for new .zip report logs 04/46704/2
Andrew de los Reyes [Wed, 27 Mar 2013 22:31:59 +0000 (15:31 -0700)]
replay_log: Support for new .zip report logs

BUG=chromium:224451
TEST=Manually ran tool to fetch logs

Change-Id: Id5319d37e8dd6cefa5e1a69b3e84f27d84c0fa7c
Reviewed-on: https://gerrit.chromium.org/gerrit/46704
Reviewed-by: Dennis Kempin <denniskempin@chromium.org>
Commit-Queue: Andrew de los Reyes <adlr@chromium.org>
Tested-by: Andrew de los Reyes <adlr@chromium.org>
19 months agoclick_wiggle_filter: Don't look at pressure 63/46563/2
Dennis Kempin [Tue, 26 Mar 2013 22:15:27 +0000 (15:15 -0700)]
click_wiggle_filter: Don't look at pressure

We used to look at pressure to only block wiggle from the pressing
finger, however resting fingers are causing wiggling too.
This CL removes the pressure logic.
This change introduces minor regressions as it is influencing the
movement distance in drag situations. This is not noticable in day to
day use.

BUG=chromium:222228
TEST=link/right_click_no_wiggle

Change-Id: I72fcfe27e9b9273942f00ed4e4a90ee04337ce43
Reviewed-on: https://gerrit.chromium.org/gerrit/46563
Reviewed-by: Andrew de los Reyes <adlr@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@chromium.org>
Tested-by: Dennis Kempin <denniskempin@chromium.org>
19 months agoimmediate_interpreter: more solid clicking with thumb 51/46551/3
Dennis Kempin [Tue, 26 Mar 2013 21:22:35 +0000 (14:22 -0700)]
immediate_interpreter: more solid clicking with thumb

clicking with a thumb and a pointing finger now more reliably causes
left clicks instead of right clicks.

BUG=chromium:22837
TEST=link/left_click_with_resting_thumb

Change-Id: I2240a1529ffb108eca0fdfbe4af0681ed1ecdf37
Reviewed-on: https://gerrit.chromium.org/gerrit/46551
Reviewed-by: Andrew de los Reyes <adlr@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@chromium.org>
Tested-by: Dennis Kempin <denniskempin@chromium.org>
19 months agoimmediate_interpreter: use T5R2 logic for semi MT as well 39/46539/4
Dennis Kempin [Tue, 26 Mar 2013 18:42:33 +0000 (11:42 -0700)]
immediate_interpreter: use T5R2 logic for semi MT as well

SemiMT touchpads will use the same logic as T5R2 touchpads and use
simple counting of touches to determine the type of click.
To make things work we need a workaround to not
filter low pressure contacts when the button is pressed. The pressing
fingers are often reported as low (or even 0) pressure contacts.

BUG=chromium:223990
TEST=mario/3_finger_click

Change-Id: I5180cffb4ae3c2ab6e1a13883bc69e082b30843a
Reviewed-on: https://gerrit.chromium.org/gerrit/46539
Reviewed-by: Dennis Kempin <denniskempin@chromium.org>
Tested-by: Dennis Kempin <denniskempin@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@chromium.org>

19 months agoimmediate_interpreter: Try to interpret 2F gestures when 3F failed 74/46474/4
Dennis Kempin [Tue, 26 Mar 2013 01:18:58 +0000 (18:18 -0700)]
immediate_interpreter: Try to interpret 2F gestures when 3F failed

In case we missed a thumb we might end up with 3 fingers when only
2 fingers are gesturing. If the 3F gesture recognition cannot find a
gesture and one of the fingers is in the dampened zone, try to
recognize a 2F gesture.
This fixes a problem with 2F scrolls with resting thumb when the
pressure differences between the fingers are not strong enough.

BUG=chromium:223677
TEST=link/scroll_false_negatives

Change-Id: I44222b36381686ed1cb4cd80b67ab45204a60b91
Reviewed-on: https://gerrit.chromium.org/gerrit/46474
Commit-Queue: Dennis Kempin <denniskempin@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@chromium.org>
Tested-by: Dennis Kempin <denniskempin@chromium.org>
19 months agoimmediate_interpreter: updated pinch logic to make it harder to lock 58/46458/4
Dennis Kempin [Mon, 25 Mar 2013 23:36:03 +0000 (16:36 -0700)]
immediate_interpreter: updated pinch logic to make it harder to lock

In some rare cases the pinch logic is treating resting thumb + pointing
finger as a pinch gesture. This CL makes it harder to enter the gesture
to prevent these issues. However entering pinch-to-zoom is a little
flaky with this logic. As pinch is not used yet, it will have to do for
now.

BUG=chromium:221098
TEST=link/pinch_false_positive_1-2

Change-Id: I0aaaf1e767eb8a5fc9a13667a57090ffadd27043
Reviewed-on: https://gerrit.chromium.org/gerrit/46458
Reviewed-by: Andrew de los Reyes <adlr@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@chromium.org>
Tested-by: Dennis Kempin <denniskempin@chromium.org>
20 months agoMultitouchMouseInterpreter: Scrolling fixes 45/46345/3
Andrew de los Reyes [Sat, 23 Mar 2013 00:54:46 +0000 (17:54 -0700)]
MultitouchMouseInterpreter: Scrolling fixes

Return both types of gesture from this device.

BUG=chromium:218453
TEST=Manually tested on device. Will add regression tests.

Change-Id: I2de16f370cf5a107dc654b7725973fc97a0d1455
Reviewed-on: https://gerrit.chromium.org/gerrit/46345
Commit-Queue: Che-Liang Chiou <clchiou@chromium.org>
Reviewed-by: Che-Liang Chiou <clchiou@chromium.org>
Tested-by: Che-Liang Chiou <clchiou@chromium.org>
20 months agoAccelFilterInterpreter: Ability to scale pointing with mouse curves 16/46316/6
Andrew de los Reyes [Fri, 22 Mar 2013 21:51:35 +0000 (14:51 -0700)]
AccelFilterInterpreter: Ability to scale pointing with mouse curves

This is needed as we bring mouse support (starting with Magic Mouse)
into this codebase.

BUG=chromium:218453
TEST=tested manually; will add regression tests

Change-Id: I80f0309209b95bba5335f3969c71590f3dcee053
Reviewed-on: https://gerrit.chromium.org/gerrit/46316
Commit-Queue: Che-Liang Chiou <clchiou@chromium.org>
Reviewed-by: Che-Liang Chiou <clchiou@chromium.org>
Tested-by: Che-Liang Chiou <clchiou@chromium.org>
20 months agoAccelFilterInterpreter: Distinguish sensitivities of multitouch mice 14/46214/5
Che-Liang Chiou [Fri, 22 Mar 2013 01:59:42 +0000 (18:59 -0700)]
AccelFilterInterpreter: Distinguish sensitivities of multitouch mice

For multitouch mice, they have two sensitivities: One for pointer and
one for scroll.  (For touchpads, these two are the same.)

BUG=chromium-os:36322
TEST=Connect Magic Mouse, manually set 'Touchpad Speed' and 'Mouse
     Speed' on chrome://settings, and make sure it works.

Change-Id: I322af697cea0114b686e58c047b62b996e57f760
Reviewed-on: https://gerrit.chromium.org/gerrit/46214
Commit-Queue: Che-Liang Chiou <clchiou@chromium.org>
Reviewed-by: Che-Liang Chiou <clchiou@chromium.org>
Tested-by: Che-Liang Chiou <clchiou@chromium.org>
20 months agorefactoring: Allow multiple gestures to be returned on every sync 27/46327/6
Dennis Kempin [Fri, 22 Mar 2013 23:37:06 +0000 (16:37 -0700)]
refactoring: Allow multiple gestures to be returned on every sync

The Gesture structure is updated to have a next pointer to build a list
of gestures. All filters have been updated to provess all gestures in
the chain. This change introduces an alternative to CombineGestures
called AppendGestures, which appends a gesture instead of discarding the
lowest priority one.
This behavior is tested by adjusting the fling stop filter to append
gestures instead of combining them. This allows it to send fling stops
ahead of button events.

BUG=chromium:219870
TEST=link/fling_stop_order
also as this is a refactoring make sure to check for regressions.

Change-Id: I106816d7f8601d5b08bbda4d3247e8bee5236ca6
Reviewed-on: https://gerrit.chromium.org/gerrit/46327
Commit-Queue: Che-Liang Chiou <clchiou@chromium.org>
Reviewed-by: Che-Liang Chiou <clchiou@chromium.org>
Tested-by: Che-Liang Chiou <clchiou@chromium.org>
20 months agoSlow down scroll acceleration for high-sensitivity 83/45783/2
Charlie Mooney [Mon, 18 Mar 2013 21:20:25 +0000 (14:20 -0700)]
Slow down scroll acceleration for high-sensitivity

If you turn up the pointer sensitivity, the scrolling speed would go
pretty crazy, making it almost unusable because it would just fling all
the way to the bottom of whatever page you were using no matter what.
The idea that the scroll needs to go faster for people who turn up their
sensitivity may be a mistake entirely, but for now this just limits the
speedup a lot.

The default sensitivity (3) is untouched, but the speedup when you set
it to 4 or 5 has been reduced.

BUG=chromium-os:38142
TEST=trybots, gmerged onto a Link and manually tested and it feels far
less ridiculous than before

Change-Id: Ifa4c0156d2866e194609b90c13ad82fdf7bfd140
Signed-off-by: Charlie Mooney <charliemooney@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/45783
Reviewed-by: Andrew de los Reyes <adlr@chromium.org>
20 months agoimmediate_interpreter: Enable 3F click per default 06/45906/4
Dennis Kempin [Tue, 19 Mar 2013 22:56:04 +0000 (15:56 -0700)]
immediate_interpreter: Enable 3F click per default

It's working well enough now.

BUG=chromium:221468
TEST=none

Change-Id: Ie4377e47cfff1dfd4584ffa8627ad9e30688567d
Reviewed-on: https://gerrit.chromium.org/gerrit/45906
Commit-Queue: Dennis Kempin <denniskempin@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@chromium.org>
Tested-by: Dennis Kempin <denniskempin@chromium.org>
20 months agoimmediate_interpreter: Button Timeout logic updated 03/45903/4
Dennis Kempin [Tue, 19 Mar 2013 22:25:45 +0000 (15:25 -0700)]
immediate_interpreter: Button Timeout logic updated

To make the button click detection more responsive the timeout has been
split into two different timeouts. First a timeout after the button down
to wait for fingers to arrive (which is a system caused delay) and for
every change in fingers another timeout to wait for more fingers to arrive
(which is a user caused delay).
This makes button clicks more responsive and solves the issue of
temporary finger merging, as we wait after each change of fingers.

BUG=chromium:196321
TEST=link/button_click_merge_issue

Change-Id: I74aee12742d085fa61bbed4369507b150187983a
Reviewed-on: https://gerrit.chromium.org/gerrit/45903
Commit-Queue: Dennis Kempin <denniskempin@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@chromium.org>
Tested-by: Dennis Kempin <denniskempin@chromium.org>
20 months agoMultitouchMouseInterpreter: Reuse scroll and fling logic 63/45363/5
Che-Liang Chiou [Wed, 13 Mar 2013 23:02:54 +0000 (16:02 -0700)]
MultitouchMouseInterpreter: Reuse scroll and fling logic

Let MultitouchMouseInterpreter reuse the scroll and fling logic of
ImmediateInterpreter.

BUG=chromium-os:36322
TEST=All unit tests are passed, and we may fling Magic Mouse on Snow
     NOTE: You need to set 'Fling Buffer Suppress Zero Length Scrolls'
     to 1 to test Magic Mouse

Change-Id: I087a8192a5c80225b96e5ac2efdf7b5e89b81ace
Reviewed-on: https://gerrit.chromium.org/gerrit/45363
Reviewed-by: Che-Liang Chiou <clchiou@chromium.org>
Tested-by: Che-Liang Chiou <clchiou@chromium.org>
Commit-Queue: Che-Liang Chiou <clchiou@chromium.org>

20 months agoImmediateInterpreter: Factor out scroll and fling logic 27/45327/6
Che-Liang Chiou [Wed, 13 Mar 2013 18:41:38 +0000 (11:41 -0700)]
ImmediateInterpreter: Factor out scroll and fling logic

Factor out the scroll and fling logic from ImmediateInterpreter as we
are trying to reuse them in MultitouchMouseInterpreter.

We add a manager class that are "basically" stateless, meaning that it
does not have "real" mutable states, as all its members are properties.
(The only exception is prev_result_high_pressure_change_.)

We also add a HardwareStateBuffer class, which acts as a common data
object that is passed from ImmediateInterpreter to the manager class.

BUG=chromium-os:36322
TEST=pass all unit tests

Change-Id: I444bbdfa6d290f9f5e386cf8b2eccb18aab2722b
Reviewed-on: https://gerrit.chromium.org/gerrit/45327
Reviewed-by: Che-Liang Chiou <clchiou@chromium.org>
Tested-by: Che-Liang Chiou <clchiou@chromium.org>
Commit-Queue: Che-Liang Chiou <clchiou@chromium.org>

20 months agoimmediate_interpreter: Reduced TTC log verbosity 46/45346/6 stabilize-3881.0.B
Dennis Kempin [Wed, 13 Mar 2013 21:26:57 +0000 (14:26 -0700)]
immediate_interpreter: Reduced TTC log verbosity

The Tap-To-Click log verbosity is very high. Barely any other part of
immediate_interpreter is printing log messages except tap to click.
Even when taps are not used, the code is sending multiple log messages
every update. This CL reduces the log output to print only relevant
messages when things have changed or the TTC state machine is leaving
the idle state. This reduces the amont of log messages by a factor of
approx 30 which makes it easier to find relevant log messages for
debugging.

BUG=chromium:190502
TEST=run touchtests with -vgl to check the updated gestures log

Change-Id: I9d70e4bd730941cfebb4b2c510aa179b462e4829
Reviewed-on: https://gerrit.chromium.org/gerrit/45346
Reviewed-by: Dennis Kempin <denniskempin@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@chromium.org>
Tested-by: Dennis Kempin <denniskempin@chromium.org>
20 months agoImmediateInterpreter: New logic for EvaluateButtonType 52/45152/9
Dennis Kempin [Mon, 11 Mar 2013 23:44:08 +0000 (16:44 -0700)]
ImmediateInterpreter: New logic for EvaluateButtonType

Implemented a new logic in order to support 3 finger = middle clicks
as well as more variations of left and right clicks.
The new logic is largely based on determining the button type by looking
at wether the fingers recently touched down, have been on the touchpad
for a while but not moved or have been moved.
For unclear cases it falls back to a location based separation of the
fingers to determine if they belong to the same group of fingers.

This CL does not introduce any regressions in the test suite, but as a
side-effect improves the scoring of some existing button tests.

BUG=chromium-os:39368
TEST=added test cases to touchtests:
link/button_middle_click_variations
link/button_right_click_variations

Change-Id: I75eef2ddaf5427c46d396188aafae329340f5166
Reviewed-on: https://gerrit.chromium.org/gerrit/45152
Reviewed-by: Andrew de los Reyes <adlr@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@chromium.org>
Tested-by: Dennis Kempin <denniskempin@chromium.org>
20 months agoLoggingFilterInterpreter: Add 'Integrated Touchpad' property. 00/45800/2
Andrew de los Reyes [Mon, 18 Mar 2013 21:07:13 +0000 (14:07 -0700)]
LoggingFilterInterpreter: Add 'Integrated Touchpad' property.

We don't have a place to put properties that aren't used by our code,
so I've stuck this property in the logger, which is always used.

This property is used by X (in another patch) to see if a touchpad is
integrated, as that can affect pointer motion on a rotated display.

BUG=chromium:196434
TEST=Tested manually on Link

Change-Id: If4d90d46bc9e972dab38aeae28777d8e890540dc
Reviewed-on: https://gerrit.chromium.org/gerrit/45800
Reviewed-by: Dennis Kempin <denniskempin@chromium.org>
Commit-Queue: Andrew de los Reyes <adlr@chromium.org>
Tested-by: Andrew de los Reyes <adlr@chromium.org>
20 months agoGestures: Update Fling Buffer Depth to 10 44/45744/4
Charlie Mooney [Mon, 18 Mar 2013 15:17:13 +0000 (08:17 -0700)]
Gestures: Update Fling Buffer Depth to 10

We ran another Salsa experiment to see if increasing the fling buffer
depth even further would make people even happier with it.  It looks
like they are.  The results aren't as stark as last time but with a
p value around 0.25 we can be pretty sure that a depth of 10 is better
than 7, and even in the unlikely case that it's not most people who
don't think it's better can't tell the difference between them.

Additionally, the scroll buffer needs to now track 20 events since Mario
requires a double-long buffer.  For it to be able to have the same
performance, it's fling depth will be set to 20 in it's custom config,
but if the buffer doesn't even hold 20 values it won't work.  Having
this larger discrepancy exposed a bug in the way scroll speed was
computed which was fixed.  It assumed the entire buffer was used which
is not always the case.

Basically this should just change the default depth from 7 to 10,
slightly increasing the consistency of flings on ChromeOS.

BUG=chromium:216790
TEST=Salsa experiment showed that this was prefferable to the current
default value, regression tests showed that it didn't break anything.  A
pair of tests that checked the fling distance did have to be updated
though to reflect the new fling config.
CQ-DEPEND:I0e50560fa8f3ba2374a20d123902588e924b3640
I87a4eb4e42945be68edfa511c4098230eabe004f

Change-Id: Ib985b987d65325140b088a844ef5f8c0ad2b88f7
Signed-off-by: Charlie Mooney <charliemooney@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/45744
Reviewed-by: Andrew de los Reyes <adlr@chromium.org>
20 months agofix incorrect pointer references 18/44618/2 factory-spring-3842.B firmware-spring-3824.4.B firmware-spring-3824.55.B firmware-spring-3824.84.B firmware-spring-3824.B firmware-spring-3833.B
Chung-yih Wang [Tue, 5 Mar 2013 06:14:56 +0000 (14:14 +0800)]
fix incorrect pointer references

Incorrect pointer usage may crash system.

BUG=chromium-os:37272
TEST=make no difference
Change-Id: I999383f3505510db4762ff7a090bff348c898f80
Reviewed-on: https://gerrit.chromium.org/gerrit/44618
Reviewed-by: Andrew de los Reyes <adlr@chromium.org>
Commit-Queue: Chung-yih Wang <cywang@chromium.org>
Tested-by: Chung-yih Wang <cywang@chromium.org>
20 months agoRemove Salsa from the gestures project 84/44584/2
Charlie Mooney [Mon, 4 Mar 2013 23:59:33 +0000 (15:59 -0800)]
Remove Salsa from the gestures project

Salsa has its own repo now in platform/salsa so it shouldn't be here
in gestures.  This CL removes the salsa files from this repo, because
they're all copied over to their new home.

TEST=emerged gestures, it still made correctly
BUG=chromium-os:39493

Change-Id: I9d30e467f1244b644258294bc2d2e532b72212fb
Signed-off-by: Charlie Mooney <charliemooney@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/44584
Reviewed-by: Andrew de los Reyes <adlr@chromium.org>
20 months agoRevert "ImmediateInterpreter: Handle TTC w/ possible palms present" 26/44526/2
Andrew de los Reyes [Mon, 4 Mar 2013 17:05:24 +0000 (09:05 -0800)]
Revert "ImmediateInterpreter: Handle TTC w/ possible palms present"

This reverts commit e6726e872fc08b6c2f8afd49929f28d0d05372d0

Looks like this has a crasher in it

Change-Id: Idf44cbcefce3bc9d210c0bec4bfc03dee7a806d4
Reviewed-on: https://gerrit.chromium.org/gerrit/44526
Commit-Queue: Andrew de los Reyes <adlr@chromium.org>
Reviewed-by: Andrew de los Reyes <adlr@chromium.org>
Tested-by: Andrew de los Reyes <adlr@chromium.org>
20 months agoPalmClassifyingInterpreter: Note why a contact is not a palm, avoid bad moves. 34/44234/3
Andrew de los Reyes [Wed, 27 Feb 2013 19:54:13 +0000 (11:54 -0800)]
PalmClassifyingInterpreter: Note why a contact is not a palm, avoid bad moves.

With this change, when a contact is declared to not be a palm, we
record why that is. Also, if a contact was marked non-palm because
another finger was close by, but then that finger leaves, we suppress
further motion from that palm until it moves significantly, which is
the same behavior we would have had if the other finger had never
shown up.

This needed because we have cases where a real palm is close to
another finger (since we allow up to 50mm of separation, at the time
of writing), and if a finger shows up, the palm can get classified as
non-palm and then cause movement.

BUG=chromium-os:39231
TEST=link/ttc_with_palm regression test

Change-Id: Idd60aef6d26b5410730c772db42886cb6af9f14e
Reviewed-on: https://gerrit.chromium.org/gerrit/44234
Commit-Queue: Andrew de los Reyes <adlr@chromium.org>
Reviewed-by: Andrew de los Reyes <adlr@chromium.org>
Tested-by: Andrew de los Reyes <adlr@chromium.org>
20 months agoImmediateInterpreter: Only set last_movement_timestamp_ on real movement. 33/44233/3
Andrew de los Reyes [Wed, 27 Feb 2013 19:51:52 +0000 (11:51 -0800)]
ImmediateInterpreter: Only set last_movement_timestamp_ on real movement.

Historically we only looked for the currently set gesture mode, not
actual movement. This broke a tap-to-click case where a stationary
palm was keeping the gesture type as movement, but no movement occured
while another finger did a tap click.

BUG=chromium-os:39231
TEST=link/ttc_with_palm regression test

Change-Id: I9710c6762b283f6e88d3167b1aeadc995328712a
Reviewed-on: https://gerrit.chromium.org/gerrit/44233
Commit-Queue: Andrew de los Reyes <adlr@chromium.org>
Reviewed-by: Andrew de los Reyes <adlr@chromium.org>
Tested-by: Andrew de los Reyes <adlr@chromium.org>
20 months agoImmediateInterpreter test SemiMtNoPinchTest: Handle NULL gesture. 32/44232/3
Andrew de los Reyes [Wed, 27 Feb 2013 21:21:27 +0000 (13:21 -0800)]
ImmediateInterpreter test SemiMtNoPinchTest: Handle NULL gesture.

BUG=chromium-os:39320
TEST=This is the unittest

Change-Id: I5438d47605322402602932e98b56324973cde2e2
Reviewed-on: https://gerrit.chromium.org/gerrit/44232
Commit-Queue: Andrew de los Reyes <adlr@chromium.org>
Reviewed-by: Andrew de los Reyes <adlr@chromium.org>
Tested-by: Andrew de los Reyes <adlr@chromium.org>
20 months agoImmediateInterpreter unittest: Relax AvoidAccidentalPinchTest 31/44231/3
Andrew de los Reyes [Wed, 27 Feb 2013 21:37:27 +0000 (13:37 -0800)]
ImmediateInterpreter unittest: Relax AvoidAccidentalPinchTest

We were requiring Move gestures, even when such moves would have been
0-magnitude. Releax our requirements for these instances.

BUG=chromium-os:39319
TEST=This is the test fix

Change-Id: Icb71dc78d0287a00da258337c04cf4d65cdb9c01
Reviewed-on: https://gerrit.chromium.org/gerrit/44231
Commit-Queue: Andrew de los Reyes <adlr@chromium.org>
Reviewed-by: Andrew de los Reyes <adlr@chromium.org>
Tested-by: Andrew de los Reyes <adlr@chromium.org>
20 months agoImmediateInterpreter: Favor non-possible-palm for pointing 30/44230/3
Andrew de los Reyes [Wed, 27 Feb 2013 21:33:20 +0000 (13:33 -0800)]
ImmediateInterpreter: Favor non-possible-palm for pointing

During other cleanup, I realized unittest AmbiguousPalmCoScrollTest
was broken.

BUG=chromium-os:39318
TEST=This is the test fix

Change-Id: Ibc7cdb74eedba5ef4d335758593479a4104022fc
Reviewed-on: https://gerrit.chromium.org/gerrit/44230
Commit-Queue: Andrew de los Reyes <adlr@chromium.org>
Reviewed-by: Andrew de los Reyes <adlr@chromium.org>
Tested-by: Andrew de los Reyes <adlr@chromium.org>
20 months agoImmediateInterpreter: Handle TTC w/ possible palms present 29/44229/3
Andrew de los Reyes [Wed, 27 Feb 2013 19:48:53 +0000 (11:48 -0800)]
ImmediateInterpreter: Handle TTC w/ possible palms present

When a possible palm arrives at the same time as a tapping finger,
then the finger departs but the palm stays, we historically would have
considered the possible palm as tapping and waited for a possible
two-finger tap. That's fine if the possible palm is not a palm, but
when it is, this logic breaks.

With this change, we can timeout after the one finger leaves and do a
left click with that finger.

BUG=chromium-os:39231
TEST=link/ttc_with_palm regression test

Change-Id: Ice78c556cba31ed70db46ab126d1a1a048b75dc9
Reviewed-on: https://gerrit.chromium.org/gerrit/44229
Commit-Queue: Andrew de los Reyes <adlr@chromium.org>
Reviewed-by: Andrew de los Reyes <adlr@chromium.org>
Tested-by: Andrew de los Reyes <adlr@chromium.org>
20 months agoMultitouchMouseInterpreter: Implement basic gestures 71/44071/5
Che-Liang Chiou [Tue, 26 Feb 2013 19:26:39 +0000 (11:26 -0800)]
MultitouchMouseInterpreter: Implement basic gestures

The basic gestures include mouse movement, button clicking, and single
finger scrolling.

A problem we found for multi-touch mice is that when you are clicking,
your finger might slide a little bit on the surface, which is then
interpreted as a single finger scrolling.  To alleviate this problem,
ClickWiggleFilterInterpreter and BoxFilterInterpreter are added to the
chain of filters.

BUG=chromium-os:36322
TEST=Test Magic Mouse: mouse movement, button clicking, single finger
     scrolling

Change-Id: Ief71a5a3b54896f68e2d078ca366171113755f40
Reviewed-on: https://gerrit.chromium.org/gerrit/44071
Tested-by: Che-Liang Chiou <clchiou@chromium.org>
Reviewed-by: Andrew de los Reyes <adlr@chromium.org>
Commit-Queue: Che-Liang Chiou <clchiou@chromium.org>

20 months agoGestures: Improve fling velocity consistency 05/44205/2
Charlie Mooney [Wed, 27 Feb 2013 20:36:55 +0000 (12:36 -0800)]
Gestures: Improve fling velocity consistency

The fling velocity calculation is quite inconsistent.  When the Touchbot
was programmed to reproduce the same exact fling, the results were all
over the place.

This increases the fling buffer depth from 3 to 7, so now it uses the
last 7 scroll events instead of 3 to estimate the fling trajectory.  The
robot produced much more clumped results with this, and a Salsa
experiment was preformed to compare 3, 5, 7, and 15 to see which people
preferred.  The support for 7 over 3 was overwhelming, 15 got a few bad
reviews and it pretty extreme, so 7 is a safe and effective compromise.

raw results      3   5   7  15
------------------------------
participant #1   3   2   0  1
participant #2   3   2   1  0
participant #3   3   0   0  2
participant #4   1   3   0  1
participant #5   3   2   1  0
participant #6   2   1   0  3

Sign-test P Values (a low number indicates that the treatment in that
row is likely better than the treatment in its column)
       5            3          15         7
5               0.109375    0.890625    1.0
3   0.984375                0.96875     1.0
15  0.34375     0.1875                  0.890625
7   0.03125     0.015625    0.34375

BUG=chromium-os:39302
TEST=Salsa experiment and robot tests

Change-Id: I5f876b862e5118647c4e75c1b8480f6ad23cd57e
Signed-off-by: Charlie Mooney <charliemooney@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/44205
Reviewed-by: Andrew de los Reyes <adlr@chromium.org>
20 months agoImmediateInterpreter: Merging fingers cancel tapping. 28/44228/2
Andrew de los Reyes [Wed, 27 Feb 2013 19:47:34 +0000 (11:47 -0800)]
ImmediateInterpreter: Merging fingers cancel tapping.

During other fixes, merged fingers on Link started causing tap
clicks. This change prohibits them.

BUG=chromium-os:39314
TEST=link/finger_merge* regression tests

Change-Id: I652401b2427381eda6999f1b941a3e787d18cb98
Reviewed-on: https://gerrit.chromium.org/gerrit/44228
Reviewed-by: Dennis Kempin <denniskempin@chromium.org>
Tested-by: Andrew de los Reyes <adlr@chromium.org>
Commit-Queue: Andrew de los Reyes <adlr@chromium.org>