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 18 matching lines...) Expand all Loading... |
29 #include "config.h" | 29 #include "config.h" |
30 | 30 |
31 #include "AnimationControllerPrivate.h" | 31 #include "AnimationControllerPrivate.h" |
32 #include "CompositeAnimation.h" | 32 #include "CompositeAnimation.h" |
33 #include "CSSPropertyNames.h" | 33 #include "CSSPropertyNames.h" |
34 #include "EventNames.h" | 34 #include "EventNames.h" |
35 #include "ImplicitAnimation.h" | 35 #include "ImplicitAnimation.h" |
36 #include "KeyframeAnimation.h" | 36 #include "KeyframeAnimation.h" |
37 #include "RenderLayer.h" | 37 #include "RenderLayer.h" |
38 #include "RenderLayerBacking.h" | 38 #include "RenderLayerBacking.h" |
39 | |
40 #include <wtf/UnusedParam.h> | 39 #include <wtf/UnusedParam.h> |
41 | 40 |
42 namespace WebCore { | 41 namespace WebCore { |
43 | 42 |
44 ImplicitAnimation::ImplicitAnimation(const Animation* transition, int animatingP
roperty, RenderObject* renderer, CompositeAnimation* compAnim, RenderStyle* from
Style) | 43 ImplicitAnimation::ImplicitAnimation(const Animation* transition, int animatingP
roperty, RenderObject* renderer, CompositeAnimation* compAnim, RenderStyle* from
Style) |
45 : AnimationBase(transition, renderer, compAnim) | 44 : AnimationBase(transition, renderer, compAnim) |
46 , m_transitionProperty(transition->property()) | 45 , m_transitionProperty(transition->property()) |
47 , m_animatingProperty(animatingProperty) | 46 , m_animatingProperty(animatingProperty) |
48 , m_overridden(false) | 47 , m_overridden(false) |
49 , m_fromStyle(fromStyle) | 48 , m_fromStyle(fromStyle) |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 void ImplicitAnimation::getAnimatedStyle(RefPtr<RenderStyle>& animatedStyle) | 89 void ImplicitAnimation::getAnimatedStyle(RefPtr<RenderStyle>& animatedStyle) |
91 { | 90 { |
92 if (!animatedStyle) | 91 if (!animatedStyle) |
93 animatedStyle = RenderStyle::clone(m_toStyle.get()); | 92 animatedStyle = RenderStyle::clone(m_toStyle.get()); |
94 | 93 |
95 blendProperties(this, m_animatingProperty, animatedStyle.get(), m_fromStyle.
get(), m_toStyle.get(), progress(1, 0, 0)); | 94 blendProperties(this, m_animatingProperty, animatedStyle.get(), m_fromStyle.
get(), m_toStyle.get(), progress(1, 0, 0)); |
96 } | 95 } |
97 | 96 |
98 bool ImplicitAnimation::startAnimation(double beginTime) | 97 bool ImplicitAnimation::startAnimation(double beginTime) |
99 { | 98 { |
100 UNUSED_PARAM(beginTime); | |
101 | |
102 #if USE(ACCELERATED_COMPOSITING) | 99 #if USE(ACCELERATED_COMPOSITING) |
103 if (m_object && m_object->hasLayer()) { | 100 if (m_object && m_object->hasLayer()) { |
104 RenderLayer* layer = toRenderBox(m_object)->layer(); | 101 RenderLayer* layer = toRenderBoxModelObject(m_object)->layer(); |
105 if (layer->isComposited()) | 102 if (layer->isComposited()) |
106 return layer->backing()->startTransition(beginTime, m_animatingPrope
rty, m_fromStyle.get(), m_toStyle.get()); | 103 return layer->backing()->startTransition(beginTime, m_animatingPrope
rty, m_fromStyle.get(), m_toStyle.get()); |
107 } | 104 } |
| 105 #else |
| 106 UNUSED_PARAM(beginTime); |
108 #endif | 107 #endif |
109 return false; | 108 return false; |
110 } | 109 } |
111 | 110 |
112 void ImplicitAnimation::endAnimation(bool /*reset*/) | 111 void ImplicitAnimation::endAnimation(bool /*reset*/) |
113 { | 112 { |
114 #if USE(ACCELERATED_COMPOSITING) | 113 #if USE(ACCELERATED_COMPOSITING) |
115 if (m_object && m_object->hasLayer()) { | 114 if (m_object && m_object->hasLayer()) { |
116 RenderLayer* layer = toRenderBox(m_object)->layer(); | 115 RenderLayer* layer = toRenderBoxModelObject(m_object)->layer(); |
117 if (layer->isComposited()) | 116 if (layer->isComposited()) |
118 layer->backing()->transitionFinished(m_animatingProperty); | 117 layer->backing()->transitionFinished(m_animatingProperty); |
119 } | 118 } |
120 #endif | 119 #endif |
121 } | 120 } |
122 | 121 |
123 void ImplicitAnimation::onAnimationEnd(double elapsedTime) | 122 void ImplicitAnimation::onAnimationEnd(double elapsedTime) |
124 { | 123 { |
125 // If we have a keyframe animation on this property, this transition is bein
g overridden. The keyframe | 124 // If we have a keyframe animation on this property, this transition is bein
g overridden. The keyframe |
126 // animation keeps an unanimated style in case a transition starts while the
keyframe animation is | 125 // animation keeps an unanimated style in case a transition starts while the
keyframe animation is |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 if (animationOfPropertyIsAccelerated(m_animatingProperty)) { | 257 if (animationOfPropertyIsAccelerated(m_animatingProperty)) { |
259 bool isLooping; | 258 bool isLooping; |
260 getTimeToNextEvent(t, isLooping); | 259 getTimeToNextEvent(t, isLooping); |
261 } | 260 } |
262 #endif | 261 #endif |
263 return t; | 262 return t; |
264 } | 263 } |
265 | 264 |
266 } // namespace WebCore | 265 } // namespace WebCore |
267 | 266 |
OLD | NEW |