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

Side by Side Diff: Source/core/animation/Animation.cpp

Issue 142523005: Web Animations: Define easing for each keyframe (Closed) Base URL: https://chromium.googlesource.com/chromium/blink@master
Patch Set: Rename s_accuracy to accuracyForKeyframeEasing Created 6 years, 10 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 unified diff | Download patch
« no previous file with comments | « no previous file | Source/core/animation/AnimationTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 double offset; 177 double offset;
178 if (keyframeDictionaryVector[i].get("offset", offset)) { 178 if (keyframeDictionaryVector[i].get("offset", offset)) {
179 keyframe->setOffset(offset); 179 keyframe->setOffset(offset);
180 } 180 }
181 181
182 String compositeString; 182 String compositeString;
183 keyframeDictionaryVector[i].get("composite", compositeString); 183 keyframeDictionaryVector[i].get("composite", compositeString);
184 if (compositeString == "add") 184 if (compositeString == "add")
185 keyframe->setComposite(AnimationEffect::CompositeAdd); 185 keyframe->setComposite(AnimationEffect::CompositeAdd);
186 186
187 String timingFunctionString;
188 if (keyframeDictionaryVector[i].get("easing", timingFunctionString)) {
189 RefPtr<CSSValue> timingFunctionValue = BisonCSSParser::parseAnimatio nTimingFunctionValue(timingFunctionString);
190 if (timingFunctionValue) {
191 keyframe->setEasing(CSSToStyleMap::animationTimingFunction(timin gFunctionValue.get(), false));
192 }
193 }
194
187 Vector<String> keyframeProperties; 195 Vector<String> keyframeProperties;
188 keyframeDictionaryVector[i].getOwnPropertyNames(keyframeProperties); 196 keyframeDictionaryVector[i].getOwnPropertyNames(keyframeProperties);
189 197
190 for (size_t j = 0; j < keyframeProperties.size(); ++j) { 198 for (size_t j = 0; j < keyframeProperties.size(); ++j) {
191 String property = keyframeProperties[j]; 199 String property = keyframeProperties[j];
192 CSSPropertyID id = camelCaseCSSPropertyNameToID(property); 200 CSSPropertyID id = camelCaseCSSPropertyNameToID(property);
193 201
194 // FIXME: There is no way to store invalid properties or invalid val ues 202 // FIXME: There is no way to store invalid properties or invalid val ues
195 // in a Keyframe object, so for now I just skip over them. Eventuall y we 203 // in a Keyframe object, so for now I just skip over them. Eventuall y we
196 // will need to support getFrames(), which should return exactly the 204 // will need to support getFrames(), which should return exactly the
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
392 void Animation::pauseAnimationForTestingOnCompositor(double pauseTime) 400 void Animation::pauseAnimationForTestingOnCompositor(double pauseTime)
393 { 401 {
394 ASSERT(hasActiveAnimationsOnCompositor()); 402 ASSERT(hasActiveAnimationsOnCompositor());
395 if (!m_target || !m_target->renderer()) 403 if (!m_target || !m_target->renderer())
396 return; 404 return;
397 for (size_t i = 0; i < m_compositorAnimationIds.size(); ++i) 405 for (size_t i = 0; i < m_compositorAnimationIds.size(); ++i)
398 CompositorAnimations::instance()->pauseAnimationForTestingOnCompositor(* m_target.get(), m_compositorAnimationIds[i], pauseTime); 406 CompositorAnimations::instance()->pauseAnimationForTestingOnCompositor(* m_target.get(), m_compositorAnimationIds[i], pauseTime);
399 } 407 }
400 408
401 } // namespace WebCore 409 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | Source/core/animation/AnimationTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698