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

Side by Side Diff: Source/core/frame/animation/CSSPropertyAnimation.cpp

Issue 55813002: Convert animation and renderer code to know about BorderImageLength (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@length-relative-die-step-1-4
Patch Set: Rebased to latest master Created 7 years, 1 month 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007, 2008, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008, 2009 Apple Inc. All rights reserved.
3 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. 3 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 static inline Color blendFunc(const AnimationBase*, const Color& from, const Col or& to, double progress) 64 static inline Color blendFunc(const AnimationBase*, const Color& from, const Col or& to, double progress)
65 { 65 {
66 return blend(from, to, progress); 66 return blend(from, to, progress);
67 } 67 }
68 68
69 static inline Length blendFunc(const AnimationBase*, const Length& from, const L ength& to, double progress) 69 static inline Length blendFunc(const AnimationBase*, const Length& from, const L ength& to, double progress)
70 { 70 {
71 return to.blend(from, progress, ValueRangeAll); 71 return to.blend(from, progress, ValueRangeAll);
72 } 72 }
73 73
74 static inline BorderImageLength blendFunc(const AnimationBase* anim, const Borde rImageLength& from, const BorderImageLength& to, double progress)
75 {
76 if (from.isNumber() && to.isNumber())
77 return BorderImageLength(blendFunc(anim, from.number(), to.number(), pro gress));
78
79 if (from.isLength() && to.isLength())
80 return BorderImageLength(blendFunc(anim, from.length(), to.length(), pro gress));
81
82 // FIXME: Converting numbers to lengths using the computed border
83 // width would make it possible to interpolate between numbers and
84 // lengths.
85 // https://code.google.com/p/chromium/issues/detail?id=316164
86 return to;
87 }
88
89 static inline BorderImageLengthBox blendFunc(const AnimationBase* anim, const Bo rderImageLengthBox& from,
90 const BorderImageLengthBox& to, double progress)
91 {
92 return BorderImageLengthBox(blendFunc(anim, from.top(), to.top(), progress),
93 blendFunc(anim, from.right(), to.right(), progress),
94 blendFunc(anim, from.bottom(), to.bottom(), progress),
95 blendFunc(anim, from.left(), to.left(), progress));
96 }
97
74 static inline LengthSize blendFunc(const AnimationBase* anim, const LengthSize& from, const LengthSize& to, double progress) 98 static inline LengthSize blendFunc(const AnimationBase* anim, const LengthSize& from, const LengthSize& to, double progress)
75 { 99 {
76 return LengthSize(blendFunc(anim, from.width(), to.width(), progress), 100 return LengthSize(blendFunc(anim, from.width(), to.width(), progress),
77 blendFunc(anim, from.height(), to.height(), progress)); 101 blendFunc(anim, from.height(), to.height(), progress));
78 } 102 }
79 103
80 static inline LengthPoint blendFunc(const AnimationBase* anim, const LengthPoint & from, const LengthPoint& to, double progress) 104 static inline LengthPoint blendFunc(const AnimationBase* anim, const LengthPoint & from, const LengthPoint& to, double progress)
81 { 105 {
82 return LengthPoint(blendFunc(anim, from.x(), to.x(), progress), blendFunc(an im, from.y(), to.y(), progress)); 106 return LengthPoint(blendFunc(anim, from.x(), to.x(), progress), blendFunc(an im, from.y(), to.y(), progress));
83 } 107 }
84 108
85 static inline TransformOperations blendFunc(const AnimationBase* anim, const Tra nsformOperations& from, const TransformOperations& to, double progress) 109 static inline TransformOperations blendFunc(const AnimationBase* anim, const Tra nsformOperations& from, const TransformOperations& to, double progress)
86 { 110 {
87 if (anim->isTransformFunctionListValid()) 111 if (anim->isTransformFunctionListValid())
(...skipping 864 matching lines...) Expand 10 before | Expand all | Expand 10 after
952 gPropertyWrappers->append(new PropertyWrapperVisitedAffectedColor(CSSPropert yColor, &RenderStyle::color, &RenderStyle::setColor, &RenderStyle::visitedLinkCo lor, &RenderStyle::setVisitedLinkColor)); 976 gPropertyWrappers->append(new PropertyWrapperVisitedAffectedColor(CSSPropert yColor, &RenderStyle::color, &RenderStyle::setColor, &RenderStyle::visitedLinkCo lor, &RenderStyle::setVisitedLinkColor));
953 977
954 gPropertyWrappers->append(new PropertyWrapperVisitedAffectedColor(CSSPropert yBackgroundColor, &RenderStyle::backgroundColor, &RenderStyle::setBackgroundColo r, &RenderStyle::visitedLinkBackgroundColor, &RenderStyle::setVisitedLinkBackgro undColor)); 978 gPropertyWrappers->append(new PropertyWrapperVisitedAffectedColor(CSSPropert yBackgroundColor, &RenderStyle::backgroundColor, &RenderStyle::setBackgroundColo r, &RenderStyle::visitedLinkBackgroundColor, &RenderStyle::setVisitedLinkBackgro undColor));
955 979
956 gPropertyWrappers->append(new FillLayersPropertyWrapper(CSSPropertyBackgroun dImage, &RenderStyle::backgroundLayers, &RenderStyle::accessBackgroundLayers)); 980 gPropertyWrappers->append(new FillLayersPropertyWrapper(CSSPropertyBackgroun dImage, &RenderStyle::backgroundLayers, &RenderStyle::accessBackgroundLayers));
957 gPropertyWrappers->append(new StyleImagePropertyWrapper(CSSPropertyListStyle Image, &RenderStyle::listStyleImage, &RenderStyle::setListStyleImage)); 981 gPropertyWrappers->append(new StyleImagePropertyWrapper(CSSPropertyListStyle Image, &RenderStyle::listStyleImage, &RenderStyle::setListStyleImage));
958 gPropertyWrappers->append(new StyleImagePropertyWrapper(CSSPropertyWebkitMas kImage, &RenderStyle::maskImage, &RenderStyle::setMaskImage)); 982 gPropertyWrappers->append(new StyleImagePropertyWrapper(CSSPropertyWebkitMas kImage, &RenderStyle::maskImage, &RenderStyle::setMaskImage));
959 983
960 gPropertyWrappers->append(new StyleImagePropertyWrapper(CSSPropertyBorderIma geSource, &RenderStyle::borderImageSource, &RenderStyle::setBorderImageSource)); 984 gPropertyWrappers->append(new StyleImagePropertyWrapper(CSSPropertyBorderIma geSource, &RenderStyle::borderImageSource, &RenderStyle::setBorderImageSource));
961 gPropertyWrappers->append(new PropertyWrapper<LengthBox>(CSSPropertyBorderIm ageSlice, &RenderStyle::borderImageSlices, &RenderStyle::setBorderImageSlices)); 985 gPropertyWrappers->append(new PropertyWrapper<LengthBox>(CSSPropertyBorderIm ageSlice, &RenderStyle::borderImageSlices, &RenderStyle::setBorderImageSlices));
962 gPropertyWrappers->append(new PropertyWrapper<LengthBox>(CSSPropertyBorderIm ageWidth, &RenderStyle::borderImageWidth, &RenderStyle::setBorderImageWidth)); 986 gPropertyWrappers->append(new PropertyWrapper<const BorderImageLengthBox&>(C SSPropertyBorderImageWidth, &RenderStyle::borderImageWidth, &RenderStyle::setBor derImageWidth));
963 gPropertyWrappers->append(new PropertyWrapper<LengthBox>(CSSPropertyBorderIm ageOutset, &RenderStyle::borderImageOutset, &RenderStyle::setBorderImageOutset)) ; 987 gPropertyWrappers->append(new PropertyWrapper<const BorderImageLengthBox&>(C SSPropertyBorderImageOutset, &RenderStyle::borderImageOutset, &RenderStyle::setB orderImageOutset));
964 988
965 gPropertyWrappers->append(new StyleImagePropertyWrapper(CSSPropertyWebkitMas kBoxImageSource, &RenderStyle::maskBoxImageSource, &RenderStyle::setMaskBoxImage Source)); 989 gPropertyWrappers->append(new StyleImagePropertyWrapper(CSSPropertyWebkitMas kBoxImageSource, &RenderStyle::maskBoxImageSource, &RenderStyle::setMaskBoxImage Source));
966 gPropertyWrappers->append(new PropertyWrapper<const NinePieceImage&>(CSSProp ertyWebkitMaskBoxImage, &RenderStyle::maskBoxImage, &RenderStyle::setMaskBoxImag e)); 990 gPropertyWrappers->append(new PropertyWrapper<const NinePieceImage&>(CSSProp ertyWebkitMaskBoxImage, &RenderStyle::maskBoxImage, &RenderStyle::setMaskBoxImag e));
967 991
968 gPropertyWrappers->append(new FillLayersPropertyWrapper(CSSPropertyBackgroun dPositionX, &RenderStyle::backgroundLayers, &RenderStyle::accessBackgroundLayers )); 992 gPropertyWrappers->append(new FillLayersPropertyWrapper(CSSPropertyBackgroun dPositionX, &RenderStyle::backgroundLayers, &RenderStyle::accessBackgroundLayers ));
969 gPropertyWrappers->append(new FillLayersPropertyWrapper(CSSPropertyBackgroun dPositionY, &RenderStyle::backgroundLayers, &RenderStyle::accessBackgroundLayers )); 993 gPropertyWrappers->append(new FillLayersPropertyWrapper(CSSPropertyBackgroun dPositionY, &RenderStyle::backgroundLayers, &RenderStyle::accessBackgroundLayers ));
970 gPropertyWrappers->append(new FillLayersPropertyWrapper(CSSPropertyBackgroun dSize, &RenderStyle::backgroundLayers, &RenderStyle::accessBackgroundLayers)); 994 gPropertyWrappers->append(new FillLayersPropertyWrapper(CSSPropertyBackgroun dSize, &RenderStyle::backgroundLayers, &RenderStyle::accessBackgroundLayers));
971 gPropertyWrappers->append(new FillLayersPropertyWrapper(CSSPropertyWebkitBac kgroundSize, &RenderStyle::backgroundLayers, &RenderStyle::accessBackgroundLayer s)); 995 gPropertyWrappers->append(new FillLayersPropertyWrapper(CSSPropertyWebkitBac kgroundSize, &RenderStyle::backgroundLayers, &RenderStyle::accessBackgroundLayer s));
972 996
973 gPropertyWrappers->append(new FillLayersPropertyWrapper(CSSPropertyWebkitMas kPositionX, &RenderStyle::maskLayers, &RenderStyle::accessMaskLayers)); 997 gPropertyWrappers->append(new FillLayersPropertyWrapper(CSSPropertyWebkitMas kPositionX, &RenderStyle::maskLayers, &RenderStyle::accessMaskLayers));
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
1136 } 1160 }
1137 1161
1138 int CSSPropertyAnimation::getNumProperties() 1162 int CSSPropertyAnimation::getNumProperties()
1139 { 1163 {
1140 ensurePropertyMap(); 1164 ensurePropertyMap();
1141 1165
1142 return gPropertyWrappers->size(); 1166 return gPropertyWrappers->size();
1143 } 1167 }
1144 1168
1145 } 1169 }
OLDNEW
« no previous file with comments | « Source/core/css/resolver/AnimatedStyleBuilder.cpp ('k') | Source/core/rendering/style/BorderImageLength.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698