Backed out 2 changesets (bug 1456679) for Reftests failure. CLOSED TREE
authorDorel Luca <dluca@mozilla.com>
Thu, 26 Apr 2018 05:07:47 +0300
changeset 471692 52e0b45195cb8f9a0e6c3fc4d9ee49f025232010
parent 471691 e331c3b551445f8f2c4747eb5e9777b5cbbf41c4
child 471693 76f35d0ecaa690917347f2b0f97180b05e7272bb
push id1728
push userjlund@mozilla.com
push dateMon, 18 Jun 2018 21:12:27 +0000
treeherdermozilla-release@c296fde26f5f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1456679
milestone61.0a1
backs outc40209504a45529f23a2722a16a012424eb01ed6
351ae90cc6a0ac002a270233edcaaadafeee71bd
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out 2 changesets (bug 1456679) for Reftests failure. CLOSED TREE Backed out changeset c40209504a45 (bug 1456679) Backed out changeset 351ae90cc6a0 (bug 1456679)
gfx/layers/AnimationHelper.cpp
gfx/layers/AnimationHelper.h
gfx/layers/ipc/WebRenderMessages.ipdlh
gfx/layers/wr/WebRenderBridgeParent.cpp
gfx/layers/wr/WebRenderBridgeParent.h
layout/painting/nsDisplayList.cpp
--- a/gfx/layers/AnimationHelper.cpp
+++ b/gfx/layers/AnimationHelper.cpp
@@ -541,37 +541,35 @@ AnimationHelper::GetNextCompositorAnimat
   ++sNextId;
 
   uint32_t procId = static_cast<uint32_t>(base::GetCurrentProcId());
   uint64_t nextId = procId;
   nextId = nextId << 32 | sNextId;
   return nextId;
 }
 
-bool
+void
 AnimationHelper::SampleAnimations(CompositorAnimationStorage* aStorage,
                                   TimeStamp aTime)
 {
   MOZ_ASSERT(aStorage);
-  bool isAnimating = false;
 
   // Do nothing if there are no compositor animations
   if (!aStorage->AnimationsCount()) {
-    return isAnimating;
+    return;
   }
 
   //Sample the animations in CompositorAnimationStorage
   for (auto iter = aStorage->ConstAnimationsTableIter();
        !iter.Done(); iter.Next()) {
     AnimationArray* animations = iter.UserData();
     if (animations->IsEmpty()) {
       continue;
     }
 
-    isAnimating = true;
     RefPtr<RawServoAnimationValue> animationValue;
     InfallibleTArray<AnimData> animationData;
     AnimationHelper::SetAnimations(*animations,
                                    animationData,
                                    animationValue);
     AnimationHelper::SampleResult sampleResult =
       AnimationHelper::SampleAnimationForEachNode(aTime,
                                                   *animations,
@@ -623,14 +621,12 @@ AnimationHelper::SampleAnimations(Compos
                                    Move(transform), Move(frameTransform),
                                    transformData);
         break;
       }
       default:
         MOZ_ASSERT_UNREACHABLE("Unhandled animated property");
     }
   }
-
-  return isAnimating;
 }
 
 } // namespace layers
 } // namespace mozilla
--- a/gfx/layers/AnimationHelper.h
+++ b/gfx/layers/AnimationHelper.h
@@ -243,23 +243,18 @@ public:
    * data.
    */
   static uint64_t GetNextCompositorAnimationsId();
 
   /**
    * Sample animation based a given time stamp |aTime| and the animation
    * data inside CompositorAnimationStorage |aStorage|. The animated values
    * after sampling will be stored in CompositorAnimationStorage as well.
-   *
-   * Returns true if there is any animation.
-   * Note that even if there are only in-delay phase animations (i.e. not
-   * visually effective), this function returns true to ensure we composite
-   * again on the next tick.
    */
-  static bool
+  static void
   SampleAnimations(CompositorAnimationStorage* aStorage,
                    TimeStamp aTime);
 };
 
 } // namespace layers
 } // namespace mozilla
 
 #endif // mozilla_layers_AnimationHelper_h
