2 * Copyright (C) 2013 Google Inc. All rights reserved.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above
11 * copyright notice, this list of conditions and the following disclaimer
12 * in the documentation and/or other materials provided with the
14 * * Neither the name of Google Inc. nor the names of its
15 * contributors may be used to endorse or promote products derived from
16 * this software without specific prior written permission.
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 #include "core/animation/AnimationStack.h"
34 #include "core/animation/css/CSSAnimations.h"
40 void copyToCompositableValueMap(const AnimationEffect::CompositableValueList* source, AnimationEffect::CompositableValueMap& target)
44 for (AnimationEffect::CompositableValueList::const_iterator iter = source->begin(); iter != source->end(); ++iter)
45 target.set(iter->first, iter->second);
50 bool AnimationStack::affects(CSSPropertyID property) const
52 for (size_t i = 0; i < m_activeAnimations.size(); ++i) {
53 if (m_activeAnimations[i]->affects(property))
59 bool AnimationStack::hasActiveAnimationsOnCompositor(CSSPropertyID property) const
61 for (size_t i = 0; i < m_activeAnimations.size(); ++i) {
62 if (m_activeAnimations[i]->hasActiveAnimationsOnCompositor(property))
68 AnimationEffect::CompositableValueMap AnimationStack::compositableValues(const AnimationStack* animationStack, const Vector<InertAnimation*>* newAnimations, const HashSet<const Player*>* cancelledPlayers, Animation::Priority priority)
70 AnimationEffect::CompositableValueMap result;
73 const Vector<Animation*>& animations = animationStack->m_activeAnimations;
74 for (size_t i = 0; i < animations.size(); ++i) {
75 Animation* animation = animations[i];
76 if (animation->priority() != priority)
78 if (cancelledPlayers && cancelledPlayers->contains(animation->player()))
80 copyToCompositableValueMap(animation->compositableValues(), result);
85 for (size_t i = 0; i < newAnimations->size(); ++i)
86 copyToCompositableValueMap(newAnimations->at(i)->sample().get(), result);
92 } // namespace WebCore