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

Side by Side Diff: Source/core/rendering/animation/WebAnimationProvider.cpp

Issue 24085002: Correctly apply per-keyframe timing functions (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Intel Corporation. All rights reserved. 2 * Copyright (C) 2013 Intel Corporation. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 size_t numKeyframes = keyframes.size(); 132 size_t numKeyframes = keyframes.size();
133 for (size_t i = 0; i < numKeyframes; ++i) { 133 for (size_t i = 0; i < numKeyframes; ++i) {
134 const KeyframeValue& currentKeyframe = keyframes[i]; 134 const KeyframeValue& currentKeyframe = keyframes[i];
135 const RenderStyle* keyframeStyle = currentKeyframe.style(); 135 const RenderStyle* keyframeStyle = currentKeyframe.style();
136 double key = currentKeyframe.key(); 136 double key = currentKeyframe.key();
137 137
138 if (!keyframeStyle) 138 if (!keyframeStyle)
139 continue; 139 continue;
140 140
141 // Get timing function. 141 // Get timing function.
142 RefPtr<TimingFunction> tf = KeyframeValue::timingFunction(keyframeStyle, keyframes.animationName()); 142 RefPtr<TimingFunction> tf = KeyframeValue::timingFunction(*keyframeStyle );
143 143
144 bool isFirstOrLastKeyframe = !key || key == 1; 144 bool isFirstOrLastKeyframe = !key || key == 1;
145 if ((hasTransform && isFirstOrLastKeyframe) || currentKeyframe.containsP roperty(CSSPropertyWebkitTransform)) 145 if ((hasTransform && isFirstOrLastKeyframe) || currentKeyframe.containsP roperty(CSSPropertyWebkitTransform))
146 transformVector.insert(adoptPtr(new TransformAnimationValue(key, &(k eyframeStyle->transform()), tf))); 146 transformVector.insert(adoptPtr(new TransformAnimationValue(key, &(k eyframeStyle->transform()), tf)));
147 147
148 if ((hasOpacity && isFirstOrLastKeyframe) || currentKeyframe.containsPro perty(CSSPropertyOpacity)) 148 if ((hasOpacity && isFirstOrLastKeyframe) || currentKeyframe.containsPro perty(CSSPropertyOpacity))
149 opacityVector.insert(adoptPtr(new FloatAnimationValue(key, keyframeS tyle->opacity(), tf))); 149 opacityVector.insert(adoptPtr(new FloatAnimationValue(key, keyframeS tyle->opacity(), tf)));
150 150
151 if ((hasFilter && isFirstOrLastKeyframe) || currentKeyframe.containsProp erty(CSSPropertyWebkitFilter)) 151 if ((hasFilter && isFirstOrLastKeyframe) || currentKeyframe.containsProp erty(CSSPropertyWebkitFilter))
152 filterVector.insert(adoptPtr(new FilterAnimationValue(key, &(keyfram eStyle->filter()), tf))); 152 filterVector.insert(adoptPtr(new FilterAnimationValue(key, &(keyfram eStyle->filter()), tf)));
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 OwnPtr<WebAnimation> webAnimation(createWebAnimation(values, animation, anim ationId, timeOffset, boxSize)); 205 OwnPtr<WebAnimation> webAnimation(createWebAnimation(values, animation, anim ationId, timeOffset, boxSize));
206 if (!webAnimation) 206 if (!webAnimation)
207 return PassOwnPtr<WebAnimation>(); 207 return PassOwnPtr<WebAnimation>();
208 208
209 if (!animationId) 209 if (!animationId)
210 m_animationIdMap.set(animationName, webAnimation->id()); 210 m_animationIdMap.set(animationName, webAnimation->id());
211 return webAnimation.release(); 211 return webAnimation.release();
212 } 212 }
213 213
214 } // namespace WebCore 214 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/frame/animation/KeyframeAnimation.cpp ('k') | Source/core/rendering/style/KeyframeList.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698