summaryrefslogtreecommitdiffstats
path: root/include/utils
diff options
context:
space:
mode:
authorJeff Brown <jeffbrown@google.com>2011-03-09 17:39:48 -0800
committerJeff Brown <jeffbrown@google.com>2011-03-14 14:12:03 -0700
commitace13b17866dc9136aeecf6dfaf7077f37434469 (patch)
tree0ec5d01ef83b4d5148525f5befa28ca026b294c7 /include/utils
parentfd10d5cf56e5b1ba7692400e4fe4ae26b61f3285 (diff)
downloadframeworks_base-ace13b17866dc9136aeecf6dfaf7077f37434469.zip
frameworks_base-ace13b17866dc9136aeecf6dfaf7077f37434469.tar.gz
frameworks_base-ace13b17866dc9136aeecf6dfaf7077f37434469.tar.bz2
Use touch pad gestures to manipulate the pointer.
1. Single finger tap performs a click. 2. Single finger movement moves the pointer (hovers). 3. Button press plus movement performs click or drag. While dragging, the pointer follows the finger that is moving fastest. This is important if there are additional fingers down on the touch pad for the purpose of applying force to an integrated button underneath. 4. Two fingers near each other moving in the same direction are coalesced as a swipe gesture under the pointer. 5. Two or more fingers moving in arbitrary directions are transformed into touches in the vicinity of the pointer. This makes scale/zoom and rotate gestures possible. Added a native VelocityTracker implementation to enable intelligent switching of the active pointer during drags. Change-Id: I5ada57e7f2bdb9b0a791843eb354a8c706b365dc
Diffstat (limited to 'include/utils')
-rw-r--r--include/utils/BitSet.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/utils/BitSet.h b/include/utils/BitSet.h
index f5dbcd9..f03825a 100644
--- a/include/utils/BitSet.h
+++ b/include/utils/BitSet.h
@@ -61,6 +61,12 @@ struct BitSet32 {
// Result is undefined if all bits are marked.
inline uint32_t firstUnmarkedBit() const { return __builtin_clz(~ value); }
+ // Gets the index of the specified bit in the set, which is the number of
+ // marked bits that appear before the specified bit.
+ inline uint32_t getIndexOfBit(uint32_t n) const {
+ return __builtin_popcount(value & ~(0xffffffffUL >> n));
+ }
+
inline bool operator== (const BitSet32& other) const { return value == other.value; }
inline bool operator!= (const BitSet32& other) const { return value != other.value; }
};