Chromium Code Reviews| 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 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 238 } | 238 } |
| 239 #endif | 239 #endif |
| 240 | 240 |
| 241 bool KeyframeEffect::isCandidateForAnimationOnCompositor(double animationPlaybac kRate) const | 241 bool KeyframeEffect::isCandidateForAnimationOnCompositor(double animationPlaybac kRate) const |
| 242 { | 242 { |
| 243 if (!model() | 243 if (!model() |
| 244 || !m_target | 244 || !m_target |
| 245 || (m_target->computedStyle() && m_target->computedStyle()->hasMotionPat h())) | 245 || (m_target->computedStyle() && m_target->computedStyle()->hasMotionPat h())) |
| 246 return false; | 246 return false; |
| 247 | 247 |
| 248 // Put transform operations on compositor iff that single transform | |
| 249 // is on ComputedStyle and that is the one being animated because we need | |
| 250 // to order the transforms correctly | |
| 251 if (m_target->computedStyle()) { | |
| 252 unsigned transformCounts = 0; | |
| 253 if (m_target->computedStyle()->rotate()) | |
| 254 transformCounts++; | |
| 255 if (m_target->computedStyle()->scale()) | |
| 256 transformCounts++; | |
| 257 if (m_target->computedStyle()->translate()) | |
| 258 transformCounts++; | |
| 259 if (m_target->computedStyle()->hasTransformOperations()) | |
| 260 transformCounts++; | |
| 261 if (transformCounts > 1) | |
| 262 return false; | |
| 263 } | |
|
Eric Willigers
2015/06/23 06:50:48
Does KeyframeEffect::applyEffects() need the same
soonm
2015/06/24 00:26:44
Will move into new methods in a new patch with com
| |
| 264 | |
| 248 return CompositorAnimations::instance()->isCandidateForAnimationOnCompositor (specifiedTiming(), *m_target, animation(), *model(), animationPlaybackRate); | 265 return CompositorAnimations::instance()->isCandidateForAnimationOnCompositor (specifiedTiming(), *m_target, animation(), *model(), animationPlaybackRate); |
| 249 } | 266 } |
| 250 | 267 |
| 251 bool KeyframeEffect::maybeStartAnimationOnCompositor(int group, double startTime , double currentTime, double animationPlaybackRate) | 268 bool KeyframeEffect::maybeStartAnimationOnCompositor(int group, double startTime , double currentTime, double animationPlaybackRate) |
| 252 { | 269 { |
| 253 ASSERT(!hasActiveAnimationsOnCompositor()); | 270 ASSERT(!hasActiveAnimationsOnCompositor()); |
| 254 if (!isCandidateForAnimationOnCompositor(animationPlaybackRate)) | 271 if (!isCandidateForAnimationOnCompositor(animationPlaybackRate)) |
| 255 return false; | 272 return false; |
| 256 if (!CompositorAnimations::instance()->canStartAnimationOnCompositor(*m_targ et)) | 273 if (!CompositorAnimations::instance()->canStartAnimationOnCompositor(*m_targ et)) |
| 257 return false; | 274 return false; |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 332 | 349 |
| 333 DEFINE_TRACE(KeyframeEffect) | 350 DEFINE_TRACE(KeyframeEffect) |
| 334 { | 351 { |
| 335 visitor->trace(m_target); | 352 visitor->trace(m_target); |
| 336 visitor->trace(m_model); | 353 visitor->trace(m_model); |
| 337 visitor->trace(m_sampledEffect); | 354 visitor->trace(m_sampledEffect); |
| 338 AnimationEffect::trace(visitor); | 355 AnimationEffect::trace(visitor); |
| 339 } | 356 } |
| 340 | 357 |
| 341 } // namespace blink | 358 } // namespace blink |
| OLD | NEW |