libcef/browser/osr/motion_event_osr.cc
// We can't cleanup removed touch points immediately upon receipt of a
// TouchCancel or TouchRelease, as the MotionEvent needs to be able to report
// information about those touch events. Once the MotionEvent has been
// processed, we call CleanupRemovedTouchPoints to do the required
// book-keeping.
We can't cleanup removed touch points immediately upon receipt of a
TouchCancel or TouchRelease, as the MotionEvent needs to be able to report
information about those touch events. Once the MotionEvent has been
processed, we call CleanupRemovedTouchPoints to do the required
book-keeping.
We can ' t cleanup removed touch points immediately upon receipt of a TouchCancel or TouchRelease as the MotionEvent needs to be able to report information about those touch events . Once the MotionEvent has been processed we call CleanupRemovedTouchPoints to do the required book - keeping .
void CefMotionEventOSR::CleanupRemovedTouchPoints(const CefTouchEvent& event) {
  if (event.type != CEF_TET_RELEASED && event.type != CEF_TET_CANCELLED) {
    return;
  }
  DCHECK(GetPointerCount());
  int id = LookupId(event.id);
  int index_to_delete = FindPointerIndexOfId(id);
  set_action_index(-1);
  set_action(ui::MotionEvent::Action::NONE);
  if (IsValidIndex(index_to_delete)) {
    pointer(index_to_delete) = pointer(GetPointerCount() - 1);
    PopPointer();
    RemoveId(event.id);
  }
}
void CefMotionEventOSR :: CleanupRemovedTouchPoints ( const CefTouchEvent & event ) { if ( event . type != CEF_TET_RELEASED && event . type != CEF_TET_CANCELLED ) { return ; } DCHECK ( GetPointerCount ( ) ) ; int id = LookupId ( event . id ) ; int index_to_delete = FindPointerIndexOfId ( id ) ; set_action_index ( -1 ) ; set_action ( ui :: MotionEvent :: Action :: NONE ) ; if ( IsValidIndex ( index_to_delete ) ) { pointer ( index_to_delete ) = pointer ( GetPointerCount ( ) - 1 ) ; PopPointer ( ) ; RemoveId ( event . id ) ; } }
We can't cleanup removed touch points immediately upon receipt of a
TouchCancel or TouchRelease, as the MotionEvent needs to be able to report
information about those touch events.
We can ' t cleanup removed touch points immediately upon receipt of a TouchCancel or TouchRelease as the MotionEvent needs to be able to report information about those touch events .