OLD | NEW |
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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 { | 155 { |
156 if (!m_target->computedStyle()) | 156 if (!m_target->computedStyle()) |
157 return false; | 157 return false; |
158 | 158 |
159 bool affectsTransform = animation()->affects(*m_target, CSSPropertyTransform
) | 159 bool affectsTransform = animation()->affects(*m_target, CSSPropertyTransform
) |
160 || animation()->affects(*m_target, CSSPropertyScale) | 160 || animation()->affects(*m_target, CSSPropertyScale) |
161 || animation()->affects(*m_target, CSSPropertyRotate) | 161 || animation()->affects(*m_target, CSSPropertyRotate) |
162 || animation()->affects(*m_target, CSSPropertyTranslate); | 162 || animation()->affects(*m_target, CSSPropertyTranslate); |
163 | 163 |
164 if (animation()->hasActiveAnimationsOnCompositor()) { | 164 if (animation()->hasActiveAnimationsOnCompositor()) { |
165 if (m_target->computedStyle()->hasMotionPath() && affectsTransform) | 165 if (m_target->computedStyle()->hasOffsetPath() && affectsTransform) |
166 return true; | 166 return true; |
167 return hasMultipleTransformProperties(); | 167 return hasMultipleTransformProperties(); |
168 } | 168 } |
169 | 169 |
170 return false; | 170 return false; |
171 } | 171 } |
172 | 172 |
173 void KeyframeEffect::applyEffects() | 173 void KeyframeEffect::applyEffects() |
174 { | 174 { |
175 DCHECK(isInEffect()); | 175 DCHECK(isInEffect()); |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 { | 274 { |
275 m_sampledEffect = nullptr; | 275 m_sampledEffect = nullptr; |
276 } | 276 } |
277 | 277 |
278 bool KeyframeEffect::isCandidateForAnimationOnCompositor(double animationPlaybac
kRate) const | 278 bool KeyframeEffect::isCandidateForAnimationOnCompositor(double animationPlaybac
kRate) const |
279 { | 279 { |
280 // Do not put transforms on compositor if more than one of them are defined | 280 // Do not put transforms on compositor if more than one of them are defined |
281 // in computed style because they need to be explicitly ordered | 281 // in computed style because they need to be explicitly ordered |
282 if (!model() | 282 if (!model() |
283 || !m_target | 283 || !m_target |
284 || (m_target->computedStyle() && m_target->computedStyle()->hasMotionPat
h()) | 284 || (m_target->computedStyle() && m_target->computedStyle()->hasOffsetPat
h()) |
285 || hasMultipleTransformProperties()) | 285 || hasMultipleTransformProperties()) |
286 return false; | 286 return false; |
287 | 287 |
288 return CompositorAnimations::isCandidateForAnimationOnCompositor(specifiedTi
ming(), *m_target, animation(), *model(), animationPlaybackRate); | 288 return CompositorAnimations::isCandidateForAnimationOnCompositor(specifiedTi
ming(), *m_target, animation(), *model(), animationPlaybackRate); |
289 } | 289 } |
290 | 290 |
291 bool KeyframeEffect::maybeStartAnimationOnCompositor(int group, double startTime
, double currentTime, double animationPlaybackRate) | 291 bool KeyframeEffect::maybeStartAnimationOnCompositor(int group, double startTime
, double currentTime, double animationPlaybackRate) |
292 { | 292 { |
293 DCHECK(!hasActiveAnimationsOnCompositor()); | 293 DCHECK(!hasActiveAnimationsOnCompositor()); |
294 if (!isCandidateForAnimationOnCompositor(animationPlaybackRate)) | 294 if (!isCandidateForAnimationOnCompositor(animationPlaybackRate)) |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 | 363 |
364 DEFINE_TRACE(KeyframeEffect) | 364 DEFINE_TRACE(KeyframeEffect) |
365 { | 365 { |
366 visitor->trace(m_target); | 366 visitor->trace(m_target); |
367 visitor->trace(m_model); | 367 visitor->trace(m_model); |
368 visitor->trace(m_sampledEffect); | 368 visitor->trace(m_sampledEffect); |
369 AnimationEffectReadOnly::trace(visitor); | 369 AnimationEffectReadOnly::trace(visitor); |
370 } | 370 } |
371 | 371 |
372 } // namespace blink | 372 } // namespace blink |
OLD | NEW |