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

Unified Diff: content/browser/renderer_host/input/input_router_impl.h

Issue 1405613002: Support vsync-aligned wheel event dispatch (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@input_cleanup_todo
Patch Set: Rebase Created 5 years, 2 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/input/input_router_impl.h
diff --git a/content/browser/renderer_host/input/input_router_impl.h b/content/browser/renderer_host/input/input_router_impl.h
index 189d93ddd047fa2aa730ab2647ea2d952969c9ae..67d71a45bed4f4971c6f056f28b3d8f2d098c375 100644
--- a/content/browser/renderer_host/input/input_router_impl.h
+++ b/content/browser/renderer_host/input/input_router_impl.h
@@ -9,13 +9,13 @@
#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
-#include "base/memory/scoped_vector.h"
#include "base/time/time.h"
#include "content/browser/renderer_host/input/gesture_event_queue.h"
#include "content/browser/renderer_host/input/input_router.h"
#include "content/browser/renderer_host/input/touch_action_filter.h"
#include "content/browser/renderer_host/input/touch_event_queue.h"
#include "content/browser/renderer_host/input/touchpad_tap_suppression_controller.h"
+#include "content/browser/renderer_host/input/wheel_event_queue.h"
#include "content/common/input/input_event_stream_validator.h"
#include "content/public/browser/native_web_keyboard_event.h"
@@ -40,12 +40,14 @@ class CONTENT_EXPORT InputRouterImpl
: public NON_EXPORTED_BASE(InputRouter),
public NON_EXPORTED_BASE(GestureEventQueueClient),
public NON_EXPORTED_BASE(TouchEventQueueClient),
- public NON_EXPORTED_BASE(TouchpadTapSuppressionControllerClient) {
+ public NON_EXPORTED_BASE(TouchpadTapSuppressionControllerClient),
+ public NON_EXPORTED_BASE(WheelEventQueueClient) {
public:
struct CONTENT_EXPORT Config {
Config();
GestureEventQueue::Config gesture_config;
TouchEventQueue::Config touch_config;
+ bool buffer_wheel_events_until_flush;
};
InputRouterImpl(IPC::Sender* sender,
@@ -86,14 +88,21 @@ private:
void OnTouchEventAck(const TouchEventWithLatencyInfo& event,
InputEventAckState ack_result) override;
- // GetureEventFilterClient
+ // GestureEventQueueClient
void SendGestureEventImmediately(
const GestureEventWithLatencyInfo& gesture_event) override;
void OnGestureEventAck(const GestureEventWithLatencyInfo& event,
InputEventAckState ack_result) override;
- bool SendMoveCaret(scoped_ptr<IPC::Message> message);
+ // WheelEventQueueClient
+ void SendWheelEventImmediately(
+ const MouseWheelEventWithLatencyInfo& wheel_event) override;
+ void OnWheelEventAck(const MouseWheelEventWithLatencyInfo& event,
+ InputEventAckState ack_result) override;
+ void SetNeedsFlush() override;
+
bool SendSelectMessage(scoped_ptr<IPC::Message> message);
+ bool SendMoveCaret(scoped_ptr<IPC::Message> message);
bool Send(IPC::Message* message);
// Filters and forwards |input_event| to the appropriate handler.
@@ -209,21 +218,6 @@ private:
scoped_ptr<MouseEventWithLatencyInfo> next_mouse_move_;
MouseEventWithLatencyInfo current_mouse_move_;
- // (Similar to |mouse_move_pending_|.) True if a mouse wheel event was sent
- // and we are waiting for a corresponding ack.
- bool mouse_wheel_pending_;
- MouseWheelEventWithLatencyInfo current_wheel_event_;
-
- // (Similar to |next_mouse_move_|.) The next mouse wheel events to send.
- // Unlike mouse moves, mouse wheel events received while one is pending are
- // coalesced (by accumulating deltas) if they match the previous event in
- // modifiers. On the Mac, in particular, mouse wheel events are received at a
- // high rate; not waiting for the ack results in jankiness, and using the same
- // mechanism as for mouse moves (just dropping old events when multiple ones
- // would be queued) results in very slow scrolling.
- typedef std::deque<MouseWheelEventWithLatencyInfo> WheelEventQueue;
- WheelEventQueue coalesced_mouse_wheel_events_;
-
// A queue of keyboard events. We can't trust data from the renderer so we
// stuff key events into a queue and pop them out on ACK, feeding our copy
// back to whatever unhandled handler instead of the returned version.
@@ -248,6 +242,7 @@ private:
TouchEventQueue touch_event_queue_;
GestureEventQueue gesture_event_queue_;
+ WheelEventQueue wheel_event_queue_;
TouchActionFilter touch_action_filter_;
InputEventStreamValidator input_stream_validator_;
InputEventStreamValidator output_stream_validator_;

Powered by Google App Engine
This is Rietveld 408576698