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

Unified Diff: ui/events/blink/blink_event_util.h

Issue 2552853002: [Compositor event queue] Coalesce gesture scroll&pinch of the same sequence (Closed)
Patch Set: sadrul's comments, fix dependency Created 4 years 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
« no previous file with comments | « ui/events/blink/DEPS ('k') | ui/events/blink/blink_event_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/blink/blink_event_util.h
diff --git a/ui/events/blink/blink_event_util.h b/ui/events/blink/blink_event_util.h
index 5636d58b28511f0351c00c98d97ee86d628772f1..8eae9b03e088714415629b1ad6140d34aba7affe 100644
--- a/ui/events/blink/blink_event_util.h
+++ b/ui/events/blink/blink_event_util.h
@@ -7,12 +7,11 @@
#include <memory>
+#include "third_party/WebKit/public/platform/WebGestureEvent.h"
#include "third_party/WebKit/public/platform/WebInputEvent.h"
#include "ui/events/gesture_detection/motion_event.h"
namespace blink {
-class WebGestureEvent;
-class WebInputEvent;
class WebTouchEvent;
}
@@ -33,6 +32,16 @@ bool CanCoalesce(const blink::WebInputEvent& event_to_coalesce,
void Coalesce(const blink::WebInputEvent& event_to_coalesce,
blink::WebInputEvent* event);
+bool IsCompatibleScrollorPinch(const blink::WebGestureEvent& new_event,
+ const blink::WebGestureEvent& event_in_queue);
+
+// Coalesces 3 GestureScroll/PinchUpdate into 2 events.
+// Returns <GestureScrollUpdate, GesturePinchUpdate>.
+std::pair<blink::WebGestureEvent, blink::WebGestureEvent>
+CoalesceScrollAndPinch(const blink::WebGestureEvent* second_last_event,
+ const blink::WebGestureEvent& last_event,
+ const blink::WebGestureEvent& new_event);
+
blink::WebTouchEvent CreateWebTouchEventFromMotionEvent(
const MotionEvent& event,
bool may_cause_scrolling);
@@ -84,6 +93,12 @@ bool IsGestureScollOrPinch(blink::WebInputEvent::Type);
bool IsContinuousGestureEvent(blink::WebInputEvent::Type);
+inline const blink::WebGestureEvent& ToWebGestureEvent(
+ const blink::WebInputEvent& event) {
+ DCHECK(IsGestureScollOrPinch(event.type));
+ return static_cast<const blink::WebGestureEvent&>(event);
+}
+
} // namespace ui
#endif // UI_EVENTS_BLINK_BLINK_EVENT_UTIL_H_
« no previous file with comments | « ui/events/blink/DEPS ('k') | ui/events/blink/blink_event_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698