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

Unified Diff: third_party/WebKit/Source/core/input/TouchEventManager.cpp

Issue 2844823002: Support Coalesced Touch in ppapi (Closed)
Patch Set: Support Coalesced Touch in ppapi Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/input/TouchEventManager.cpp
diff --git a/third_party/WebKit/Source/core/input/TouchEventManager.cpp b/third_party/WebKit/Source/core/input/TouchEventManager.cpp
index 7505b622e2493554db2404f460e56dc65675aae3..846196fed56bd2384b1791970ff15fe0f021445d 100644
--- a/third_party/WebKit/Source/core/input/TouchEventManager.cpp
+++ b/third_party/WebKit/Source/core/input/TouchEventManager.cpp
@@ -19,6 +19,7 @@
#include "platform/Histogram.h"
#include "platform/wtf/CurrentTime.h"
#include "platform/wtf/PtrUtil.h"
+#include "public/platform/WebCoalescedInputEvent.h"
#include "public/platform/WebTouchEvent.h"
namespace blink {
@@ -118,6 +119,7 @@ DEFINE_TRACE(TouchEventManager) {
WebInputEventResult TouchEventManager::DispatchTouchEvents(
const WebTouchEvent& event,
+ const Vector<WebTouchEvent>& coalesced_events,
const HeapVector<TouchInfo>& touch_infos,
bool all_touches_released) {
// Build up the lists to use for the |touches|, |targetTouches| and
@@ -201,6 +203,13 @@ WebInputEventResult TouchEventManager::DispatchTouchEvents(
}
WebInputEventResult event_result = WebInputEventResult::kNotHandled;
+ // First we construct the webcoalescedinputevent contains all the coalesced
+ // touch event.
+ std::vector<const WebInputEvent*> coalesced_touches;
+ for (size_t i = 0; i < coalesced_events.size(); ++i) {
+ coalesced_touches.push_back(&coalesced_events[i]);
+ }
+ WebCoalescedInputEvent coalesced_event(event, coalesced_touches);
// Now iterate through the |changedTouches| list and |m_targets| within it,
// sending TouchEvents to the targets as required.
@@ -213,7 +222,7 @@ WebInputEventResult TouchEventManager::DispatchTouchEvents(
for (const auto& event_target : changed_touches[state].targets_) {
EventTarget* touch_event_target = event_target;
TouchEvent* touch_event = TouchEvent::Create(
- event, touches, touches_by_target.at(touch_event_target),
+ coalesced_event, touches, touches_by_target.at(touch_event_target),
changed_touches[state].touches_.Get(), event_name,
touch_event_target->ToNode()->GetDocument().domWindow(),
current_touch_action_);
@@ -505,6 +514,7 @@ bool TouchEventManager::ReHitTestTouchPointsIfNeeded(
WebInputEventResult TouchEventManager::HandleTouchEvent(
const WebTouchEvent& event,
+ const Vector<WebTouchEvent>& coalesced_events,
HeapVector<TouchInfo>& touch_infos) {
if (!ReHitTestTouchPointsIfNeeded(event, touch_infos))
return WebInputEventResult::kNotHandled;
@@ -517,7 +527,8 @@ WebInputEventResult TouchEventManager::HandleTouchEvent(
all_touches_released = false;
}
- return DispatchTouchEvents(event, touch_infos, all_touches_released);
+ return DispatchTouchEvents(event, coalesced_events, touch_infos,
+ all_touches_released);
}
bool TouchEventManager::IsAnyTouchActive() const {

Powered by Google App Engine
This is Rietveld 408576698