Chromium Code Reviews| Index: third_party/WebKit/Source/core/input/PointerEventManager.cpp |
| diff --git a/third_party/WebKit/Source/core/input/PointerEventManager.cpp b/third_party/WebKit/Source/core/input/PointerEventManager.cpp |
| index a60584834e48387f1cef9bb2fd284db9f7e4b550..3af580a6af584bb67ada6592c60e183381611721 100644 |
| --- a/third_party/WebKit/Source/core/input/PointerEventManager.cpp |
| +++ b/third_party/WebKit/Source/core/input/PointerEventManager.cpp |
| @@ -29,6 +29,22 @@ size_t ToPointerTypeIndex(WebPointerProperties::PointerType t) { |
| return static_cast<size_t>(t); |
| } |
| +Vector<WebPointerEvent> GetCoalescedWebPointerEventsWithNoTransformation( |
| + const Vector<WebTouchEvent>& coalesced_events, |
| + int id) { |
| + Vector<WebPointerEvent> related_pointer_events; |
| + for (const auto& touch_event : coalesced_events) { |
| + for (unsigned i = 0; i < touch_event.touches_length; ++i) { |
| + if (touch_event.touches[i].id == id && |
| + touch_event.touches[i].state != WebTouchPoint::kStateStationary) { |
| + related_pointer_events.push_back( |
| + WebPointerEvent(touch_event, touch_event.touches[i])); |
| + } |
| + } |
| + } |
| + return related_pointer_events; |
| +} |
| + |
| Vector<std::pair<WebTouchPoint, TimeTicks>> GetCoalescedPoints( |
| const Vector<WebTouchEvent>& coalesced_events, |
| int id) { |
| @@ -318,7 +334,6 @@ WebInputEventResult PointerEventManager::HandleTouchEvents( |
| } |
| UserGestureIndicator holder(possible_gesture_token); |
| - HeapVector<EventHandlingUtil::PointerEventTarget> pointer_event_targets; |
| for (unsigned touch_point_idx = 0; touch_point_idx < event.touches_length; |
| ++touch_point_idx) { |
| @@ -328,17 +343,23 @@ WebInputEventResult PointerEventManager::HandleTouchEvents( |
| EventHandlingUtil::PointerEventTarget pointer_event_target = |
| touch_point_idx ? ComputePointerEventTarget(touch_point) |
| : first_pointer_event_target; |
| - pointer_event_targets.push_back(pointer_event_target); |
| - DispatchTouchPointerEvent( |
| - touch_point, pointer_event_target, |
| - GetCoalescedPoints(coalesced_events, touch_point.id), |
| - static_cast<WebInputEvent::Modifiers>(event.GetModifiers()), |
| - event.TimeStampSeconds(), event.unique_touch_event_id); |
| + if (touch_point.state != blink::WebTouchPoint::kStateStationary) { |
| + DispatchTouchPointerEvent( |
| + touch_point, pointer_event_target, |
| + GetCoalescedPoints(coalesced_events, touch_point.id), |
| + static_cast<WebInputEvent::Modifiers>(event.GetModifiers()), |
| + event.TimeStampSeconds(), event.unique_touch_event_id); |
| + |
| + touch_event_manager_->HandleTouchPoint( |
| + WebPointerEvent(event, event.touches[touch_point_idx]), |
| + GetCoalescedWebPointerEventsWithNoTransformation( |
| + coalesced_events, event.touches[touch_point_idx].id), |
| + pointer_event_target); |
| + } |
| } |
| - return touch_event_manager_->HandleTouchEvent(event, coalesced_events, |
| - pointer_event_targets); |
| + return touch_event_manager_->HandleVSyncSignal(); |
| } |
| EventHandlingUtil::PointerEventTarget |
| @@ -404,7 +425,6 @@ void PointerEventManager::DispatchTouchPointerEvent( |
| // required. |
| // Do not send pointer events for stationary touches or null targetFrame |
| if (pointer_event_target.target_node && pointer_event_target.target_frame && |
|
mustaq
2017/06/08 20:02:52
Why are you not skipping the stationary points her
Navid Zolghadr
2017/06/08 21:18:40
I have moved the check outside of the function and
mustaq
2017/06/09 16:12:26
Sg, thanks.
Please check the comments about stati
|
| - touch_point.state != WebTouchPoint::kStateStationary && |
| !in_canceled_state_for_pointer_type_touch_) { |
| PointerEvent* pointer_event = pointer_event_factory_.Create( |
| touch_point, coalesced_events, |