--- a/gfx/layers/ipc/WebRenderMessages.ipdlh
+++ b/gfx/layers/ipc/WebRenderMessages.ipdlh
@@ -48,16 +48,18 @@ union OptionalOpacity {
 
 struct OpAddExternalImage {
   ExternalImageId externalImageId;
   ImageKey key;
 };
 
 struct OpAddCompositorAnimations {
   CompositorAnimations data;
+  OptionalTransform transform;
+  OptionalOpacity opacity;
 };
 
 struct OpAddPipelineIdForCompositable {
   PipelineId pipelineId;
   CompositableHandle handle;
   bool isAsync;
 };
 
--- a/gfx/layers/wr/WebRenderBridgeParent.cpp
+++ b/gfx/layers/wr/WebRenderBridgeParent.cpp
@@ -771,16 +771,25 @@ WebRenderBridgeParent::ProcessWebRenderP
         break;
       }
       case WebRenderParentCommand::TOpAddCompositorAnimations: {
         const OpAddCompositorAnimations& op = cmd.get_OpAddCompositorAnimations();
         CompositorAnimations data(Move(op.data()));
         if (data.animations().Length()) {
           mAnimStorage->SetAnimations(data.id(), data.animations());
           mActiveAnimations.insert(data.id());
+          // Store the default opacity
+          if (op.opacity().type() == OptionalOpacity::Tfloat) {
+            mAnimStorage->SetAnimatedValue(data.id(), op.opacity().get_float());
+          }
+          // Store the default transform
+          if (op.transform().type() == OptionalTransform::TMatrix4x4) {
+            Matrix4x4 transform(Move(op.transform().get_Matrix4x4()));
+            mAnimStorage->SetAnimatedValue(data.id(), Move(transform));
+          }
         }
         break;
       }
       default: {
         // other commands are handle on the child
         break;
       }
     }
@@ -1162,71 +1171,67 @@ WebRenderBridgeParent::RecvGetAPZTestDat
 }
 
 void
 WebRenderBridgeParent::ActorDestroy(ActorDestroyReason aWhy)
 {
   Destroy();
 }
 
-bool
+void
 WebRenderBridgeParent::AdvanceAnimations()
 {
   if (CompositorBridgeParent* cbp = GetRootCompositorBridgeParent()) {
     Maybe<TimeStamp> testingTimeStamp = cbp->GetTestingTimeStamp();
     if (testingTimeStamp) {
       // If we are on testing refresh mode, use the testing time stamp.  And
       // also we don't update mPreviousFrameTimeStamp since unlike normal
       // refresh mode, on the testing mode animations on the compositor are
       // synchronously composed, so we don't need to worry about the time gap
       // between the main thread and compositor thread.
-      return AnimationHelper::SampleAnimations(mAnimStorage, *testingTimeStamp);
+      AnimationHelper::SampleAnimations(mAnimStorage, *testingTimeStamp);
+      return;
     }
   }
 
   TimeStamp lastComposeTime = mCompositorScheduler->GetLastComposeTime();
   // if we have already mPreviousTimeStamp, use it since on the compositor the
   // time in the previous tick is more closer to the main-thread tick time.
-  const bool isAnimating =
-    AnimationHelper::SampleAnimations(mAnimStorage,
+  AnimationHelper::SampleAnimations(mAnimStorage,
       !mPreviousFrameTimeStamp.IsNull()
       ? mPreviousFrameTimeStamp
       : lastComposeTime);
 
   // Reset the previous time stamp if we don't already have any running
   // animations to avoid using the time which is far behind for newly
   // started animations.
   mPreviousFrameTimeStamp =
     mAnimStorage->AnimatedValueCount() ? lastComposeTime : TimeStamp();
-
-  return isAnimating;
 }
 
-bool
+void
 WebRenderBridgeParent::SampleAnimations(nsTArray<wr::WrOpacityProperty>& aOpacityArray,
                                         nsTArray<wr::WrTransformProperty>& aTransformArray)
 {
-  const bool isAnimating = AdvanceAnimations();
+  AdvanceAnimations();
 
   // return the animated data if has
   if (mAnimStorage->AnimatedValueCount()) {
     for(auto iter = mAnimStorage->ConstAnimatedValueTableIter();
         !iter.Done(); iter.Next()) {
       AnimatedValue * value = iter.UserData();
       if (value->mType == AnimatedValue::TRANSFORM) {
         aTransformArray.AppendElement(
           wr::ToWrTransformProperty(iter.Key(), value->mTransform.mTransformInDevSpace));
       } else if (value->mType == AnimatedValue::OPACITY) {
         aOpacityArray.AppendElement(
           wr::ToWrOpacityProperty(iter.Key(), value->mOpacity));
       }
     }
   }
-
-  return isAnimating;
 }
 
 void
 WebRenderBridgeParent::CompositeToTarget(gfx::DrawTarget* aTarget, const gfx::IntRect* aRect)
 {
   // This function should only get called in the root WRBP
   MOZ_ASSERT(mWidget);
 
@@ -1263,17 +1268,18 @@ WebRenderBridgeParent::CompositeToTarget
     return;
   }
 
   wr::TransactionBuilder txn;
 
   nsTArray<wr::WrOpacityProperty> opacityArray;
   nsTArray<wr::WrTransformProperty> transformArray;
 
-  if (SampleAnimations(opacityArray, transformArray)) {
+  SampleAnimations(opacityArray, transformArray);
+  if (!transformArray.IsEmpty() || !opacityArray.IsEmpty()) {
     ScheduleGenerateFrame();
   }
   // We do this even if the arrays are empty, because it will clear out any
   // previous properties store on the WR side, which is desirable.
   txn.UpdateDynamicProperties(opacityArray, transformArray);
 
   SetAPZSampleTime();
 
--- a/gfx/layers/wr/WebRenderBridgeParent.h
+++ b/gfx/layers/wr/WebRenderBridgeParent.h
@@ -209,20 +209,18 @@ private:
   LayersId GetLayersId() const;
   void ProcessWebRenderParentCommands(const InfallibleTArray<WebRenderParentCommand>& aCommands);
 
   void ClearResources();
   uint64_t GetChildLayerObserverEpoch() const { return mChildLayerObserverEpoch; }
   bool ShouldParentObserveEpoch();
   mozilla::ipc::IPCResult HandleShutdown();
 
-  // Returns true if there is any animation (including animations in delay
-  // phase).
-  bool AdvanceAnimations();
-  bool SampleAnimations(nsTArray<wr::WrOpacityProperty>& aOpacityArray,
+  void AdvanceAnimations();
+  void SampleAnimations(nsTArray<wr::WrOpacityProperty>& aOpacityArray,
                         nsTArray<wr::WrTransformProperty>& aTransformArray);
 
   CompositorBridgeParent* GetRootCompositorBridgeParent() const;
 
   // Tell APZ what the subsequent sampling's timestamp should be.
   void SetAPZSampleTime();
 
   wr::Epoch GetNextWrEpoch();
--- a/layout/painting/nsDisplayList.cpp
+++ b/layout/painting/nsDisplayList.cpp
@@ -6696,22 +6696,24 @@ nsDisplayOpacity::CreateWebRenderCommand
 
   // Note that animationsId can be 0 (uninitialized in AnimationInfo) if there
   // are no active animations.
   uint64_t animationsId = animationInfo.GetCompositorAnimationsId();
   wr::WrAnimationProperty prop;
 
   if (!animationInfo.GetAnimations().IsEmpty()) {
     opacityForSC = nullptr;
+    OptionalOpacity opacityForCompositor = mOpacity;
     prop.id = animationsId;
     prop.effect_type = wr::WrAnimationType::Opacity;
 
 
     OpAddCompositorAnimations
-      anim(CompositorAnimations(animationInfo.GetAnimations(), animationsId));
+      anim(CompositorAnimations(animationInfo.GetAnimations(), animationsId),
+           void_t(), opacityForCompositor);
     aManager->WrBridge()->AddWebRenderParentCommand(anim);
     aManager->AddActiveCompositorAnimationId(animationsId);
   } else if (animationsId) {
     aManager->AddCompositorAnimationsIdForDiscard(animationsId);
     animationsId = 0;
   }
 
   nsTArray<mozilla::wr::WrFilterOp> filters;
@@ -8547,18 +8549,23 @@ nsDisplayTransform::CreateWebRenderComma
     // Update transfrom as nullptr in stacking context if there exists
     // transform animation, the transform value will be resolved
     // after animation sampling on the compositor
     transformForSC = nullptr;
 
     prop.id = animationsId;
     prop.effect_type = wr::WrAnimationType::Transform;
 
+    // Pass default transform to compositor in case gecko fails to
+    // get animated value after animation sampling.
+    OptionalTransform transformForCompositor = newTransformMatrix;
+
     OpAddCompositorAnimations
-      anim(CompositorAnimations(animationInfo.GetAnimations(), animationsId));
+      anim(CompositorAnimations(animationInfo.GetAnimations(), animationsId),
+           transformForCompositor, void_t());
     aManager->WrBridge()->AddWebRenderParentCommand(anim);
     aManager->AddActiveCompositorAnimationId(animationsId);
   } else if (animationsId) {
     aManager->AddCompositorAnimationsIdForDiscard(animationsId);
     animationsId = 0;
   }
 
   nsTArray<mozilla::wr::WrFilterOp> filters;