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