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

Side by Side Diff: third_party/WebKit/Source/web/WebViewImpl.cpp

Issue 2908073008: Remove a frame of delay on main-thread FlingStart. [2nd land] (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
« no previous file with comments | « third_party/WebKit/Source/platform/exported/WebActiveGestureAnimation.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 681 matching lines...) Expand 10 before | Expand all | Expand 10 after
692 fling_modifier_ = event.GetModifiers(); 692 fling_modifier_ = event.GetModifiers();
693 fling_source_device_ = event.source_device; 693 fling_source_device_ = event.source_device;
694 DCHECK_NE(fling_source_device_, kWebGestureDeviceUninitialized); 694 DCHECK_NE(fling_source_device_, kWebGestureDeviceUninitialized);
695 std::unique_ptr<WebGestureCurve> fling_curve = 695 std::unique_ptr<WebGestureCurve> fling_curve =
696 Platform::Current()->CreateFlingAnimationCurve( 696 Platform::Current()->CreateFlingAnimationCurve(
697 event.source_device, 697 event.source_device,
698 WebFloatPoint(event.data.fling_start.velocity_x, 698 WebFloatPoint(event.data.fling_start.velocity_x,
699 event.data.fling_start.velocity_y), 699 event.data.fling_start.velocity_y),
700 WebSize()); 700 WebSize());
701 DCHECK(fling_curve); 701 DCHECK(fling_curve);
702 gesture_animation_ = WebActiveGestureAnimation::CreateAtAnimationStart( 702 gesture_animation_ = WebActiveGestureAnimation::CreateWithTimeOffset(
dtapuska 2017/05/31 00:53:11 Do we want this to be the event creation time or N
aelias_OOO_until_Jul13 2017/05/31 01:07:06 My rule of thumb is that in cases of jank during a
703 std::move(fling_curve), this); 703 std::move(fling_curve), this, event.TimeStampSeconds());
704 MainFrameImpl()->FrameWidget()->ScheduleAnimation(); 704 MainFrameImpl()->FrameWidget()->ScheduleAnimation();
705 event_result = WebInputEventResult::kHandledSystem; 705 event_result = WebInputEventResult::kHandledSystem;
706 706
707 WebGestureEvent scaled_event = 707 WebGestureEvent scaled_event =
708 TransformWebGestureEvent(MainFrameImpl()->GetFrameView(), event); 708 TransformWebGestureEvent(MainFrameImpl()->GetFrameView(), event);
709 // Plugins may need to see GestureFlingStart to balance 709 // Plugins may need to see GestureFlingStart to balance
710 // GestureScrollBegin (since the former replaces GestureScrollEnd when 710 // GestureScrollBegin (since the former replaces GestureScrollEnd when
711 // transitioning to a fling). 711 // transitioning to a fling).
712 // TODO(dtapuska): Why isn't the response used? 712 // TODO(dtapuska): Why isn't the response used?
713 MainFrameImpl()->GetFrame()->GetEventHandler().HandleGestureScrollEvent( 713 MainFrameImpl()->GetFrame()->GetEventHandler().HandleGestureScrollEvent(
(...skipping 3437 matching lines...) Expand 10 before | Expand all | Expand 10 after
4151 if (focused_frame->LocalFrameRoot() != MainFrameImpl()->GetFrame()) 4151 if (focused_frame->LocalFrameRoot() != MainFrameImpl()->GetFrame())
4152 return nullptr; 4152 return nullptr;
4153 return focused_frame; 4153 return focused_frame;
4154 } 4154 }
4155 4155
4156 LocalFrame* WebViewImpl::FocusedLocalFrameAvailableForIme() const { 4156 LocalFrame* WebViewImpl::FocusedLocalFrameAvailableForIme() const {
4157 return ime_accept_events_ ? FocusedLocalFrameInWidget() : nullptr; 4157 return ime_accept_events_ ? FocusedLocalFrameInWidget() : nullptr;
4158 } 4158 }
4159 4159
4160 } // namespace blink 4160 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/exported/WebActiveGestureAnimation.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698