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

Side by Side Diff: ui/events/gestures/gesture_recognizer_impl.cc

Issue 2953563002: Revert of [VSync Queue] Plug touch ack to gesture events and flush vsync queue if necessary (Closed)
Patch Set: Created 3 years, 6 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ui/events/gestures/gesture_recognizer_impl.h" 5 #include "ui/events/gestures/gesture_recognizer_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <limits> 9 #include <limits>
10 #include <memory> 10 #include <memory>
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 return false; 275 return false;
276 276
277 GestureProviderAura* gesture_provider = 277 GestureProviderAura* gesture_provider =
278 GetGestureProviderForConsumer(consumer); 278 GetGestureProviderForConsumer(consumer);
279 return gesture_provider->OnTouchEvent(event); 279 return gesture_provider->OnTouchEvent(event);
280 } 280 }
281 281
282 GestureRecognizer::Gestures GestureRecognizerImpl::AckTouchEvent( 282 GestureRecognizer::Gestures GestureRecognizerImpl::AckTouchEvent(
283 uint32_t unique_event_id, 283 uint32_t unique_event_id,
284 ui::EventResult result, 284 ui::EventResult result,
285 bool is_source_touch_event_set_non_blocking,
286 GestureConsumer* consumer) { 285 GestureConsumer* consumer) {
287 GestureProviderAura* gesture_provider = nullptr; 286 GestureProviderAura* gesture_provider = nullptr;
288 287
289 // Check if we have already processed this event before dispatch and have a 288 // Check if we have already processed this event before dispatch and have a
290 // consumer associated with it. 289 // consumer associated with it.
291 auto event_to_gesture_provider_iterator = 290 auto event_to_gesture_provider_iterator =
292 event_to_gesture_provider_.find(unique_event_id); 291 event_to_gesture_provider_.find(unique_event_id);
293 if (event_to_gesture_provider_iterator != event_to_gesture_provider_.end()) { 292 if (event_to_gesture_provider_iterator != event_to_gesture_provider_.end()) {
294 gesture_provider = event_to_gesture_provider_iterator->second; 293 gesture_provider = event_to_gesture_provider_iterator->second;
295 event_to_gesture_provider_.erase(event_to_gesture_provider_iterator); 294 event_to_gesture_provider_.erase(event_to_gesture_provider_iterator);
296 } else { 295 } else {
297 gesture_provider = GetGestureProviderForConsumer(consumer); 296 gesture_provider = GetGestureProviderForConsumer(consumer);
298 } 297 }
299 gesture_provider->OnTouchEventAck(unique_event_id, result != ER_UNHANDLED, 298 gesture_provider->OnTouchEventAck(unique_event_id, result != ER_UNHANDLED);
300 is_source_touch_event_set_non_blocking);
301 return gesture_provider->GetAndResetPendingGestures(); 299 return gesture_provider->GetAndResetPendingGestures();
302 } 300 }
303 301
304 bool GestureRecognizerImpl::CleanupStateForConsumer( 302 bool GestureRecognizerImpl::CleanupStateForConsumer(
305 GestureConsumer* consumer) { 303 GestureConsumer* consumer) {
306 bool state_cleaned_up = false; 304 bool state_cleaned_up = false;
307 305
308 auto consumer_gesture_provider_it = consumer_gesture_provider_.find(consumer); 306 auto consumer_gesture_provider_it = consumer_gesture_provider_.find(consumer);
309 if (consumer_gesture_provider_it != consumer_gesture_provider_.end()) { 307 if (consumer_gesture_provider_it != consumer_gesture_provider_.end()) {
310 // Remove gesture provider associated with the consumer from 308 // Remove gesture provider associated with the consumer from
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 std::vector<GestureEventHelper*>::iterator it; 371 std::vector<GestureEventHelper*>::iterator it;
374 for (it = helpers.begin(); it != helpers.end(); ++it) 372 for (it = helpers.begin(); it != helpers.end(); ++it)
375 gesture_recognizer->AddGestureEventHelper(*it); 373 gesture_recognizer->AddGestureEventHelper(*it);
376 374
377 helpers.clear(); 375 helpers.clear();
378 g_gesture_recognizer_instance = 376 g_gesture_recognizer_instance =
379 static_cast<GestureRecognizerImpl*>(gesture_recognizer); 377 static_cast<GestureRecognizerImpl*>(gesture_recognizer);
380 } 378 }
381 379
382 } // namespace ui 380 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/gestures/gesture_recognizer_impl.h ('k') | ui/events/gestures/gesture_recognizer_impl_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698