Commit 35ebddde authored by Rob Schonberger's avatar Rob Schonberger Committed by Commit Bot

Add a filter for reporting, with unittest and feature-flag for use.

This adds a reporting filter intended for Stylus' devices, which adds
metric recording.

Bug: 1009290
Change-Id: Ifed692f1bd6dcf6cea7891dc615d6887bb11d672
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1923223
Commit-Queue: Rob Schonberger <robsc@chromium.org>
Reviewed-by: default avatarSean O'Brien <seobrien@chromium.org>
Reviewed-by: default avatarMichael Spang <spang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#719836}
parent f5356fcf
......@@ -77,6 +77,8 @@ component("evdev") {
"touch_filter/neural_stylus_palm_detection_filter_model.h",
"touch_filter/neural_stylus_palm_detection_filter_util.cc",
"touch_filter/neural_stylus_palm_detection_filter_util.h",
"touch_filter/neural_stylus_palm_report_filter.cc",
"touch_filter/neural_stylus_palm_report_filter.h",
"touch_filter/open_palm_detection_filter.cc",
"touch_filter/open_palm_detection_filter.h",
"touch_filter/palm_detection_filter.cc",
......@@ -161,6 +163,7 @@ source_set("unittests") {
"touch_filter/heuristic_stylus_palm_detection_filter_unittest.cc",
"touch_filter/neural_stylus_palm_detection_filter_unittest.cc",
"touch_filter/neural_stylus_palm_detection_filter_util_unittest.cc",
"touch_filter/neural_stylus_palm_report_filter_unittest.cc",
"touch_filter/open_palm_detection_filter_unittest.cc",
"touch_filter/palm_detection_filter_factory_unittest.cc",
]
......
......@@ -16,14 +16,15 @@ void HeuristicStylusPalmDetectionFilter::Filter(
slots_to_hold->reset();
slots_to_suppress->reset();
base::TimeTicks latest_stylus_time =
shared_palm_state_->latest_stylus_touch_time_;
shared_palm_state_->latest_stylus_touch_time;
uint32_t active_touches = 0;
for (int i = 0; i < kNumTouchEvdevSlots; ++i) {
const auto& touch = touches[i];
if (touch.tool_code == BTN_TOOL_PEN) {
// We detect BTN_TOOL_PEN whenever a pen is even hovering. This is
// mutually exclusive with finger touches, which is what we're interested
// in. So we update latest_time.
shared_palm_state_->latest_stylus_touch_time_ = time;
shared_palm_state_->latest_stylus_touch_time = time;
return;
}
if (!touch.touching) {
......@@ -33,6 +34,8 @@ void HeuristicStylusPalmDetectionFilter::Filter(
if (stroke_length_[i] == 0) {
// new touch!
touch_started_time_[i] = time;
// It's a new finger!
shared_palm_state_->latest_finger_touch_time = time;
}
stroke_length_[i]++;
base::TimeDelta time_since_stylus_for_touch_start =
......@@ -42,8 +45,12 @@ void HeuristicStylusPalmDetectionFilter::Filter(
} else if (time_since_stylus_for_touch_start < time_after_stylus_to_hold_ &&
stroke_length_[i] <= hold_stroke_count_) {
slots_to_hold->set(i, 1);
} else {
active_touches++;
}
}
// We never mark anything as a palm.
shared_palm_state_->active_finger_touches = active_touches;
}
HeuristicStylusPalmDetectionFilter::HeuristicStylusPalmDetectionFilter(
......
......@@ -107,6 +107,7 @@ TEST_F(HeuristicStylusPalmDetectionFilterTest, TestHoldAfterStylus) {
palm_detection_filter_->Filter(touches_, test_start_time_, &hold, &suppress);
EXPECT_TRUE(hold.none());
EXPECT_TRUE(suppress.none());
EXPECT_EQ(0u, shared_palm_state->active_finger_touches);
// Now, lets start two touches a little before end of hold time.
touches_[0].tool_code = 0;
......@@ -133,8 +134,11 @@ TEST_F(HeuristicStylusPalmDetectionFilterTest, TestHoldAfterStylus) {
hold.reset(0);
hold.reset(1);
EXPECT_TRUE(hold.none());
ASSERT_EQ(0u, shared_palm_state->active_finger_touches)
<< " Failed at i = " << i;
} else {
ASSERT_EQ(2u, shared_palm_state->active_finger_touches)
<< " Failed at i = " << i;
EXPECT_TRUE(hold.none());
}
}
......@@ -153,6 +157,7 @@ TEST_F(HeuristicStylusPalmDetectionFilterTest, TestNothingLongAfterStylus) {
base::TimeTicks start_time =
test_start_time_ + hold_time + base::TimeDelta::FromMillisecondsD(1e-2);
palm_detection_filter_->Filter(touches_, start_time, &hold, &suppress);
EXPECT_EQ(2u, shared_palm_state->active_finger_touches);
EXPECT_TRUE(hold.none());
EXPECT_TRUE(suppress.none());
}
......
......@@ -118,7 +118,14 @@ void NeuralStylusPalmDetectionFilter::Filter(
slots_to_hold->reset();
slots_to_suppress->reset();
std::unordered_set<int> slots_to_decide;
uint32_t total_finger_touching = 0;
for (const auto& touch : touches) {
if (touch.touching && touch.tool_code != BTN_TOOL_PEN) {
total_finger_touching++;
if (!touch.was_touching) {
shared_palm_state_->latest_finger_touch_time = time;
}
}
// Ignore touch events that are not touches.
if (!touch.touching && !touch.was_touching) {
continue;
......@@ -199,9 +206,16 @@ void NeuralStylusPalmDetectionFilter::Filter(
}
is_palm_.set(slot, DetectSpuriousStroke(ExtractFeatures(tracking_id),
tracking_id, 0.0));
if (is_palm_.test(slot)) {
shared_palm_state_->latest_palm_touch_time = time;
}
}
*slots_to_suppress |= is_palm_;
*slots_to_hold |= is_delay_;
shared_palm_state_->active_palm_touches = is_palm_.count();
shared_palm_state_->active_finger_touches =
total_finger_touching - is_palm_.count();
}
bool NeuralStylusPalmDetectionFilter::ShouldDecideStroke(
......
......@@ -279,7 +279,6 @@ TEST_F(NeuralStylusPalmDetectionFilterTest, InferenceOncePalm) {
std::bitset<kNumTouchEvdevSlots> expected_cancelled;
base::TimeTicks touch_time =
base::TimeTicks::UnixEpoch() + base::TimeDelta::FromMillisecondsD(10.0);
expected_cancelled.set(0, true);
touch_[0].touching = true;
touch_[0].tracking_id = 600;
......@@ -290,6 +289,13 @@ TEST_F(NeuralStylusPalmDetectionFilterTest, InferenceOncePalm) {
EXPECT_CALL(*model_, Inference(testing::_))
.Times(1)
.WillOnce(testing::Return(0.5));
base::TimeTicks original_finger_time =
touch_time + base::TimeDelta::FromMillisecondsD(8.0f);
base::TimeTicks original_palm_time =
touch_time +
model_config_.max_sample_count * base::TimeDelta::FromMillisecondsD(8.0f);
for (size_t i = 0; i < 5000; ++i) {
if (i != 0) {
touch_[0].was_touching = true;
......@@ -297,9 +303,19 @@ TEST_F(NeuralStylusPalmDetectionFilterTest, InferenceOncePalm) {
touch_time += base::TimeDelta::FromMillisecondsD(8.0f);
palm_detection_filter_->Filter(touch_, touch_time, &actual_held,
&actual_cancelled);
ASSERT_EQ(original_finger_time,
shared_palm_state->latest_finger_touch_time);
ASSERT_TRUE(actual_held.none()) << " Failed at " << i;
if (i >= model_config_.max_sample_count) {
if (i >= (model_config_.max_sample_count - 1)) {
ASSERT_EQ(expected_cancelled, actual_cancelled) << " Failed at " << i;
ASSERT_EQ(1u, shared_palm_state->active_palm_touches)
<< " Failed at " << i;
ASSERT_EQ(original_palm_time, shared_palm_state->latest_palm_touch_time)
<< " Failed at " << i;
} else {
ASSERT_EQ(1u, shared_palm_state->active_finger_touches)
<< "Failed at " << i;
}
}
}
......
// 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.
#include "ui/events/ozone/evdev/touch_filter/neural_stylus_palm_report_filter.h"
#include "base/metrics/histogram_macros.h"
namespace ui {
NeuralStylusReportFilter::NeuralStylusReportFilter(
SharedPalmDetectionFilterState* shared_palm_state)
: PalmDetectionFilter(shared_palm_state) {}
NeuralStylusReportFilter::~NeuralStylusReportFilter() {}
bool NeuralStylusReportFilter::CompatibleWithNeuralStylusReportFilter(
const EventDeviceInfo& devinfo) {
return devinfo.HasStylus();
}
void NeuralStylusReportFilter::Filter(
const std::vector<InProgressTouchEvdev>& touches,
base::TimeTicks time,
std::bitset<kNumTouchEvdevSlots>* slots_to_hold,
std::bitset<kNumTouchEvdevSlots>* slots_to_suppress) {
bool should_update = false;
for (const auto& touch : touches) {
// Is a stylus detected? We should be updating.
if (touch.altered && touch.stylus_button) {
should_update = true;
continue;
}
}
// Only update once when a stylus is detected.
if (!previous_update_ && should_update) {
// Once a stylus is detected, we report.
base::TimeDelta palm_age =
time - shared_palm_state_->latest_palm_touch_time;
base::TimeDelta finger_age =
time - shared_palm_state_->latest_finger_touch_time;
UMA_HISTOGRAM_TIMES(kNeuralPalmAge, palm_age);
UMA_HISTOGRAM_TIMES(kNeuralFingerAge, finger_age);
UMA_HISTOGRAM_COUNTS_100(kNeuralPalmTouchCount,
shared_palm_state_->active_palm_touches);
}
previous_update_ = should_update;
slots_to_hold->reset();
slots_to_suppress->reset();
}
const char NeuralStylusReportFilter::kFilterName[] = "NeuralStylusReportFilter";
const char NeuralStylusReportFilter::kNeuralPalmAge[] =
"Ozone.NeuralStylusReport.PalmAgeBeforeStylus";
const char NeuralStylusReportFilter::kNeuralFingerAge[] =
"Ozone.NeuralStylusReport.FingerAgeBeforeStylus";
const char NeuralStylusReportFilter::kNeuralPalmTouchCount[] =
"Ozone.NeuralStylusReport.ActivePalmTouchCount";
std::string NeuralStylusReportFilter::FilterNameForTesting() const {
return kFilterName;
}
} // namespace ui
// 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_
// 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.
#include "ui/events/ozone/evdev/touch_filter/neural_stylus_palm_report_filter.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/time/time.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/events/ozone/evdev/event_device_info.h"
#include "ui/events/ozone/evdev/event_device_test_util.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 {
class NeuralStylusReportFilterTest : public testing::Test {
public:
NeuralStylusReportFilterTest() = default;
void SetUp() override {
shared_palm_state = std::make_unique<SharedPalmDetectionFilterState>();
palm_detection_filter_.reset(
new NeuralStylusReportFilter(shared_palm_state.get()));
EXPECT_TRUE(CapabilitiesToDeviceInfo(kNocturneTouchScreen,
&nocturne_touchscreen_info_));
EXPECT_TRUE(
CapabilitiesToDeviceInfo(kNocturneStylus, &nocturne_stylus_info_));
}
protected:
std::unique_ptr<SharedPalmDetectionFilterState> shared_palm_state;
std::unique_ptr<PalmDetectionFilter> palm_detection_filter_;
EventDeviceInfo nocturne_touchscreen_info_, nocturne_stylus_info_;
DISALLOW_COPY_AND_ASSIGN(NeuralStylusReportFilterTest);
};
TEST_F(NeuralStylusReportFilterTest, TestSetsToZero) {
std::bitset<kNumTouchEvdevSlots> suppress, hold;
suppress.set(kNumTouchEvdevSlots - 1, 1);
hold.set(0, 1);
std::vector<InProgressTouchEvdev> inputs;
inputs.resize(kNumTouchEvdevSlots);
palm_detection_filter_->Filter(inputs, base::TimeTicks::Now(), &hold,
&suppress);
EXPECT_TRUE(hold.none());
EXPECT_TRUE(suppress.none());
}
TEST_F(NeuralStylusReportFilterTest, CompatibleWithStylus) {
EXPECT_FALSE(NeuralStylusReportFilter::CompatibleWithNeuralStylusReportFilter(
nocturne_touchscreen_info_));
EXPECT_TRUE(NeuralStylusReportFilter::CompatibleWithNeuralStylusReportFilter(
nocturne_stylus_info_));
}
TEST_F(NeuralStylusReportFilterTest, TestNoUpdatesWhenNotTouching) {
base::HistogramTester histogram_tester;
std::bitset<kNumTouchEvdevSlots> suppress, hold;
std::vector<InProgressTouchEvdev> inputs;
inputs.resize(kNumTouchEvdevSlots);
base::TimeTicks sample_t = base::TimeTicks::Now();
palm_detection_filter_->Filter(inputs, sample_t, &hold, &suppress);
EXPECT_THAT(
histogram_tester.GetAllSamples(NeuralStylusReportFilter::kNeuralPalmAge),
::testing::IsEmpty());
EXPECT_THAT(histogram_tester.GetAllSamples(
NeuralStylusReportFilter::kNeuralFingerAge),
::testing::IsEmpty());
EXPECT_THAT(histogram_tester.GetAllSamples(
NeuralStylusReportFilter::kNeuralPalmTouchCount),
::testing::IsEmpty());
shared_palm_state->active_palm_touches = 2;
shared_palm_state->latest_stylus_touch_time =
sample_t - base::TimeDelta::FromMillisecondsD(10.0);
shared_palm_state->latest_palm_touch_time =
sample_t - base::TimeDelta::FromMillisecondsD(15.0);
shared_palm_state->latest_finger_touch_time =
sample_t - base::TimeDelta::FromMillisecondsD(20.0);
inputs[0].altered = true;
inputs[0].stylus_button = true;
// We should now get a bunch of updates.
palm_detection_filter_->Filter(inputs, sample_t, &hold, &suppress);
histogram_tester.ExpectTotalCount(NeuralStylusReportFilter::kNeuralPalmAge,
1);
histogram_tester.ExpectTimeBucketCount(
NeuralStylusReportFilter::kNeuralPalmAge,
base::TimeDelta::FromMillisecondsD(15.0), 1);
histogram_tester.ExpectTotalCount(NeuralStylusReportFilter::kNeuralFingerAge,
1);
histogram_tester.ExpectTimeBucketCount(
NeuralStylusReportFilter::kNeuralFingerAge,
base::TimeDelta::FromMillisecondsD(20.0), 1);
histogram_tester.ExpectTotalCount(
NeuralStylusReportFilter::kNeuralPalmTouchCount, 1);
histogram_tester.ExpectBucketCount(
NeuralStylusReportFilter::kNeuralPalmTouchCount, 2, 1);
// We should now get a bunch of updates.
// Ensure no more updates.
palm_detection_filter_->Filter(
inputs, sample_t + base::TimeDelta::FromMillisecondsD(5.0), &hold,
&suppress);
histogram_tester.ExpectTotalCount(NeuralStylusReportFilter::kNeuralPalmAge,
1);
histogram_tester.ExpectTotalCount(NeuralStylusReportFilter::kNeuralFingerAge,
1);
histogram_tester.ExpectTotalCount(
NeuralStylusReportFilter::kNeuralPalmTouchCount, 1);
// Set to 0 again, filter, then set to touching again.
inputs[0] = inputs[1];
palm_detection_filter_->Filter(
inputs, sample_t + base::TimeDelta::FromMillisecondsD(10.0), &hold,
&suppress);
inputs[0].altered = true;
inputs[0].stylus_button = true;
palm_detection_filter_->Filter(
inputs, sample_t + base::TimeDelta::FromMillisecondsD(15.0), &hold,
&suppress);
histogram_tester.ExpectTotalCount(NeuralStylusReportFilter::kNeuralPalmAge,
2);
histogram_tester.ExpectTimeBucketCount(
NeuralStylusReportFilter::kNeuralPalmAge,
base::TimeDelta::FromMillisecondsD(15.0), 1);
histogram_tester.ExpectTimeBucketCount(
NeuralStylusReportFilter::kNeuralPalmAge,
base::TimeDelta::FromMillisecondsD(30.0), 1);
histogram_tester.ExpectTotalCount(NeuralStylusReportFilter::kNeuralFingerAge,
2);
histogram_tester.ExpectTimeBucketCount(
NeuralStylusReportFilter::kNeuralFingerAge,
base::TimeDelta::FromMillisecondsD(20.0), 1);
histogram_tester.ExpectTimeBucketCount(
NeuralStylusReportFilter::kNeuralFingerAge,
base::TimeDelta::FromMillisecondsD(35.0), 1);
histogram_tester.ExpectTotalCount(
NeuralStylusReportFilter::kNeuralPalmTouchCount, 2);
histogram_tester.ExpectBucketCount(
NeuralStylusReportFilter::kNeuralPalmTouchCount, 2, 2);
}
} // namespace ui
......@@ -19,6 +19,8 @@ void OpenPalmDetectionFilter::Filter(
std::bitset<kNumTouchEvdevSlots>* slots_to_suppress) {
slots_to_hold->reset();
slots_to_suppress->reset();
// Open Palm doesn't know if it's running on a stylus device, or a
// touchscreen. It doesn't track active fingers/palms on the device.
}
const char OpenPalmDetectionFilter::kFilterName[] = "OpenPalmDetectionFilter";
......
......@@ -15,6 +15,7 @@
#include "ui/events/ozone/evdev/touch_filter/heuristic_stylus_palm_detection_filter.h"
#include "ui/events/ozone/evdev/touch_filter/neural_stylus_palm_detection_filter.h"
#include "ui/events/ozone/evdev/touch_filter/neural_stylus_palm_detection_filter_model.h"
#include "ui/events/ozone/evdev/touch_filter/neural_stylus_palm_report_filter.h"
#include "ui/events/ozone/evdev/touch_filter/open_palm_detection_filter.h"
#include "ui/events/ozone/evdev/touch_filter/palm_detection_filter.h"
#include "ui/events/ozone/evdev/touch_filter/palm_model/onedevice_train_palm_detection_filter_model.h"
......@@ -66,7 +67,14 @@ std::unique_ptr<PalmDetectionFilter> CreatePalmDetectionFilter(
return std::make_unique<HeuristicStylusPalmDetectionFilter>(
shared_palm_state, stroke_count, hold_time, cancel_time);
}
return std::make_unique<OpenPalmDetectionFilter>(shared_palm_state);
if (base::FeatureList::IsEnabled(kEnableNeuralStylusReportFilter) &&
NeuralStylusReportFilter::CompatibleWithNeuralStylusReportFilter(
devinfo)) {
return std::make_unique<NeuralStylusReportFilter>(shared_palm_state);
} else {
return std::make_unique<OpenPalmDetectionFilter>(shared_palm_state);
}
}
} // namespace ui
......@@ -12,6 +12,7 @@
#include "ui/events/ozone/evdev/event_device_test_util.h"
#include "ui/events/ozone/evdev/touch_filter/heuristic_stylus_palm_detection_filter.h"
#include "ui/events/ozone/evdev/touch_filter/neural_stylus_palm_detection_filter.h"
#include "ui/events/ozone/evdev/touch_filter/neural_stylus_palm_report_filter.h"
#include "ui/events/ozone/evdev/touch_filter/open_palm_detection_filter.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"
......@@ -105,6 +106,35 @@ TEST_F(PalmDetectionFilterFactoryTest, HeuristicTimesSet) {
EXPECT_EQ(base::TimeDelta::FromSecondsD(15.327),
heuristic_filter->HoldTime());
}
TEST_F(PalmDetectionFilterFactoryTest, NeuralReportNoNeuralDetectSet) {
scoped_feature_list_->InitWithFeatures(
{ui::kEnableNeuralStylusReportFilter},
{ui::kEnableHeuristicPalmDetectionFilter,
ui::kEnableNeuralPalmDetectionFilter});
std::unique_ptr<PalmDetectionFilter> palm_filter = CreatePalmDetectionFilter(
nocturne_touchscreen_info_, &shared_palm_state_);
ASSERT_EQ(OpenPalmDetectionFilter::kFilterName,
palm_filter->FilterNameForTesting());
palm_filter =
CreatePalmDetectionFilter(nocturne_stylus_info_, &shared_palm_state_);
ASSERT_EQ(NeuralStylusReportFilter::kFilterName,
palm_filter->FilterNameForTesting());
}
TEST_F(PalmDetectionFilterFactoryTest, NeuralReportNeuralDetectSet) {
scoped_feature_list_->InitWithFeatures(
{ui::kEnableNeuralStylusReportFilter,
ui::kEnableNeuralPalmDetectionFilter},
{ui::kEnableHeuristicPalmDetectionFilter});
std::unique_ptr<PalmDetectionFilter> palm_filter = CreatePalmDetectionFilter(
nocturne_touchscreen_info_, &shared_palm_state_);
ASSERT_EQ(NeuralStylusPalmDetectionFilter::kFilterName,
palm_filter->FilterNameForTesting());
palm_filter =
CreatePalmDetectionFilter(nocturne_stylus_info_, &shared_palm_state_);
ASSERT_EQ(NeuralStylusReportFilter::kFilterName,
palm_filter->FilterNameForTesting());
}
TEST_F(PalmDetectionFilterFactoryTest, NeuralBeatsHeuristic) {
scoped_feature_list_->InitWithFeaturesAndParameters(
......
......@@ -11,7 +11,22 @@ namespace ui {
struct SharedPalmDetectionFilterState {
// The latest stylus touch time. Note that this can include "hover".
base::TimeTicks latest_stylus_touch_time_;
base::TimeTicks latest_stylus_touch_time;
// Latest time that a finger was detected on a touchscreen. It may or may not
// have been converted into a palm later.
base::TimeTicks latest_finger_touch_time = base::TimeTicks::UnixEpoch();
// From a touch screen, the number of active touches on the screen that aren't
// palms.
uint32_t active_finger_touches = 0;
// From a touch screen, the number of active palms on the screen.
uint32_t active_palm_touches = 0;
// Latest time that a palm was detected on a touchscreen. the palm may or may
// not still be on the touchscreen.
base::TimeTicks latest_palm_touch_time = base::TimeTicks::UnixEpoch();
};
} // namespace ui
......
......@@ -12,6 +12,9 @@ const base::Feature kEnableHeuristicPalmDetectionFilter{
const base::Feature kEnableNeuralPalmDetectionFilter{
"EnableNeuralPalmDetectionFilter", base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kEnableNeuralStylusReportFilter{
"EnableNeuralStylusReportFilter", base::FEATURE_DISABLED_BY_DEFAULT};
extern const base::FeatureParam<std::string> kNeuralPalmRadiusPolynomial{
&kEnableNeuralPalmDetectionFilter, "neural_palm_radius_polynomial", ""};
......
......@@ -17,6 +17,9 @@ extern const base::Feature kEnableHeuristicPalmDetectionFilter;
COMPONENT_EXPORT(EVENTS_OZONE)
extern const base::Feature kEnableNeuralPalmDetectionFilter;
COMPONENT_EXPORT(EVENTS_OZONE)
extern const base::Feature kEnableNeuralStylusReportFilter;
COMPONENT_EXPORT(EVENTS_OZONE)
extern const base::FeatureParam<std::string> kNeuralPalmRadiusPolynomial;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment