Bug 1207734 - Part 4.c. Temporary disable async-transform for individual-transform. draft
authorcku <cku@mozilla.com>
Fri, 05 Jan 2018 14:45:05 +0800
changeset 720494 4815827ed4566374e80d025e1b60eccc1287d404
parent 720493 fd603c0591ad758e216be11a033734bc36566d88
child 720495 8c679766236af008c542b4b18b40672e1c648a3e
push id95566
push userbmo:cku@mozilla.com
push dateMon, 15 Jan 2018 18:18:47 +0000
bugs1207734
milestone59.0a1
Bug 1207734 - Part 4.c. Temporary disable async-transform for individual-transform. Since we do not support async-transform for individual-transform yet. MozReview-Commit-ID: gfOzHpjOnQ
dom/animation/KeyframeEffectReadOnly.cpp
layout/style/nsStyleStruct.h
--- a/dom/animation/KeyframeEffectReadOnly.cpp
+++ b/dom/animation/KeyframeEffectReadOnly.cpp
@@ -1665,16 +1665,22 @@ KeyframeEffectReadOnly::ShouldBlockAsync
     if (property.mProperty == eCSSProperty_transform) {
       if (!CanAnimateTransformOnCompositor(aFrame,
                                            aPerformanceWarning)) {
         return true;
       }
     }
   }
 
+  // XXX cku temporarily disable async-animation when this frame has any
+  // individual transforms before bug 1425837 been fixed.
+  if (aFrame->StyleDisplay()->HasIndividualTransform()) {
+    return true;
+  }
+
   return false;
 }
 
 bool
 KeyframeEffectReadOnly::HasGeometricProperties() const
 {
   for (const AnimationProperty& property : mProperties) {
     if (IsGeometricProperty(property.mProperty)) {
--- a/layout/style/nsStyleStruct.h
+++ b/layout/style/nsStyleStruct.h
@@ -2798,16 +2798,20 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsSt
    * or a related property. */
   bool HasTransformStyle() const {
     return mSpecifiedTransform || mSpecifiedRotate || mSpecifiedTranslate ||
            mSpecifiedScale ||
            mTransformStyle == NS_STYLE_TRANSFORM_STYLE_PRESERVE_3D ||
            (mWillChangeBitField & NS_STYLE_WILL_CHANGE_TRANSFORM);
   }
 
+  bool HasIndividualTransform() const {
+    return mSpecifiedRotate || mSpecifiedTranslate || mSpecifiedScale;
+  }
+
   bool HasPerspectiveStyle() const {
     return mChildPerspective.GetUnit() == eStyleUnit_Coord;
   }
 
   bool BackfaceIsHidden() const {
     return mBackfaceVisibility == NS_STYLE_BACKFACE_VISIBILITY_HIDDEN;
   }