bool KeyframeEffect::isCandidateForAnimationOnCompositor(double animationPlaybackRate) const
{
    // Do not put transforms on compositor if more than one of them are defined
    // in computed style because they need to be explicitly ordered
    if (!model()
        || !m_target
        || (m_target->computedStyle() && m_target->computedStyle()->hasMotionPath())
        || hasMultipleTransformProperties())
        return false;

    return CompositorAnimations::instance()->isCandidateForAnimationOnCompositor(specifiedTiming(), *m_target, animation(), *model(), animationPlaybackRate);
}
Esempio n. 2
0
// Returns true if transform, translate, rotate or scale is composited
// and a motion path or other transform properties
// has been introduced on the element
bool KeyframeEffectReadOnly::hasIncompatibleStyle() {
  if (!m_target->computedStyle())
    return false;

  bool affectsTransform =
      animation()->affects(*m_target, CSSPropertyTransform) ||
      animation()->affects(*m_target, CSSPropertyScale) ||
      animation()->affects(*m_target, CSSPropertyRotate) ||
      animation()->affects(*m_target, CSSPropertyTranslate);

  if (animation()->hasActiveAnimationsOnCompositor()) {
    if (m_target->computedStyle()->hasOffset() && affectsTransform)
      return true;
    return hasMultipleTransformProperties();
  }

  return false;
}