[automerger] Optimise the hit test algorithm am: 71ecf5bd am: 42eaa8f9 am: a72cb45f am: f5d69aa7 skipped: 94bc67f0 Change-Id: Ieefc1b15d0d1905d16b85df9117e4ce208c342d2