Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(100)

Side by Side Diff: third_party/WebKit/Source/core/input/PointerEventManager.cpp

Issue 2770713006: Filter out stationary touches from coalesced list (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/input/PointerEventManager.h" 5 #include "core/input/PointerEventManager.h"
6 6
7 #include "core/dom/DocumentUserGestureToken.h" 7 #include "core/dom/DocumentUserGestureToken.h"
8 #include "core/dom/ElementTraversal.h" 8 #include "core/dom/ElementTraversal.h"
9 #include "core/dom/shadow/FlatTreeTraversal.h" 9 #include "core/dom/shadow/FlatTreeTraversal.h"
10 #include "core/events/MouseEvent.h" 10 #include "core/events/MouseEvent.h"
(...skipping 21 matching lines...) Expand all
32 bool isInDocument(EventTarget* n) { 32 bool isInDocument(EventTarget* n) {
33 return n && n->toNode() && n->toNode()->isConnected(); 33 return n && n->toNode() && n->toNode()->isConnected();
34 } 34 }
35 35
36 Vector<WebTouchPoint> getCoalescedPoints( 36 Vector<WebTouchPoint> getCoalescedPoints(
37 const Vector<WebTouchEvent>& coalescedEvents, 37 const Vector<WebTouchEvent>& coalescedEvents,
38 int id) { 38 int id) {
39 Vector<WebTouchPoint> relatedPoints; 39 Vector<WebTouchPoint> relatedPoints;
40 for (const auto& touchEvent : coalescedEvents) { 40 for (const auto& touchEvent : coalescedEvents) {
41 for (unsigned i = 0; i < touchEvent.touchesLength; ++i) { 41 for (unsigned i = 0; i < touchEvent.touchesLength; ++i) {
42 // TODO(nzolghadr): Need to filter out stationary points 42 if (touchEvent.touches[i].id == id &&
43 if (touchEvent.touches[i].id == id) 43 touchEvent.touches[i].state != WebTouchPoint::StateStationary)
44 relatedPoints.push_back(touchEvent.touchPointInRootFrame(i)); 44 relatedPoints.push_back(touchEvent.touchPointInRootFrame(i));
45 } 45 }
46 } 46 }
47 return relatedPoints; 47 return relatedPoints;
48 } 48 }
49 49
50 } // namespace 50 } // namespace
51 51
52 PointerEventManager::PointerEventManager(LocalFrame& frame, 52 PointerEventManager::PointerEventManager(LocalFrame& frame,
53 MouseEventManager& mouseEventManager) 53 MouseEventManager& mouseEventManager)
(...skipping 662 matching lines...) Expand 10 before | Expand all | Expand 10 after
716 if (firstId > uniqueTouchEventId) 716 if (firstId > uniqueTouchEventId)
717 return false; 717 return false;
718 m_touchIdsForCanceledPointerdowns.takeFirst(); 718 m_touchIdsForCanceledPointerdowns.takeFirst();
719 if (firstId == uniqueTouchEventId) 719 if (firstId == uniqueTouchEventId)
720 return true; 720 return true;
721 } 721 }
722 return false; 722 return false;
723 } 723 }
724 724
725 } // namespace blink 725 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698