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

Side by Side Diff: content/browser/renderer_host/input/input_router_impl.cc

Issue 2715623002: Add a passthrough touch event queue. (Closed)
Patch Set: Rebase on throttling change Created 3 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "content/browser/renderer_host/input/input_router_impl.h" 5 #include "content/browser/renderer_host/input/input_router_impl.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
11 #include "base/auto_reset.h" 11 #include "base/auto_reset.h"
12 #include "base/command_line.h" 12 #include "base/command_line.h"
13 #include "base/memory/ptr_util.h" 13 #include "base/memory/ptr_util.h"
14 #include "base/metrics/histogram_macros.h" 14 #include "base/metrics/histogram_macros.h"
15 #include "base/strings/string_number_conversions.h" 15 #include "base/strings/string_number_conversions.h"
16 #include "content/browser/renderer_host/input/gesture_event_queue.h" 16 #include "content/browser/renderer_host/input/gesture_event_queue.h"
17 #include "content/browser/renderer_host/input/input_ack_handler.h" 17 #include "content/browser/renderer_host/input/input_ack_handler.h"
18 #include "content/browser/renderer_host/input/input_router_client.h" 18 #include "content/browser/renderer_host/input/input_router_client.h"
19 #include "content/browser/renderer_host/input/legacy_touch_event_queue.h" 19 #include "content/browser/renderer_host/input/legacy_touch_event_queue.h"
20 #include "content/browser/renderer_host/input/passthrough_touch_event_queue.h"
20 #include "content/browser/renderer_host/input/touch_event_queue.h" 21 #include "content/browser/renderer_host/input/touch_event_queue.h"
21 #include "content/browser/renderer_host/input/touchpad_tap_suppression_controlle r.h" 22 #include "content/browser/renderer_host/input/touchpad_tap_suppression_controlle r.h"
22 #include "content/common/content_constants_internal.h" 23 #include "content/common/content_constants_internal.h"
23 #include "content/common/edit_command.h" 24 #include "content/common/edit_command.h"
24 #include "content/common/input/input_event_ack_state.h" 25 #include "content/common/input/input_event_ack_state.h"
25 #include "content/common/input/touch_action.h" 26 #include "content/common/input/touch_action.h"
26 #include "content/common/input/web_touch_event_traits.h" 27 #include "content/common/input/web_touch_event_traits.h"
27 #include "content/common/input_messages.h" 28 #include "content/common/input_messages.h"
28 #include "content/common/view_messages.h" 29 #include "content/common/view_messages.h"
29 #include "content/public/browser/notification_service.h" 30 #include "content/public/browser/notification_service.h"
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 frame_tree_node_id_(-1), 85 frame_tree_node_id_(-1),
85 select_message_pending_(false), 86 select_message_pending_(false),
86 move_caret_pending_(false), 87 move_caret_pending_(false),
87 current_ack_source_(ACK_SOURCE_NONE), 88 current_ack_source_(ACK_SOURCE_NONE),
88 flush_requested_(false), 89 flush_requested_(false),
89 active_renderer_fling_count_(0), 90 active_renderer_fling_count_(0),
90 touch_scroll_started_sent_(false), 91 touch_scroll_started_sent_(false),
91 wheel_event_queue_(this, 92 wheel_event_queue_(this,
92 base::FeatureList::IsEnabled( 93 base::FeatureList::IsEnabled(
93 features::kTouchpadAndWheelScrollLatching)), 94 features::kTouchpadAndWheelScrollLatching)),
94 touch_event_queue_(new LegacyTouchEventQueue(this, config.touch_config)),
95 gesture_event_queue_(this, this, config.gesture_config), 95 gesture_event_queue_(this, this, config.gesture_config),
96 device_scale_factor_(1.f) { 96 device_scale_factor_(1.f) {
97 if (base::FeatureList::IsEnabled(features::kRafAlignedTouchInputEvents))
98 touch_event_queue_.reset(
99 new PassthroughTouchEventQueue(this, config.touch_config));
100 else
101 touch_event_queue_.reset(
102 new LegacyTouchEventQueue(this, config.touch_config));
103
97 DCHECK(sender); 104 DCHECK(sender);
98 DCHECK(client); 105 DCHECK(client);
99 DCHECK(ack_handler); 106 DCHECK(ack_handler);
100 UpdateTouchAckTimeoutEnabled(); 107 UpdateTouchAckTimeoutEnabled();
101 } 108 }
102 109
103 InputRouterImpl::~InputRouterImpl() { 110 InputRouterImpl::~InputRouterImpl() {
104 } 111 }
105 112
106 bool InputRouterImpl::SendInput(std::unique_ptr<IPC::Message> message) { 113 bool InputRouterImpl::SendInput(std::unique_ptr<IPC::Message> message) {
(...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after
661 DCHECK(global_touch_position_.find(touch_point->id) == 668 DCHECK(global_touch_position_.find(touch_point->id) ==
662 global_touch_position_.end()); 669 global_touch_position_.end());
663 global_touch_position_[touch_point->id] = gfx::Point( 670 global_touch_position_[touch_point->id] = gfx::Point(
664 touch_point->screenPosition.x, touch_point->screenPosition.y); 671 touch_point->screenPosition.x, touch_point->screenPosition.y);
665 } 672 }
666 } 673 }
667 } 674 }
668 } 675 }
669 676
670 } // namespace content 677 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698