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

Unified Diff: third_party/WebKit/Source/platform/exported/WebActiveGestureAnimation.cpp

Issue 2917823003: Revert of Remove a frame of delay on main-thread FlingStart. (Closed)
Patch Set: Created 3 years, 7 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: third_party/WebKit/Source/platform/exported/WebActiveGestureAnimation.cpp
diff --git a/third_party/WebKit/Source/platform/exported/WebActiveGestureAnimation.cpp b/third_party/WebKit/Source/platform/exported/WebActiveGestureAnimation.cpp
index aa3070dc4770677cba78758327d6bf758a03d090..a149026038ba9d64ea76b3c6598f0226dff8302e 100644
--- a/third_party/WebKit/Source/platform/exported/WebActiveGestureAnimation.cpp
+++ b/third_party/WebKit/Source/platform/exported/WebActiveGestureAnimation.cpp
@@ -33,12 +33,20 @@
namespace blink {
std::unique_ptr<WebActiveGestureAnimation>
+WebActiveGestureAnimation::CreateAtAnimationStart(
+ std::unique_ptr<WebGestureCurve> curve,
+ WebGestureCurveTarget* target) {
+ return WTF::WrapUnique(
+ new WebActiveGestureAnimation(std::move(curve), target, 0, true));
+}
+
+std::unique_ptr<WebActiveGestureAnimation>
WebActiveGestureAnimation::CreateWithTimeOffset(
std::unique_ptr<WebGestureCurve> curve,
WebGestureCurveTarget* target,
double start_time) {
- return WTF::WrapUnique(
- new WebActiveGestureAnimation(std::move(curve), target, start_time));
+ return WTF::WrapUnique(new WebActiveGestureAnimation(std::move(curve), target,
+ start_time, false));
}
WebActiveGestureAnimation::~WebActiveGestureAnimation() {}
@@ -46,10 +54,18 @@
WebActiveGestureAnimation::WebActiveGestureAnimation(
std::unique_ptr<WebGestureCurve> curve,
WebGestureCurveTarget* target,
- double start_time)
- : start_time_(start_time), curve_(std::move(curve)), target_(target) {}
+ double start_time,
+ bool waiting_for_first_tick)
+ : start_time_(start_time),
+ waiting_for_first_tick_(waiting_for_first_tick),
+ curve_(std::move(curve)),
+ target_(target) {}
bool WebActiveGestureAnimation::Animate(double time) {
+ if (waiting_for_first_tick_) {
+ start_time_ = time;
+ waiting_for_first_tick_ = false;
+ }
// All WebGestureCurves assume zero-based time, so we subtract
// the animation start time before passing to the curve.
return curve_->Apply(time - start_time_, target_);
« no previous file with comments | « third_party/WebKit/Source/platform/exported/WebActiveGestureAnimation.h ('k') | third_party/WebKit/Source/web/WebViewImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698