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

Unified Diff: content/browser/renderer_host/gesture_event_filter.h

Issue 12225056: Coalesce scrollUpdate and pinchUpdate on gesture_event queue (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix build error Created 7 years, 10 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: content/browser/renderer_host/gesture_event_filter.h
diff --git a/content/browser/renderer_host/gesture_event_filter.h b/content/browser/renderer_host/gesture_event_filter.h
index 229904ea8d705d904cd3ca93947610ef25fa694f..ac101e4beb771491d6872ad7b7d3f48203f2b6c7 100644
--- a/content/browser/renderer_host/gesture_event_filter.h
+++ b/content/browser/renderer_host/gesture_event_filter.h
@@ -11,6 +11,7 @@
#include "base/memory/scoped_ptr.h"
#include "base/timer.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h"
+#include "ui/gfx/transform.h"
namespace content {
class MockRenderWidgetHost;
@@ -78,8 +79,9 @@ class GestureEventFilter {
// hence that event should be handled now.
bool ShouldHandleEventNow();
- // Merge or append a GestureScrollUpdate into the coalescing queue.
- void MergeOrInsertScrollEvent(
+ // Merge or append a GestureScrollUpdate or GesturePinchUpdate into
+ // the coalescing queue.
+ void MergeOrInsertScrollAndPinchEvent(
const WebKit::WebGestureEvent& gesture_event);
// Sub-filter for removing bounces from in-progress scrolls.
@@ -91,6 +93,18 @@ class GestureEventFilter {
bool ShouldForwardForTapDeferral(
const WebKit::WebGestureEvent& gesture_event);
+ // Whether the event_in_queue is GesturePinchUpdate or
+ // GestureScrollUpdate and it has the same modifiers as the
+ // new event.
+ bool ShouldTryMerging(const WebKit::WebGestureEvent& new_event,
+ const WebKit::WebGestureEvent& event_in_queue);
+
+ // Returns the transform matrix corresponding to the gesture event.
+ // Assumes the gesture event sent is either GestureScrollUpdate or
+ // GesturePinchUpdate. Returns the identity matrix otherwise.
+ gfx::Transform GetTransformForEvent(
+ const WebKit::WebGestureEvent& gesture_event);
+
// Only a RenderWidgetHostViewImpl can own an instance.
RenderWidgetHostImpl* render_widget_host_;
@@ -101,6 +115,14 @@ class GestureEventFilter {
// True if a GestureScrollUpdate sequence is in progress.
bool scrolling_in_progress_;
+ // True if two related gesture events were sent before without waiting
+ // for an ACK, so the next gesture ACK should be ignored.
+ bool ignore_next_ack_;
+
+ // Transform that holds the combined transform matrix for the current
+ // scroll-pinch sequence at the end of the queue.
+ gfx::Transform combined_scroll_pinch_;
+
// Timer to release a previously deferred GestureTapDown event.
base::OneShotTimer<GestureEventFilter> send_gtd_timer_;

Powered by Google App Engine
This is Rietveld 408576698