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

Unified Diff: cc/animation/keyframed_animation_curve.cc

Issue 1076313006: Animation start scale should be considered for the raster scale (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebasing and Added more tests Created 5 years, 8 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
« no previous file with comments | « cc/animation/keyframed_animation_curve.h ('k') | cc/animation/keyframed_animation_curve_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/animation/keyframed_animation_curve.cc
diff --git a/cc/animation/keyframed_animation_curve.cc b/cc/animation/keyframed_animation_curve.cc
index bf65df8f20f00ca694b0f7b604ece794f76fdede..f8f6021b1881e70f26ebcdcb6bc57bd62ce31c3f 100644
--- a/cc/animation/keyframed_animation_curve.cc
+++ b/cc/animation/keyframed_animation_curve.cc
@@ -379,7 +379,27 @@ bool KeyframedTransformAnimationCurve::IsTranslation() const {
}
return true;
}
+bool KeyframedTransformAnimationCurve::AnimationStartScale(
+ bool forward_direction,
+ float* start_scale) const {
+ DCHECK_GE(keyframes_.size(), 2ul);
+ *start_scale = 0.f;
+ size_t start_location = 0;
+ if (!forward_direction) {
+ start_location = keyframes_.size() - 1;
+ }
+ gfx::Vector3dF initial_target_scale;
+ if (!keyframes_[start_location]->Value().ScaleComponent(
+ &initial_target_scale))
+ return false;
+ float start_scale_for_segment =
+ fmax(std::abs(initial_target_scale.x()),
+ fmax(std::abs(initial_target_scale.y()),
+ std::abs(initial_target_scale.z())));
+ *start_scale = start_scale_for_segment;
+ return true;
+}
bool KeyframedTransformAnimationCurve::MaximumTargetScale(
bool forward_direction,
float* max_scale) const {
« no previous file with comments | « cc/animation/keyframed_animation_curve.h ('k') | cc/animation/keyframed_animation_curve_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698