Lines Matching refs:fraction

29 inline constexpr float lerp(float fromValue, float toValue, float fraction) {
30 return float (fromValue * (1 - fraction) + toValue * fraction);
39 const SkColor& fromColor, const SkColor& toColor, float fraction) const {
40 float a = lerp(SkColorGetA(fromColor) / 255.0f, SkColorGetA(toColor) / 255.0f, fraction);
41 float r = lerp(linearize(SkColorGetR(fromColor)), linearize(SkColorGetR(toColor)), fraction);
42 float g = lerp(linearize(SkColorGetG(fromColor)), linearize(SkColorGetG(toColor)), fraction);
43 float b = lerp(linearize(SkColorGetB(fromColor)), linearize(SkColorGetB(toColor)), fraction);
52 const PathData& from, const PathData& to, float fraction) const {
53 VectorDrawableUtils::interpolatePaths(out, from, to, fraction);
57 const T PropertyValuesHolderImpl<T>::getValueFromData(float fraction) const {
62 if (fraction <= 0.0f) {
65 if (fraction >= 1.0f) {
69 fraction *= mDataSource.size() - 1;
70 int lowIndex = floor(fraction);
71 fraction -= lowIndex;
74 mEvaluator->evaluate(&value, mDataSource[lowIndex], mDataSource[lowIndex + 1], fraction);
79 const T PropertyValuesHolderImpl<T>::calculateAnimatedValue(float fraction) const {
81 return getValueFromData(fraction);
84 mEvaluator->evaluate(&value, mStartValue, mEndValue, fraction);
89 void GroupPropertyValuesHolder::setFraction(float fraction) {
90 float animatedValue = calculateAnimatedValue(fraction);
94 void FullPathColorPropertyValuesHolder::setFraction(float fraction) {
95 SkColor animatedValue = calculateAnimatedValue(fraction);
99 void FullPathPropertyValuesHolder::setFraction(float fraction) {
100 float animatedValue = calculateAnimatedValue(fraction);
104 void PathDataPropertyValuesHolder::setFraction(float fraction) {
105 mEvaluator->evaluate(&mPathData, mStartValue, mEndValue, fraction);
109 void RootAlphaPropertyValuesHolder::setFraction(float fraction) {
110 float animatedValue = calculateAnimatedValue(fraction);