OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007 Apple 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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 void ImplicitAnimation::getAnimatedStyle(RefPtr<RenderStyle>& animatedStyle) | 97 void ImplicitAnimation::getAnimatedStyle(RefPtr<RenderStyle>& animatedStyle) |
98 { | 98 { |
99 if (!animatedStyle) | 99 if (!animatedStyle) |
100 animatedStyle = RenderStyle::clone(m_toStyle.get()); | 100 animatedStyle = RenderStyle::clone(m_toStyle.get()); |
101 | 101 |
102 CSSPropertyAnimation::blendProperties(this, m_animatingProperty, animatedSty
le.get(), m_fromStyle.get(), m_toStyle.get(), progress(1, 0, 0)); | 102 CSSPropertyAnimation::blendProperties(this, m_animatingProperty, animatedSty
le.get(), m_fromStyle.get(), m_toStyle.get(), progress(1, 0, 0)); |
103 } | 103 } |
104 | 104 |
105 void ImplicitAnimation::startAnimation(double timeOffset) | 105 void ImplicitAnimation::startAnimation(double timeOffset) |
106 { | 106 { |
107 if (m_object && m_object->isComposited()) | 107 if (m_object && m_object->compositingState() == PaintsIntoOwnBacking) |
108 m_isAccelerated = toRenderBoxModelObject(m_object)->startTransition(time
Offset, m_animatingProperty, m_fromStyle.get(), m_toStyle.get()); | 108 m_isAccelerated = toRenderBoxModelObject(m_object)->startTransition(time
Offset, m_animatingProperty, m_fromStyle.get(), m_toStyle.get()); |
109 } | 109 } |
110 | 110 |
111 void ImplicitAnimation::pauseAnimation(double timeOffset) | 111 void ImplicitAnimation::pauseAnimation(double timeOffset) |
112 { | 112 { |
113 if (!m_object) | 113 if (!m_object) |
114 return; | 114 return; |
115 | 115 |
116 if (m_object && m_object->isComposited() && isAccelerated()) | 116 if (m_object && m_object->compositingState() == PaintsIntoOwnBacking && isAc
celerated()) |
117 toRenderBoxModelObject(m_object)->transitionPaused(timeOffset, m_animati
ngProperty); | 117 toRenderBoxModelObject(m_object)->transitionPaused(timeOffset, m_animati
ngProperty); |
118 | 118 |
119 // Restore the original (unanimated) style | 119 // Restore the original (unanimated) style |
120 if (!paused()) | 120 if (!paused()) |
121 setNeedsStyleRecalc(m_object->node()); | 121 setNeedsStyleRecalc(m_object->node()); |
122 } | 122 } |
123 | 123 |
124 void ImplicitAnimation::endAnimation() | 124 void ImplicitAnimation::endAnimation() |
125 { | 125 { |
126 if (m_object && m_object->isComposited() && isAccelerated()) | 126 if (m_object && m_object->compositingState() == PaintsIntoOwnBacking && isAc
celerated()) |
127 toRenderBoxModelObject(m_object)->transitionFinished(m_animatingProperty
); | 127 toRenderBoxModelObject(m_object)->transitionFinished(m_animatingProperty
); |
128 m_isAccelerated = false; | 128 m_isAccelerated = false; |
129 } | 129 } |
130 | 130 |
131 void ImplicitAnimation::onAnimationEnd(double elapsedTime) | 131 void ImplicitAnimation::onAnimationEnd(double elapsedTime) |
132 { | 132 { |
133 // If we have a keyframe animation on this property, this transition is bein
g overridden. The keyframe | 133 // If we have a keyframe animation on this property, this transition is bein
g overridden. The keyframe |
134 // animation keeps an unanimated style in case a transition starts while the
keyframe animation is | 134 // animation keeps an unanimated style in case a transition starts while the
keyframe animation is |
135 // running. But now that the transition has completed, we need to update thi
s style with its new | 135 // running. But now that the transition has completed, we need to update thi
s style with its new |
136 // destination. If we didn't, the next time through we would think a transit
ion had started | 136 // destination. If we didn't, the next time through we would think a transit
ion had started |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 // only need service at the end of the transition. | 281 // only need service at the end of the transition. |
282 if (CSSPropertyAnimation::animationOfPropertyIsAccelerated(m_animatingProper
ty) && isAccelerated()) { | 282 if (CSSPropertyAnimation::animationOfPropertyIsAccelerated(m_animatingProper
ty) && isAccelerated()) { |
283 bool isLooping; | 283 bool isLooping; |
284 getTimeToNextEvent(t, isLooping); | 284 getTimeToNextEvent(t, isLooping); |
285 } | 285 } |
286 | 286 |
287 return t; | 287 return t; |
288 } | 288 } |
289 | 289 |
290 } // namespace WebCore | 290 } // namespace WebCore |
OLD | NEW |