bool GraphicsLayerChromium::addAnimation(const KeyframeValueList& values, const IntSize& boxSize, const Animation* animation, const String& animationName, double timeOffset) { primaryLayer().setAnimationDelegate(this); int animationId = mapAnimationNameToId(animationName); int groupId = AnimationIdVendor::getNextGroupId(); OwnPtr<WebKit::WebAnimation> toAdd(createWebAnimation(values, animation, animationId, groupId, timeOffset, boxSize)); if (toAdd.get()) { // Remove any existing animations with the same animation id and target property. primaryLayer().removeAnimation(animationId, toAdd->targetProperty()); return primaryLayer().addAnimation(*toAdd); } return false; }
bool GraphicsLayerChromium::addAnimation(const KeyframeValueList& values, const IntSize& boxSize, const Animation* animation, const String& animationName, double timeOffset) { platformLayer()->setAnimationDelegate(this); int animationId = 0; if (m_animationIdMap.contains(animationName)) animationId = m_animationIdMap.get(animationName); OwnPtr<WebAnimation> toAdd(createWebAnimation(values, animation, animationId, timeOffset, boxSize)); if (toAdd) { animationId = toAdd->id(); m_animationIdMap.set(animationName, animationId); // Remove any existing animations with the same animation id and target property. platformLayer()->removeAnimation(animationId, toAdd->targetProperty()); return platformLayer()->addAnimation(toAdd.get()); } return false; }