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

Side by Side Diff: third_party/WebKit/Source/core/animation/AnimationStack.cpp

Issue 2369833002: Introduce KeyframeEffectReadOnly interface (Closed)
Patch Set: Update references to Priority, response to review Created 4 years, 2 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 bool AnimationStack::hasActiveAnimationsOnCompositor(CSSPropertyID property) con st 85 bool AnimationStack::hasActiveAnimationsOnCompositor(CSSPropertyID property) con st
86 { 86 {
87 for (const auto& sampledEffect : m_sampledEffects) { 87 for (const auto& sampledEffect : m_sampledEffects) {
88 // TODO(dstockwell): move the playing check into AnimationEffectReadOnly and expose both hasAnimations and hasActiveAnimations 88 // TODO(dstockwell): move the playing check into AnimationEffectReadOnly and expose both hasAnimations and hasActiveAnimations
89 if (sampledEffect->effect() && sampledEffect->effect()->animation()->pla ying() && sampledEffect->effect()->hasActiveAnimationsOnCompositor(property)) 89 if (sampledEffect->effect() && sampledEffect->effect()->animation()->pla ying() && sampledEffect->effect()->hasActiveAnimationsOnCompositor(property))
90 return true; 90 return true;
91 } 91 }
92 return false; 92 return false;
93 } 93 }
94 94
95 ActiveInterpolationsMap AnimationStack::activeInterpolations(AnimationStack* ani mationStack, const HeapVector<Member<const InertEffect>>* newAnimations, const H eapHashSet<Member<const Animation>>* suppressedAnimations, KeyframeEffect::Prior ity priority, PropertyHandleFilter propertyHandleFilter) 95 ActiveInterpolationsMap AnimationStack::activeInterpolations(AnimationStack* ani mationStack, const HeapVector<Member<const InertEffect>>* newAnimations, const H eapHashSet<Member<const Animation>>* suppressedAnimations, KeyframeEffectReadOnl y::Priority priority, PropertyHandleFilter propertyHandleFilter)
96 { 96 {
97 ActiveInterpolationsMap result; 97 ActiveInterpolationsMap result;
98 98
99 if (animationStack) { 99 if (animationStack) {
100 HeapVector<Member<SampledEffect>>& sampledEffects = animationStack->m_sa mpledEffects; 100 HeapVector<Member<SampledEffect>>& sampledEffects = animationStack->m_sa mpledEffects;
101 // std::sort doesn't work with OwnPtrs 101 // std::sort doesn't work with OwnPtrs
102 nonCopyingSort(sampledEffects.begin(), sampledEffects.end(), compareSamp ledEffects); 102 nonCopyingSort(sampledEffects.begin(), sampledEffects.end(), compareSamp ledEffects);
103 animationStack->removeRedundantSampledEffects(); 103 animationStack->removeRedundantSampledEffects();
104 for (const auto& sampledEffect : sampledEffects) { 104 for (const auto& sampledEffect : sampledEffects) {
105 if (sampledEffect->priority() != priority || (suppressedAnimations & & sampledEffect->effect() && suppressedAnimations->contains(sampledEffect->effec t()->animation()))) 105 if (sampledEffect->priority() != priority || (suppressedAnimations & & sampledEffect->effect() && suppressedAnimations->contains(sampledEffect->effec t()->animation())))
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 FloatBox expandingBox(originalBox); 153 FloatBox expandingBox(originalBox);
154 if (!CompositorAnimations::getAnimatedBoundingBox(expandingBox, *eff ect->model(), startRange, endRange)) 154 if (!CompositorAnimations::getAnimatedBoundingBox(expandingBox, *eff ect->model(), startRange, endRange))
155 return false; 155 return false;
156 box.expandTo(expandingBox); 156 box.expandTo(expandingBox);
157 } 157 }
158 } 158 }
159 return true; 159 return true;
160 } 160 }
161 161
162 } // namespace blink 162 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698