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

Unified Diff: ui/events/ozone/evdev/touch_event_converter_evdev.cc

Issue 671723002: [Ozone] Properly initialize multitouch slot values (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 6 years, 2 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
Index: ui/events/ozone/evdev/touch_event_converter_evdev.cc
diff --git a/ui/events/ozone/evdev/touch_event_converter_evdev.cc b/ui/events/ozone/evdev/touch_event_converter_evdev.cc
index 7b666e0e4c43e6ba5db49842a76eff0094c762f2..d94e90a36b3c8d42aa7e98e34f4fb7371b56bc01 100644
--- a/ui/events/ozone/evdev/touch_event_converter_evdev.cc
+++ b/ui/events/ozone/evdev/touch_event_converter_evdev.cc
@@ -72,6 +72,17 @@ float TuxelToPixelSize(float val, float num_tuxels, float num_pixels) {
namespace ui {
+TouchEventConverterEvdev::InProgressEvents::InProgressEvents()
+ : x_(0),
+ y_(0),
+ id_(-1),
+ finger_(-1),
+ type_(ET_UNKNOWN),
+ radius_x_(0),
+ radius_y_(0),
+ pressure_(0) {
+}
+
TouchEventConverterEvdev::TouchEventConverterEvdev(
int fd,
base::FilePath path,
@@ -129,6 +140,17 @@ void TouchEventConverterEvdev::Init(const EventDeviceInfo& info) {
cal.bezel_right,
cal.bezel_top,
cal.bezel_bottom);
+
+ for (int i = 0; i <= info.GetAbsMaximum(ABS_MT_SLOT); ++i) {
+ events_[i].finger_ = info.GetSlotValue(ABS_MT_TRACKING_ID, i);
+ events_[i].type_ =
+ events_[i].finger_ < 0 ? ET_TOUCH_RELEASED : ET_TOUCH_PRESSED;
+ events_[i].x_ = info.GetSlotValue(ABS_MT_POSITION_X, i);
+ events_[i].y_ = info.GetSlotValue(ABS_MT_POSITION_Y, i);
+ events_[i].radius_x_ = info.GetSlotValue(ABS_MT_TOUCH_MAJOR, i);
+ events_[i].radius_y_ = info.GetSlotValue(ABS_MT_TOUCH_MINOR, i);
+ events_[i].pressure_ = info.GetSlotValue(ABS_MT_PRESSURE, i);
+ }
}
bool TouchEventConverterEvdev::Reinitialize() {

Powered by Google App Engine
This is Rietveld 408576698