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

Side by Side Diff: ui/events/ozone/evdev/touch_event_converter_evdev.cc

Issue 512553002: ozone: evdev: Use tracking id for TouchEvent finger id (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add/fix tests Created 6 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 unified diff | Download patch
« no previous file with comments | « no previous file | ui/events/ozone/evdev/touch_event_converter_evdev_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/events/ozone/evdev/touch_event_converter_evdev.h" 5 #include "ui/events/ozone/evdev/touch_event_converter_evdev.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <fcntl.h> 8 #include <fcntl.h>
9 #include <linux/input.h> 9 #include <linux/input.h>
10 #include <poll.h> 10 #include <poll.h>
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 break; 273 break;
274 default: 274 default:
275 NOTIMPLEMENTED() << "invalid code for EV_SYN: " << input.code; 275 NOTIMPLEMENTED() << "invalid code for EV_SYN: " << input.code;
276 } 276 }
277 } 277 }
278 278
279 void TouchEventConverterEvdev::ReportEvents(base::TimeDelta delta) { 279 void TouchEventConverterEvdev::ReportEvents(base::TimeDelta delta) {
280 for (int i = 0; i < MAX_FINGERS; i++) { 280 for (int i = 0; i < MAX_FINGERS; i++) {
281 if (altered_slots_[i]) { 281 if (altered_slots_[i]) {
282 // TODO(rikroege): Support elliptical finger regions. 282 // TODO(rikroege): Support elliptical finger regions.
283 TouchEvent evt( 283 TouchEvent evt(events_[i].type_,
284 events_[i].type_, 284 gfx::PointF(events_[i].x_, events_[i].y_),
285 gfx::PointF(events_[i].x_, events_[i].y_), 285 /* flags */ 0,
286 /* flags */ 0, 286 /* touch_id */ events_[i].finger_,
287 /* touch_id */ i, 287 delta,
288 delta, 288 events_[i].pressure_ * kFingerWidth,
289 events_[i].pressure_ * kFingerWidth, 289 events_[i].pressure_ * kFingerWidth,
290 events_[i].pressure_ * kFingerWidth, 290 /* angle */ 0.,
291 /* angle */ 0., 291 events_[i].pressure_);
292 events_[i].pressure_);
293 DispatchEventToCallback(&evt); 292 DispatchEventToCallback(&evt);
294 293
295 // Subsequent events for this finger will be touch-move until it 294 // Subsequent events for this finger will be touch-move until it
296 // is released. 295 // is released.
297 events_[i].type_ = ET_TOUCH_MOVED; 296 events_[i].type_ = ET_TOUCH_MOVED;
298 } 297 }
299 } 298 }
300 altered_slots_.reset(); 299 altered_slots_.reset();
301 } 300 }
302 301
303 } // namespace ui 302 } // namespace ui
OLDNEW
« no previous file with comments | « no previous file | ui/events/ozone/evdev/touch_event_converter_evdev_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698