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

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

Issue 991533002: Port Chromium OS touch noise filtering to Chromium (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 | « ui/events/ozone/evdev/touch_evdev_types.cc ('k') | ui/events/ozone/evdev/touch_event_converter_evdev.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/ozone/evdev/touch_event_converter_evdev.h
diff --git a/ui/events/ozone/evdev/touch_event_converter_evdev.h b/ui/events/ozone/evdev/touch_event_converter_evdev.h
index f522921da46912af1c748c8d0a72f1ceb009ac80..eb847dc07a5f55c11e4d5d512d0e76df3b85c54e 100644
--- a/ui/events/ozone/evdev/touch_event_converter_evdev.h
+++ b/ui/events/ozone/evdev/touch_event_converter_evdev.h
@@ -9,6 +9,7 @@
#include "base/compiler_specific.h"
#include "base/files/file_path.h"
+#include "base/memory/scoped_ptr.h"
#include "base/message_loop/message_pump_libevent.h"
#include "ui/events/event_constants.h"
#include "ui/events/ozone/evdev/event_converter_evdev.h"
@@ -17,14 +18,14 @@
namespace ui {
-class TouchEvent;
-
class DeviceEventDispatcherEvdev;
+class TouchEvent;
+class TouchNoiseFinder;
+struct InProgressTouchEvdev;
class EVENTS_OZONE_EVDEV_EXPORT TouchEventConverterEvdev
: public EventConverterEvdev {
public:
- enum { MAX_FINGERS = 20 };
TouchEventConverterEvdev(int fd,
base::FilePath path,
int id,
@@ -43,21 +44,6 @@ class EVENTS_OZONE_EVDEV_EXPORT TouchEventConverterEvdev
private:
friend class MockTouchEventConverterEvdev;
- struct InProgressEvents {
- InProgressEvents();
-
- bool altered_;
- float x_;
- float y_;
- int id_; // Device reported "unique" touch point id; -1 means not active
- int finger_; // "Finger" id starting from 0; -1 means not active
-
- EventType type_;
- float radius_x_;
- float radius_y_;
- float pressure_;
- };
-
// Overidden from base::MessagePumpLibevent::Watcher.
void OnFileCanReadWithoutBlocking(int fd) override;
@@ -67,8 +53,13 @@ class EVENTS_OZONE_EVDEV_EXPORT TouchEventConverterEvdev
void ProcessAbs(const input_event& input);
void ProcessSyn(const input_event& input);
- void ReportEvent(int touch_id,
- const InProgressEvents& event, const base::TimeDelta& delta);
+ // Returns an EventType to dispatch for |touch|. Returns ET_UNKNOWN if an
+ // event should not be dispatched.
+ EventType GetEventTypeForTouch(const InProgressTouchEvdev& touch);
+
+ void ReportEvent(const InProgressTouchEvdev& event,
+ EventType event_type,
+ const base::TimeDelta& delta);
void ReportEvents(base::TimeDelta delta);
// Dispatcher for events.
@@ -77,9 +68,6 @@ class EVENTS_OZONE_EVDEV_EXPORT TouchEventConverterEvdev
// Set if we have seen a SYN_DROPPED and not yet re-synced with the device.
bool syn_dropped_;
- // Set if this is a type A device (uses SYN_MT_REPORT).
- bool is_type_a_;
-
// Pressure values.
int pressure_min_;
int pressure_max_; // Used to normalize pressure values.
@@ -102,7 +90,10 @@ class EVENTS_OZONE_EVDEV_EXPORT TouchEventConverterEvdev
size_t current_slot_;
// In-progress touch points.
- std::vector<InProgressEvents> events_;
+ std::vector<InProgressTouchEvdev> events_;
+
+ // Finds touch noise.
+ scoped_ptr<TouchNoiseFinder> touch_noise_finder_;
DISALLOW_COPY_AND_ASSIGN(TouchEventConverterEvdev);
};
« no previous file with comments | « ui/events/ozone/evdev/touch_evdev_types.cc ('k') | ui/events/ozone/evdev/touch_event_converter_evdev.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698