summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
author Jeff Brown <jeffbrown@android.com> 2011-05-25 14:46:37 -0700
committer Android Git Automerger <android-git-automerger@android.com> 2011-05-25 14:46:37 -0700
commitfbc67977aecfd94e8923e8eca3b859cd431c94b8 (patch)
treeb14b8ac14d6d645d831768f05b9355cd1f60af89 /libs
parente79397df614d2a489906c44df214a4ea5c49c043 (diff)
parentd5358874e2cc90be3d7d3370ef7342c96c212451 (diff)
am d5358874: am 5ced76a1: Coalesce input events that arrive faster than 333Hz. (DO NOT MERGE)
* commit 'd5358874e2cc90be3d7d3370ef7342c96c212451': Coalesce input events that arrive faster than 333Hz. (DO NOT MERGE)
Diffstat (limited to 'libs')
-rw-r--r--libs/ui/InputTransport.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/libs/ui/InputTransport.cpp b/libs/ui/InputTransport.cpp
index 9d1b8b94ecc2..93d0d1f8a1bc 100644
--- a/libs/ui/InputTransport.cpp
+++ b/libs/ui/InputTransport.cpp
@@ -27,8 +27,14 @@
namespace android {
+#define ROUND_UP(value, boundary) (((value) + (boundary) - 1) & ~((boundary) - 1))
+#define MIN_HISTORY_DEPTH 20
+
// Must be at least sizeof(InputMessage) + sufficient space for pointer data
-static const int DEFAULT_MESSAGE_BUFFER_SIZE = 16384;
+static const int DEFAULT_MESSAGE_BUFFER_SIZE = ROUND_UP(
+ sizeof(InputMessage) + MIN_HISTORY_DEPTH
+ * (sizeof(InputMessage::SampleData) + MAX_POINTERS * sizeof(PointerCoords)),
+ 4096);
// Signal sent by the producer to the consumer to inform it that a new message is
// available to be consumed in the shared memory buffer.