Chromium Code Reviews| Index: cc/animation/keyframed_animation_curve.cc |
| diff --git a/cc/animation/keyframed_animation_curve.cc b/cc/animation/keyframed_animation_curve.cc |
| index bcf067ebb74b1f79a7416b33fd7f6f9070271f24..d7bc8ce0d62c9a7ad1973c92b414e474f753182e 100644 |
| --- a/cc/animation/keyframed_animation_curve.cc |
| +++ b/cc/animation/keyframed_animation_curve.cc |
| @@ -366,7 +366,8 @@ bool KeyframedTransformAnimationCurve::IsTranslation() const { |
| return true; |
| } |
| -bool KeyframedTransformAnimationCurve::MaximumScale(float* max_scale) const { |
| +bool KeyframedTransformAnimationCurve::MaximumTargetScale( |
| + float* max_scale) const { |
| DCHECK_GE(keyframes_.size(), 2ul); |
| *max_scale = 0.f; |
| for (size_t i = 1; i < keyframes_.size(); ++i) { |
| @@ -375,14 +376,14 @@ bool KeyframedTransformAnimationCurve::MaximumScale(float* max_scale) const { |
| if (keyframes_[i - 1]->timing_function()) |
| keyframes_[i - 1]->timing_function()->Range(&min_progress, &max_progress); |
| - float max_scale_for_segment = 0.f; |
| - if (!keyframes_[i]->Value().MaximumScale(keyframes_[i - 1]->Value(), |
| - min_progress, |
| - max_progress, |
| - &max_scale_for_segment)) |
| + gfx::Vector3dF target_scale_for_segment; |
| + if (!keyframes_[i]->Value().ScaleComponent(&target_scale_for_segment)) |
| return false; |
| - |
| - *max_scale = std::max(*max_scale, max_scale_for_segment); |
| + float max_scale_for_segment = |
| + fmaxf(std::abs(target_scale_for_segment.x()), |
|
vmpstr
2014/10/10 03:31:23
hehe, why fmaxf then? :P Also, should this be std:
danakj
2014/10/10 05:30:11
Its not in std:: it actually is a co.piler define
vmpstr
2014/10/10 07:26:24
If it's cheaper, then that's good enough. Right ma
|
| + fmaxf(std::abs(target_scale_for_segment.y()), |
| + std::abs(target_scale_for_segment.z()))); |
| + *max_scale = fmaxf(*max_scale, max_scale_for_segment); |
| } |
| return true; |
| } |