diff options
author | Jeff Brown <jeffbrown@google.com> | 2010-06-16 01:53:36 -0700 |
---|---|---|
committer | Jeff Brown <jeffbrown@google.com> | 2010-06-17 13:27:16 -0700 |
commit | f4a4ec2063dfd28e04bbfe712f67acee4bdc8e37 (patch) | |
tree | 9d52c784ebd68acfc44a2cdb06d7cf057bba2c91 /include/utils | |
parent | e85dafb4d625cce230695127c39636a40932b313 (diff) | |
download | frameworks_native-f4a4ec2063dfd28e04bbfe712f67acee4bdc8e37.zip frameworks_native-f4a4ec2063dfd28e04bbfe712f67acee4bdc8e37.tar.gz frameworks_native-f4a4ec2063dfd28e04bbfe712f67acee4bdc8e37.tar.bz2 |
Even more native input dispatch work in progress.
Added more tests.
Fixed a regression in Vector.
Fixed bugs in pointer tracking.
Fixed a starvation issue in PollLoop when setting or removing callbacks.
Fixed a couple of policy nits.
Modified the internal representation of MotionEvent to be more
efficient and more consistent.
Added code to skip/cancel virtual key processing when there are multiple
pointers down. This helps to better disambiguate virtual key presses
from stray touches (such as cheek presses).
Change-Id: I2a7d2cce0195afb9125b23378baa94fd2fc6671c
Diffstat (limited to 'include/utils')
-rw-r--r-- | include/utils/PollLoop.h | 4 | ||||
-rw-r--r-- | include/utils/Vector.h | 14 | ||||
-rw-r--r-- | include/utils/VectorImpl.h | 10 |
3 files changed, 16 insertions, 12 deletions
diff --git a/include/utils/PollLoop.h b/include/utils/PollLoop.h index c9d951f..a95fb17 100644 --- a/include/utils/PollLoop.h +++ b/include/utils/PollLoop.h @@ -114,8 +114,10 @@ private: }; Mutex mLock; - Condition mAwake; bool mPolling; + uint32_t mWaiters; + Condition mAwake; + Condition mResume; int mWakeReadPipeFd; int mWakeWritePipeFd; diff --git a/include/utils/Vector.h b/include/utils/Vector.h index d40ae16..ec851bd 100644 --- a/include/utils/Vector.h +++ b/include/utils/Vector.h @@ -115,10 +115,10 @@ public: //! insert an array at a given index - ssize_t insertArrayAt(const TYPE* array, size_t index, size_t numItems); + ssize_t insertArrayAt(const TYPE* array, size_t index, size_t length); //! append an array at the end of this vector - ssize_t appendArray(const TYPE* array, size_t numItems); + ssize_t appendArray(const TYPE* array, size_t length); /*! * add/insert/replace items @@ -126,7 +126,7 @@ public: //! insert one or several items initialized with their default constructor inline ssize_t insertAt(size_t index, size_t numItems = 1); - //! insert on onr several items initialized from a prototype item + //! insert one or several items initialized from a prototype item ssize_t insertAt(const TYPE& prototype_item, size_t index, size_t numItems = 1); //! pop the top of the stack (removes the last element). No-op if the stack's empty inline void pop(); @@ -265,13 +265,13 @@ ssize_t Vector<TYPE>::appendVector(const Vector<TYPE>& vector) { } template<class TYPE> inline -ssize_t Vector<TYPE>::insertArrayAt(const TYPE* array, size_t index, size_t numItems) { - return VectorImpl::insertAt(array, index, numItems); +ssize_t Vector<TYPE>::insertArrayAt(const TYPE* array, size_t index, size_t length) { + return VectorImpl::insertArrayAt(array, index, length); } template<class TYPE> inline -ssize_t Vector<TYPE>::appendArray(const TYPE* array, size_t numItems) { - return VectorImpl::add(array, numItems); +ssize_t Vector<TYPE>::appendArray(const TYPE* array, size_t length) { + return VectorImpl::appendArray(array, length); } template<class TYPE> inline diff --git a/include/utils/VectorImpl.h b/include/utils/VectorImpl.h index 46a7bc2..c4ec2ff 100644 --- a/include/utils/VectorImpl.h +++ b/include/utils/VectorImpl.h @@ -65,9 +65,11 @@ public: size_t capacity() const; ssize_t setCapacity(size_t size); - /*! append/insert another vector */ + /*! append/insert another vector or array */ ssize_t insertVectorAt(const VectorImpl& vector, size_t index); ssize_t appendVector(const VectorImpl& vector); + ssize_t insertArrayAt(const void* array, size_t index, size_t length); + ssize_t appendArray(const void* array, size_t length); /*! add/insert/replace items */ ssize_t insertAt(size_t where, size_t numItems = 1); @@ -76,7 +78,7 @@ public: void push(); void push(const void* item); ssize_t add(); - ssize_t add(const void* item, size_t numItems = 1); + ssize_t add(const void* item); ssize_t replaceAt(size_t index); ssize_t replaceAt(const void* item, size_t index); @@ -184,8 +186,8 @@ private: void push(const void* item); ssize_t insertVectorAt(const VectorImpl& vector, size_t index); ssize_t appendVector(const VectorImpl& vector); - ssize_t insertArrayAt(const void* array, size_t index, size_t numItems); - ssize_t appendArray(const void* array, size_t numItems); + ssize_t insertArrayAt(const void* array, size_t index, size_t length); + ssize_t appendArray(const void* array, size_t length); ssize_t insertAt(size_t where, size_t numItems = 1); ssize_t insertAt(const void* item, size_t where, size_t numItems = 1); ssize_t replaceAt(size_t index); |