Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(806)

Unified Diff: ui/base/touch/touch_factory.h

Issue 7927001: touchui: Convert XI2 MT tracking id to slot id for gesture recognizer (Closed) Base URL: nhu@powerbuilder.sh.intel.com:/home/www-data/git-repos/chromium/chromium.git@trunk
Patch Set: rebase to trunk Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ui/base/touch/touch_factory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/touch/touch_factory.h
diff --git a/ui/base/touch/touch_factory.h b/ui/base/touch/touch_factory.h
index a4617384b798811325742e43cc46718860a8f47c..84db34e92a0ee2eac9fc7323ce7cd68ecc538c37 100644
--- a/ui/base/touch/touch_factory.h
+++ b/ui/base/touch/touch_factory.h
@@ -10,6 +10,7 @@
#include <vector>
#include "base/memory/singleton.h"
+#include "base/hash_tables.h"
#include "base/timer.h"
#include "ui/base/ui_export.h"
@@ -77,13 +78,20 @@ class UI_EXPORT TouchFactory {
// Is the device a touch-device?
bool IsTouchDevice(unsigned int deviceid) const;
-#if !defined(USE_XI2_MT)
+#if defined(USE_XI2_MT)
+ // Tries to find an existing slot ID mapping to tracking ID. If there
+ // isn't one already, allocates a new slot ID and sets up the mapping.
+ int GetSlotForTrackingID(uint32 tracking_id);
+
+ // Releases the slot ID mapping to tracking ID.
+ void ReleaseSlotForTrackingID(uint32 tracking_id);
+#endif
+
// Is the slot ID currently used?
bool IsSlotUsed(int slot) const;
// Marks a slot as being used/unused.
void SetSlotUsed(int slot, bool used);
-#endif
// Grabs the touch devices for the specified window on the specified display.
// Returns if grab was successful for all touch devices.
@@ -190,14 +198,24 @@ class UI_EXPORT TouchFactory {
int touch_param_min_[kMaxDeviceNum][TP_LAST_ENTRY];
int touch_param_max_[kMaxDeviceNum][TP_LAST_ENTRY];
-#if !defined(USE_XI2_MT)
// Maximum simultaneous touch points.
static const int kMaxTouchPoints = 32;
+#if defined(USE_XI2_MT)
+ // Stores the minimum available slot ID which helps get slot ID from
+ // tracking ID. When it equals to kMaxTouchPoints, there is no available
+ // slot.
+ int min_available_slot_;
+#endif
+
// A lookup table for slots in use for a touch event.
std::bitset<kMaxTouchPoints> slots_used_;
-#endif
+#if defined(USE_XI2_MT)
+ // A hash table to map tracking ID to slot.
+ typedef base::hash_map<uint32, int> TrackingIdMap;
+ TrackingIdMap tracking_id_map_;
+#endif
DISALLOW_COPY_AND_ASSIGN(TouchFactory);
};
« no previous file with comments | « no previous file | ui/base/touch/touch_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698