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

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

Issue 661353006: ozone: evdev: Dispatch events in task (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix tests 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 unified diff | Download patch
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(events_[i].type_, 283 callback_.Run(make_scoped_ptr(
284 gfx::PointF(events_[i].x_, events_[i].y_), 284 new TouchEvent(events_[i].type_,
285 /* flags */ 0, 285 gfx::PointF(events_[i].x_, events_[i].y_),
286 /* touch_id */ i, 286 /* flags */ 0,
287 delta, 287 /* touch_id */ i,
288 /* radius_x */ events_[i].radius_x_, 288 delta,
289 /* radius_y */ events_[i].radius_y_, 289 /* radius_x */ events_[i].radius_x_,
290 /* angle */ 0., 290 /* radius_y */ events_[i].radius_y_,
291 events_[i].pressure_); 291 /* angle */ 0.,
292 callback_.Run(&evt); 292 events_[i].pressure_)));
293 293
294 // Subsequent events for this finger will be touch-move until it 294 // Subsequent events for this finger will be touch-move until it
295 // is released. 295 // is released.
296 events_[i].type_ = ET_TOUCH_MOVED; 296 events_[i].type_ = ET_TOUCH_MOVED;
297 } 297 }
298 } 298 }
299 altered_slots_.reset(); 299 altered_slots_.reset();
300 } 300 }
301 301
302 } // namespace ui 302 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698