Chromium Code Reviews| Index: content/browser/renderer_host/input/touch_event_queue.cc |
| diff --git a/content/browser/renderer_host/input/touch_event_queue.cc b/content/browser/renderer_host/input/touch_event_queue.cc |
| index 6adc661be18c5394f4571ac2d037c11b74133cda..d75fa33eec2e39aa56599a95a918c3292429d588 100644 |
| --- a/content/browser/renderer_host/input/touch_event_queue.cc |
| +++ b/content/browser/renderer_host/input/touch_event_queue.cc |
| @@ -46,14 +46,15 @@ bool ShouldTouchTriggerTimeout(const WebTouchEvent& event) { |
| } |
| // Compare all properties of touch points to determine the state. |
| -bool HasPointChanged(const WebTouchPoint& last_point, |
| - const WebTouchPoint& current_point) { |
| - if (last_point.screenPosition != current_point.screenPosition || |
| - last_point.position != current_point.position || |
| - last_point.radiusX != current_point.radiusX || |
| - last_point.radiusY != current_point.radiusY || |
| - last_point.rotationAngle != current_point.rotationAngle || |
| - last_point.force != current_point.force) { |
| +bool HasPointChanged(const WebTouchPoint& point_1, |
| + const WebTouchPoint& point_2) { |
| + DCHECK_EQ(point_1.id, point_2.id); |
| + if (point_1.screenPosition != point_2.screenPosition || |
| + point_1.position != point_2.position || |
| + point_1.radiusX != point_2.radiusX || |
| + point_1.radiusY != point_2.radiusY || |
| + point_1.rotationAngle != point_2.rotationAngle || |
| + point_1.force != point_2.force) { |
| return true; |
| } |
| return false; |
| @@ -729,12 +730,29 @@ TouchEventQueue::FilterBeforeForwarding(const WebTouchEvent& event) { |
| continue; |
| for (size_t j = 0; j < last_sent_touchevent_->touchesLength; ++j) { |
| - if (point.id == last_sent_touchevent_->touches[j].id) |
| + if (point.id != last_sent_touchevent_->touches[j].id) |
| + continue; |
| + |
| + if (event.type != WebInputEvent::TouchMove) |
| return FORWARD_TO_RENDERER; |
| + |
| + // All pointers in TouchMove events may have state as StateMoved, |
| + // even though none of the pointers have not changed in real. |
| + // Forward these events when at least one pointer has changed. |
| + if (HasPointChanged(last_sent_touchevent_->touches[j], point)) |
| + return FORWARD_TO_RENDERER; |
| + |
| + // This is a TouchMove event and not forwarded yet. |
|
jdduke (slow)
2015/02/13 16:37:37
Nit: Maybe reword this like:
// This is a TouchMo
USE s.singapati at gmail.com
2015/02/16 10:52:01
Done.
|
| + // Continue checking the next pointers in the |event|. |
| + break; |
| } |
|
jdduke (slow)
2015/02/13 16:37:37
It's a shame we can't "clean up" the pointer state
USE s.singapati at gmail.com
2015/02/16 10:52:01
Acknowledged. Lets see if this can be done may be
|
| + |
| } |
| } |
| + if (event.type == WebInputEvent::TouchMove) |
|
jdduke (slow)
2015/02/13 16:37:37
This isn't always correct. Let's just go ahead and
USE s.singapati at gmail.com
2015/02/16 10:52:01
Done.
|
| + return ACK_WITH_NOT_CONSUMED; |
| + |
| return ACK_WITH_NO_CONSUMER_EXISTS; |
| } |