summaryrefslogtreecommitdiff
path: root/chromium/ui/events/ozone/evdev/touch_filter/neural_stylus_palm_report_filter.h
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2020-03-11 11:32:04 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2020-03-18 13:40:17 +0000
commit31ccca0778db85c159634478b4ec7997f6704860 (patch)
tree3d33fc3afd9d5ec95541e1bbe074a9cf8da12a0e /chromium/ui/events/ozone/evdev/touch_filter/neural_stylus_palm_report_filter.h
parent248b70b82a40964d5594eb04feca0fa36716185d (diff)
downloadqtwebengine-chromium-31ccca0778db85c159634478b4ec7997f6704860.tar.gz
BASELINE: Update Chromium to 80.0.3987.136
Change-Id: I98e1649aafae85ba3a83e67af00bb27ef301db7b Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
Diffstat (limited to 'chromium/ui/events/ozone/evdev/touch_filter/neural_stylus_palm_report_filter.h')
-rw-r--r--chromium/ui/events/ozone/evdev/touch_filter/neural_stylus_palm_report_filter.h51
1 files changed, 51 insertions, 0 deletions
diff --git a/chromium/ui/events/ozone/evdev/touch_filter/neural_stylus_palm_report_filter.h b/chromium/ui/events/ozone/evdev/touch_filter/neural_stylus_palm_report_filter.h
new file mode 100644
index 00000000000..1c7e28b8e5a
--- /dev/null
+++ b/chromium/ui/events/ozone/evdev/touch_filter/neural_stylus_palm_report_filter.h
@@ -0,0 +1,51 @@
+// Copyright 2019 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef UI_EVENTS_OZONE_EVDEV_TOUCH_FILTER_NEURAL_STYLUS_PALM_REPORT_FILTER_H_
+#define UI_EVENTS_OZONE_EVDEV_TOUCH_FILTER_NEURAL_STYLUS_PALM_REPORT_FILTER_H_
+
+#include <bitset>
+#include <vector>
+
+#include "base/component_export.h"
+#include "base/time/time.h"
+#include "ui/events/ozone/evdev/event_device_info.h"
+#include "ui/events/ozone/evdev/touch_evdev_types.h"
+#include "ui/events/ozone/evdev/touch_filter/palm_detection_filter.h"
+#include "ui/events/ozone/evdev/touch_filter/shared_palm_detection_filter_state.h"
+
+namespace ui {
+
+// A palm detection filter that doesn't change any reports, but adds UMA reports
+// based on the shared palm state. Otherwise behaves identically to
+// OpenPalmDetectionFilter.
+class COMPONENT_EXPORT(EVDEV) NeuralStylusReportFilter
+ : public PalmDetectionFilter {
+ public:
+ explicit NeuralStylusReportFilter(
+ SharedPalmDetectionFilterState* shared_palm_state);
+ ~NeuralStylusReportFilter() override;
+
+ static bool CompatibleWithNeuralStylusReportFilter(
+ const EventDeviceInfo& devinfo);
+
+ void Filter(const std::vector<InProgressTouchEvdev>& touches,
+ base::TimeTicks time,
+ std::bitset<kNumTouchEvdevSlots>* slots_to_hold,
+ std::bitset<kNumTouchEvdevSlots>* slots_to_suppress) override;
+
+ static const char kFilterName[];
+ static const char kNeuralFingerAge[];
+ static const char kNeuralPalmAge[];
+ static const char kNeuralPalmTouchCount[];
+ std::string FilterNameForTesting() const override;
+
+ private:
+ bool previous_update_ = false;
+ DISALLOW_COPY_AND_ASSIGN(NeuralStylusReportFilter);
+};
+
+} // namespace ui
+
+#endif // UI_EVENTS_OZONE_EVDEV_TOUCH_FILTER_NEURAL_STYLUS_PALM_REPORT_FILTER_H_