| Index: ui/events/event.cc
|
| diff --git a/ui/events/event.cc b/ui/events/event.cc
|
| index 1cd62e3d918793c39a6a6bfd9e62735ed4fc6488..d0966da00847a13bcfe64258596a445fa57bd0e4 100644
|
| --- a/ui/events/event.cc
|
| +++ b/ui/events/event.cc
|
| @@ -526,17 +526,19 @@
|
| radius_y_(GetTouchRadiusY(native_event)),
|
| rotation_angle_(GetTouchAngle(native_event)),
|
| force_(GetTouchForce(native_event)),
|
| - should_remove_native_touch_id_mapping_(false) {
|
| - if (type() == ET_TOUCH_RELEASED || type() == ET_TOUCH_CANCELLED)
|
| - should_remove_native_touch_id_mapping_ = true;
|
| + may_cause_scrolling_(false) {
|
| + latency()->AddLatencyNumberWithTimestamp(
|
| + INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT,
|
| + 0,
|
| + 0,
|
| + base::TimeTicks::FromInternalValue(time_stamp().ToInternalValue()),
|
| + 1);
|
|
|
| latency()->AddLatencyNumber(INPUT_EVENT_LATENCY_UI_COMPONENT, 0, 0);
|
| - FixRotationAngle();
|
| -
|
| - latency()->AddLatencyNumberWithTimestamp(
|
| - INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT, 0, 0,
|
| - base::TimeTicks::FromInternalValue(time_stamp().ToInternalValue()), 1);
|
| - latency()->AddLatencyNumber(INPUT_EVENT_LATENCY_UI_COMPONENT, 0, 0);
|
| + fixRotationAngle();
|
| +
|
| + if (type() == ET_TOUCH_PRESSED)
|
| + IncrementTouchIdRefCount(native_event);
|
| }
|
|
|
| TouchEvent::TouchEvent(EventType type,
|
| @@ -550,7 +552,7 @@
|
| radius_y_(0.0f),
|
| rotation_angle_(0.0f),
|
| force_(0.0f),
|
| - should_remove_native_touch_id_mapping_(false) {
|
| + may_cause_scrolling_(false) {
|
| latency()->AddLatencyNumber(INPUT_EVENT_LATENCY_UI_COMPONENT, 0, 0);
|
| }
|
|
|
| @@ -570,20 +572,17 @@
|
| radius_y_(radius_y),
|
| rotation_angle_(angle),
|
| force_(force),
|
| - should_remove_native_touch_id_mapping_(false) {
|
| + may_cause_scrolling_(false) {
|
| latency()->AddLatencyNumber(INPUT_EVENT_LATENCY_UI_COMPONENT, 0, 0);
|
| - FixRotationAngle();
|
| + fixRotationAngle();
|
| }
|
|
|
| TouchEvent::~TouchEvent() {
|
| // In ctor TouchEvent(native_event) we call GetTouchId() which in X11
|
| // platform setups the tracking_id to slot mapping. So in dtor here,
|
| // if this touch event is a release event, we clear the mapping accordingly.
|
| - if (should_remove_native_touch_id_mapping_) {
|
| - DCHECK(type() == ET_TOUCH_RELEASED || type() == ET_TOUCH_CANCELLED);
|
| - if (type() == ET_TOUCH_RELEASED || type() == ET_TOUCH_CANCELLED)
|
| - ClearTouchIdIfReleased(native_event());
|
| - }
|
| + if (HasNativeEvent())
|
| + ClearTouchIdIfReleased(native_event());
|
| }
|
|
|
| void TouchEvent::UpdateForRootTransform(
|
| @@ -604,7 +603,7 @@
|
| static_cast<EventResult>(result() | ER_DISABLE_SYNC_HANDLING));
|
| }
|
|
|
| -void TouchEvent::FixRotationAngle() {
|
| +void TouchEvent::fixRotationAngle() {
|
| while (rotation_angle_ < 0)
|
| rotation_angle_ += 180;
|
| while (rotation_angle_ >= 180)
|
|
|