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_); |