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

Side by Side Diff: Source/core/animation/KeyframeEffect.cpp

Issue 1158603003: CSS Independent Transform Properties (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Remove animation from CL Created 5 years, 6 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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 return element->ensureElementAnimations().defaultStack(); 129 return element->ensureElementAnimations().defaultStack();
130 } 130 }
131 131
132 void KeyframeEffect::applyEffects() 132 void KeyframeEffect::applyEffects()
133 { 133 {
134 ASSERT(isInEffect()); 134 ASSERT(isInEffect());
135 ASSERT(animation()); 135 ASSERT(animation());
136 if (!m_target || !m_model) 136 if (!m_target || !m_model)
137 return; 137 return;
138 138
139 // Cancel composited animation of transform if a motion path has been introd uced on the element. 139 // Cancel composited animation of transform if a motion path or
140 // transform properties has been introduced on the element.
140 if (m_target->computedStyle() 141 if (m_target->computedStyle()
141 && m_target->computedStyle()->hasMotionPath() 142 && (m_target->computedStyle()->hasMotionPath() || m_target->computedStyl e()->hasTransformProperties())
142 && animation()->hasActiveAnimationsOnCompositor() 143 && animation()->hasActiveAnimationsOnCompositor()
143 && animation()->affects(*m_target, CSSPropertyTransform)) { 144 && animation()->affects(*m_target, CSSPropertyTransform)) {
144 animation()->cancelAnimationOnCompositor(); 145 animation()->cancelAnimationOnCompositor();
145 } 146 }
146 147
147 double iteration = currentIteration(); 148 double iteration = currentIteration();
148 ASSERT(iteration >= 0); 149 ASSERT(iteration >= 0);
149 OwnPtrWillBeRawPtr<WillBeHeapVector<RefPtrWillBeMember<Interpolation>>> inte rpolations = m_sampledEffect ? m_sampledEffect->mutableInterpolations() : nullpt r; 150 OwnPtrWillBeRawPtr<WillBeHeapVector<RefPtrWillBeMember<Interpolation>>> inte rpolations = m_sampledEffect ? m_sampledEffect->mutableInterpolations() : nullpt r;
150 // FIXME: Handle iteration values which overflow int. 151 // FIXME: Handle iteration values which overflow int.
151 m_model->sample(static_cast<int>(iteration), timeFraction(), iterationDurati on(), interpolations); 152 m_model->sample(static_cast<int>(iteration), timeFraction(), iterationDurati on(), interpolations);
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 m_sampledEffect = nullptr; 236 m_sampledEffect = nullptr;
236 if (sampledEffect) 237 if (sampledEffect)
237 sampledEffect->clear(); 238 sampledEffect->clear();
238 } 239 }
239 #endif 240 #endif
240 241
241 bool KeyframeEffect::isCandidateForAnimationOnCompositor(double animationPlaybac kRate) const 242 bool KeyframeEffect::isCandidateForAnimationOnCompositor(double animationPlaybac kRate) const
242 { 243 {
243 if (!model() 244 if (!model()
244 || !m_target 245 || !m_target
245 || (m_target->computedStyle() && m_target->computedStyle()->hasMotionPat h())) 246 || (m_target->computedStyle() && (m_target->computedStyle()->hasMotionPa th() || m_target->computedStyle()->hasTransformProperties())))
246 return false; 247 return false;
247 248
248 return CompositorAnimations::instance()->isCandidateForAnimationOnCompositor (specifiedTiming(), *m_target, animation(), *model(), animationPlaybackRate); 249 return CompositorAnimations::instance()->isCandidateForAnimationOnCompositor (specifiedTiming(), *m_target, animation(), *model(), animationPlaybackRate);
249 } 250 }
250 251
251 bool KeyframeEffect::maybeStartAnimationOnCompositor(int group, double startTime , double currentTime, double animationPlaybackRate) 252 bool KeyframeEffect::maybeStartAnimationOnCompositor(int group, double startTime , double currentTime, double animationPlaybackRate)
252 { 253 {
253 ASSERT(!hasActiveAnimationsOnCompositor()); 254 ASSERT(!hasActiveAnimationsOnCompositor());
254 if (!isCandidateForAnimationOnCompositor(animationPlaybackRate)) 255 if (!isCandidateForAnimationOnCompositor(animationPlaybackRate))
255 return false; 256 return false;
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 333
333 DEFINE_TRACE(KeyframeEffect) 334 DEFINE_TRACE(KeyframeEffect)
334 { 335 {
335 visitor->trace(m_target); 336 visitor->trace(m_target);
336 visitor->trace(m_model); 337 visitor->trace(m_model);
337 visitor->trace(m_sampledEffect); 338 visitor->trace(m_sampledEffect);
338 AnimationEffect::trace(visitor); 339 AnimationEffect::trace(visitor);
339 } 340 }
340 341
341 } // namespace blink 342 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698