Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(300)

Unified Diff: Source/core/animation/css/CSSAnimations.cpp

Issue 1120003002: [Oilpan] Migrate most classes under core/animations to Oilpan heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/animation/css/CSSAnimations.h ('k') | Source/core/css/resolver/AnimatedStyleBuilder.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/animation/css/CSSAnimations.cpp
diff --git a/Source/core/animation/css/CSSAnimations.cpp b/Source/core/animation/css/CSSAnimations.cpp
index bd47b0b5f3ccfc5f322466d9ff547dd5ef3c732e..8eb2a8243cc03fcd7a3833b217fb34fbb9a51fd5 100644
--- a/Source/core/animation/css/CSSAnimations.cpp
+++ b/Source/core/animation/css/CSSAnimations.cpp
@@ -65,7 +65,7 @@ using PropertySet = HashSet<CSSPropertyID>;
namespace {
-static PassRefPtrWillBeRawPtr<StringKeyframeEffectModel> createKeyframeEffectModel(StyleResolver* resolver, const Element* animatingElement, Element& element, const ComputedStyle* style, const ComputedStyle* parentStyle, const AtomicString& name, TimingFunction* defaultTimingFunction, size_t animationIndex)
+static StringKeyframeEffectModel* createKeyframeEffectModel(StyleResolver* resolver, const Element* animatingElement, Element& element, const ComputedStyle* style, const ComputedStyle* parentStyle, const AtomicString& name, TimingFunction* defaultTimingFunction, size_t animationIndex)
{
// When the animating element is null, use its parent for scoping purposes.
const Element* elementForScoping = animatingElement ? animatingElement : &element;
@@ -79,7 +79,7 @@ static PassRefPtrWillBeRawPtr<StringKeyframeEffectModel> createKeyframeEffectMod
PropertySet specifiedPropertiesForUseCounter;
for (size_t i = 0; i < styleKeyframes.size(); ++i) {
const StyleRuleKeyframe* styleKeyframe = styleKeyframes[i].get();
- RefPtrWillBeRawPtr<StringKeyframe> keyframe = StringKeyframe::create();
+ StringKeyframe* keyframe = StringKeyframe::create();
const Vector<double>& offsets = styleKeyframe->keys();
ASSERT(!offsets.isEmpty());
keyframe->setOffset(offsets[0]);
@@ -107,7 +107,7 @@ static PassRefPtrWillBeRawPtr<StringKeyframeEffectModel> createKeyframeEffectMod
keyframes.append(keyframe);
// The last keyframe specified at a given offset is used.
for (size_t j = 1; j < offsets.size(); ++j) {
- keyframes.append(toStringKeyframe(keyframe->cloneWithOffset(offsets[j]).get()));
+ keyframes.append(toStringKeyframe(keyframe->cloneWithOffset(offsets[j])));
}
}
@@ -132,14 +132,14 @@ static PassRefPtrWillBeRawPtr<StringKeyframeEffectModel> createKeyframeEffectMod
keyframes.shrink(targetIndex + 1);
// Add 0% and 100% keyframes if absent.
- RefPtrWillBeRawPtr<StringKeyframe> startKeyframe = keyframes.isEmpty() ? nullptr : keyframes[0];
+ StringKeyframe* startKeyframe = keyframes.isEmpty() ? nullptr : keyframes[0];
if (!startKeyframe || keyframes[0]->offset() != 0) {
startKeyframe = StringKeyframe::create();
startKeyframe->setOffset(0);
startKeyframe->setEasing(defaultTimingFunction);
keyframes.prepend(startKeyframe);
}
- RefPtrWillBeRawPtr<StringKeyframe> endKeyframe = keyframes[keyframes.size() - 1];
+ StringKeyframe* endKeyframe = keyframes[keyframes.size() - 1];
if (endKeyframe->offset() != 1) {
endKeyframe = StringKeyframe::create();
endKeyframe->setOffset(1);
@@ -171,7 +171,7 @@ static PassRefPtrWillBeRawPtr<StringKeyframeEffectModel> createKeyframeEffectMod
}
}
- RefPtrWillBeRawPtr<StringKeyframeEffectModel> model = StringKeyframeEffectModel::create(keyframes, &keyframes[0]->easing());
+ StringKeyframeEffectModel* model = StringKeyframeEffectModel::create(keyframes, &keyframes[0]->easing());
model->forceConversionsToAnimatableValues(element, style);
if (animationIndex > 0 && model->hasSyntheticKeyframes())
UseCounter::count(elementForScoping->document(), UseCounter::CSSAnimationsStackedNeutralKeyframe);
@@ -309,7 +309,7 @@ void CSSAnimations::maybeApplyPendingUpdate(Element* element)
DisableCompositingQueryAsserts disabler;
for (const AtomicString& animationName : m_pendingUpdate.cancelledAnimationNames()) {
- RefPtrWillBeRawPtr<Animation> animation = m_animations.take(animationName)->animation;
+ Animation* animation = m_animations.take(animationName)->animation;
animation->cancel();
animation->update(TimingUpdateOnDemand);
}
@@ -354,15 +354,15 @@ void CSSAnimations::maybeApplyPendingUpdate(Element* element)
for (const auto& entry : m_pendingUpdate.newAnimations()) {
const InertEffect* inertAnimation = entry.effect.get();
- OwnPtrWillBeRawPtr<AnimationEventDelegate> eventDelegate = adoptPtrWillBeNoop(new AnimationEventDelegate(element, entry.name));
- RefPtrWillBeRawPtr<KeyframeEffect> effect = KeyframeEffect::create(element, inertAnimation->model(), inertAnimation->specifiedTiming(), KeyframeEffect::DefaultPriority, eventDelegate.release());
+ AnimationEventDelegate* eventDelegate = new AnimationEventDelegate(element, entry.name);
+ KeyframeEffect* effect = KeyframeEffect::create(element, inertAnimation->model(), inertAnimation->specifiedTiming(), KeyframeEffect::DefaultPriority, eventDelegate);
effect->setName(inertAnimation->name());
- RefPtrWillBeRawPtr<Animation> animation = element->document().timeline().play(effect.get());
+ Animation* animation = element->document().timeline().play(effect);
if (inertAnimation->paused())
animation->pause();
animation->update(TimingUpdateOnDemand);
- m_animations.set(entry.name, adoptRefWillBeNoop(new RunningAnimation(animation, entry)));
+ m_animations.set(entry.name, new RunningAnimation(animation, entry));
}
// Transitions that are run on the compositor only update main-thread state
@@ -370,14 +370,14 @@ void CSSAnimations::maybeApplyPendingUpdate(Element* element)
// be when transitions are retargeted. Instead of triggering complete style
// recalculation, we find these cases by searching for new transitions that
// have matching cancelled animation property IDs on the compositor.
- WillBeHeapHashMap<CSSPropertyID, std::pair<RefPtrWillBeMember<KeyframeEffect>, double>> retargetedCompositorTransitions;
+ HeapHashMap<CSSPropertyID, std::pair<Member<KeyframeEffect>, double>> retargetedCompositorTransitions;
for (CSSPropertyID id : m_pendingUpdate.cancelledTransitions()) {
ASSERT(m_transitions.contains(id));
- RefPtrWillBeRawPtr<Animation> animation = m_transitions.take(id).animation;
+ Animation* animation = m_transitions.take(id).animation;
KeyframeEffect* effect = toKeyframeEffect(animation->effect());
if (effect->hasActiveAnimationsOnCompositor(id) && m_pendingUpdate.newTransitions().find(id) != m_pendingUpdate.newTransitions().end() && !animation->limited())
- retargetedCompositorTransitions.add(id, std::pair<RefPtrWillBeMember<KeyframeEffect>, double>(effect, animation->startTimeInternal()));
+ retargetedCompositorTransitions.add(id, std::pair<Member<KeyframeEffect>, double>(effect, animation->startTimeInternal()));
animation->cancel();
// after cancelation, transitions must be downgraded or they'll fail
// to be considered when retriggering themselves. This can happen if
@@ -390,7 +390,7 @@ void CSSAnimations::maybeApplyPendingUpdate(Element* element)
for (CSSPropertyID id : m_pendingUpdate.finishedTransitions()) {
// This transition can also be cancelled and finished at the same time
if (m_transitions.contains(id)) {
- RefPtrWillBeRawPtr<Animation> animation = m_transitions.take(id).animation;
+ Animation* animation = m_transitions.take(id).animation;
// Transition must be downgraded
if (animation->effect() && animation->effect()->isAnimation())
toKeyframeEffect(animation->effect())->downgradeToNormal();
@@ -406,13 +406,13 @@ void CSSAnimations::maybeApplyPendingUpdate(Element* element)
CSSPropertyID id = newTransition.id;
InertEffect* inertAnimation = newTransition.effect.get();
- OwnPtrWillBeRawPtr<TransitionEventDelegate> eventDelegate = adoptPtrWillBeNoop(new TransitionEventDelegate(element, id));
+ TransitionEventDelegate* eventDelegate = new TransitionEventDelegate(element, id);
- RefPtrWillBeRawPtr<EffectModel> model = inertAnimation->model();
+ EffectModel* model = inertAnimation->model();
if (retargetedCompositorTransitions.contains(id)) {
- const std::pair<RefPtrWillBeMember<KeyframeEffect>, double>& oldTransition = retargetedCompositorTransitions.get(id);
- RefPtrWillBeRawPtr<KeyframeEffect> oldAnimation = oldTransition.first;
+ const std::pair<Member<KeyframeEffect>, double>& oldTransition = retargetedCompositorTransitions.get(id);
+ KeyframeEffect* oldAnimation = oldTransition.first;
double oldStartTime = oldTransition.second;
double inheritedTime = isNull(oldStartTime) ? 0 : element->document().timeline().currentTimeInternal() - oldStartTime;
@@ -420,14 +420,14 @@ void CSSAnimations::maybeApplyPendingUpdate(Element* element)
const KeyframeVector& frames = oldEffect->getFrames();
AnimatableValueKeyframeVector newFrames;
- newFrames.append(toAnimatableValueKeyframe(frames[0]->clone().get()));
- newFrames.append(toAnimatableValueKeyframe(frames[1]->clone().get()));
- newFrames.append(toAnimatableValueKeyframe(frames[2]->clone().get()));
+ newFrames.append(toAnimatableValueKeyframe(frames[0]->clone()));
+ newFrames.append(toAnimatableValueKeyframe(frames[1]->clone()));
+ newFrames.append(toAnimatableValueKeyframe(frames[2]->clone()));
newFrames[0]->clearPropertyValue(id);
newFrames[1]->clearPropertyValue(id);
- RefPtrWillBeRawPtr<InertEffect> inertAnimationForSampling = InertEffect::create(oldAnimation->model(), oldAnimation->specifiedTiming(), false, inheritedTime);
- OwnPtrWillBeRawPtr<WillBeHeapVector<RefPtrWillBeMember<Interpolation>>> sample = nullptr;
+ InertEffect* inertAnimationForSampling = InertEffect::create(oldAnimation->model(), oldAnimation->specifiedTiming(), false, inheritedTime);
+ HeapVector<Member<Interpolation>>* sample = nullptr;
inertAnimationForSampling->sample(sample);
if (sample && sample->size() == 1) {
newFrames[0]->setPropertyValue(id, toLegacyStyleInterpolation(sample->at(0).get())->currentValue());
@@ -436,9 +436,9 @@ void CSSAnimations::maybeApplyPendingUpdate(Element* element)
}
}
- RefPtrWillBeRawPtr<KeyframeEffect> transition = KeyframeEffect::create(element, model, inertAnimation->specifiedTiming(), KeyframeEffect::TransitionPriority, eventDelegate.release());
+ KeyframeEffect* transition = KeyframeEffect::create(element, model, inertAnimation->specifiedTiming(), KeyframeEffect::TransitionPriority, eventDelegate);
transition->setName(inertAnimation->name());
- RefPtrWillBeRawPtr<Animation> animation = element->document().timeline().play(transition.get());
+ Animation* animation = element->document().timeline().play(transition);
// Set the current time as the start time for retargeted transitions
if (retargetedCompositorTransitions.contains(id))
animation->setStartTime(element->document().timeline().currentTime());
@@ -454,7 +454,7 @@ void CSSAnimations::maybeApplyPendingUpdate(Element* element)
void CSSAnimations::calculateTransitionUpdateForProperty(CSSPropertyID id, const CSSTransitionData& transitionData, size_t transitionIndex, const ComputedStyle& oldStyle, const ComputedStyle& style, const TransitionMap* activeTransitions, CSSAnimationUpdate& update, const Element* element)
{
- RefPtrWillBeRawPtr<AnimatableValue> to = nullptr;
+ AnimatableValue* to = nullptr;
if (activeTransitions) {
TransitionMap::const_iterator activeTransitionIter = activeTransitions->find(id);
if (activeTransitionIter != activeTransitions->end()) {
@@ -472,10 +472,10 @@ void CSSAnimations::calculateTransitionUpdateForProperty(CSSPropertyID id, const
if (!to)
to = CSSAnimatableValueFactory::create(id, style);
- RefPtrWillBeRawPtr<AnimatableValue> from = CSSAnimatableValueFactory::create(id, oldStyle);
+ AnimatableValue* from = CSSAnimatableValueFactory::create(id, oldStyle);
// If we have multiple transitions on the same property, we will use the
// last one since we iterate over them in order.
- if (AnimatableValue::usesDefaultInterpolation(to.get(), from.get()))
+ if (AnimatableValue::usesDefaultInterpolation(to, from))
return;
Timing timing = transitionData.convertToTiming(transitionIndex);
@@ -491,25 +491,25 @@ void CSSAnimations::calculateTransitionUpdateForProperty(CSSPropertyID id, const
timing.startDelay = 0;
}
- RefPtrWillBeRawPtr<AnimatableValueKeyframe> delayKeyframe = AnimatableValueKeyframe::create();
- delayKeyframe->setPropertyValue(id, from.get());
+ AnimatableValueKeyframe* delayKeyframe = AnimatableValueKeyframe::create();
+ delayKeyframe->setPropertyValue(id, from);
delayKeyframe->setOffset(0);
keyframes.append(delayKeyframe);
- RefPtrWillBeRawPtr<AnimatableValueKeyframe> startKeyframe = AnimatableValueKeyframe::create();
- startKeyframe->setPropertyValue(id, from.get());
+ AnimatableValueKeyframe* startKeyframe = AnimatableValueKeyframe::create();
+ startKeyframe->setPropertyValue(id, from);
startKeyframe->setOffset(startKeyframeOffset);
startKeyframe->setEasing(timing.timingFunction.release());
timing.timingFunction = LinearTimingFunction::shared();
keyframes.append(startKeyframe);
- RefPtrWillBeRawPtr<AnimatableValueKeyframe> endKeyframe = AnimatableValueKeyframe::create();
- endKeyframe->setPropertyValue(id, to.get());
+ AnimatableValueKeyframe* endKeyframe = AnimatableValueKeyframe::create();
+ endKeyframe->setPropertyValue(id, to);
endKeyframe->setOffset(1);
keyframes.append(endKeyframe);
- RefPtrWillBeRawPtr<AnimatableValueKeyframeEffectModel> model = AnimatableValueKeyframeEffectModel::create(keyframes);
- update.startTransition(id, from.get(), to.get(), InertEffect::create(model, timing, false, 0));
+ AnimatableValueKeyframeEffectModel* model = AnimatableValueKeyframeEffectModel::create(keyframes);
+ update.startTransition(id, from, to, InertEffect::create(model, timing, false, 0));
ASSERT(!element->elementAnimations() || !element->elementAnimations()->isAnimationStyleChange());
}
@@ -612,7 +612,7 @@ void CSSAnimations::calculateAnimationActiveInterpolations(CSSAnimationUpdate& u
return;
}
- WillBeHeapVector<RawPtrWillBeMember<InertEffect>> newEffects;
+ HeapVector<Member<InertEffect>> newEffects;
for (const auto& newAnimation : update.newAnimations())
newEffects.append(newAnimation.effect.get());
for (const auto& updatedAnimation : update.animationsWithUpdates())
@@ -631,11 +631,11 @@ void CSSAnimations::calculateTransitionActiveInterpolations(CSSAnimationUpdate&
if (update.newTransitions().isEmpty() && update.cancelledTransitions().isEmpty()) {
activeInterpolationsForTransitions = AnimationStack::activeInterpolations(animationStack, 0, 0, KeyframeEffect::TransitionPriority, timelineCurrentTime);
} else {
- WillBeHeapVector<RawPtrWillBeMember<InertEffect>> newTransitions;
+ HeapVector<Member<InertEffect>> newTransitions;
for (const auto& entry : update.newTransitions())
newTransitions.append(entry.value.effect.get());
- WillBeHeapHashSet<RawPtrWillBeMember<const Animation>> cancelledAnimations;
+ HeapHashSet<Member<const Animation>> cancelledAnimations;
if (!update.cancelledTransitions().isEmpty()) {
ASSERT(elementAnimations);
const TransitionMap& transitionMap = elementAnimations->cssAnimations().m_transitions;
@@ -789,12 +789,10 @@ bool CSSAnimations::isAnimatableProperty(CSSPropertyID property)
DEFINE_TRACE(CSSAnimations)
{
-#if ENABLE(OILPAN)
visitor->trace(m_transitions);
visitor->trace(m_pendingUpdate);
visitor->trace(m_animations);
visitor->trace(m_previousActiveInterpolationsForAnimations);
-#endif
}
} // namespace blink
« no previous file with comments | « Source/core/animation/css/CSSAnimations.h ('k') | Source/core/css/resolver/AnimatedStyleBuilder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698