Bug 1337889 - use CompositorAnimationsId to query Opacity/Transform animation, r?hiro draft
authorpeter chang <pchang@mozilla.com>
Thu, 09 Feb 2017 17:30:11 -0500
changeset 485182 8fbd705964a02d42ff4f1d38d963d01ec063ce51
parent 485181 66f40ebeb0aed056112c213cf6a5b3cb0149f6cd
child 545958 b34b95bbbb15bd1d71b6f474af13a0deaf24c49e
push id45669
push userbmo:howareyou322@gmail.com
push dateThu, 16 Feb 2017 09:54:30 +0000
reviewershiro
bugs1337889
milestone54.0a1
Bug 1337889 - use CompositorAnimationsId to query Opacity/Transform animation, r?hiro MozReview-Commit-ID: 3s1kzOQAfrd
dom/base/nsDOMWindowUtils.cpp
gfx/layers/AnimationHelper.cpp
gfx/layers/AnimationHelper.h
gfx/layers/Layers.cpp
gfx/layers/composite/AsyncCompositionManager.cpp
gfx/layers/ipc/LayerTransactionParent.cpp
gfx/layers/ipc/LayerTransactionParent.h
gfx/layers/ipc/PLayerTransaction.ipdl
--- a/dom/base/nsDOMWindowUtils.cpp
+++ b/dom/base/nsDOMWindowUtils.cpp
@@ -3667,36 +3667,37 @@ nsDOMWindowUtils::GetOMTAStyle(nsIDOMEle
       Layer* layer =
         FrameLayerBuilder::GetDedicatedLayer(frame,
                                              nsDisplayItem::TYPE_OPACITY);
       if (layer) {
         ShadowLayerForwarder* forwarder = layer->Manager()->AsShadowForwarder();
         if (forwarder && forwarder->HasShadowManager()) {
           float value;
           bool hadAnimatedOpacity;
-          forwarder->GetShadowManager()->SendGetAnimationOpacity(
-            layer->AsShadowableLayer()->GetShadow(),
-            &value, &hadAnimatedOpacity);
+          forwarder->GetShadowManager()->
+            SendGetAnimationOpacity(layer->GetCompositorAnimationsId(),
+                                    &value,
+                                    &hadAnimatedOpacity);
 
           if (hadAnimatedOpacity) {
             cssValue = new nsROCSSPrimitiveValue;
             cssValue->SetNumber(value);
           }
         }
       }
     } else if (aProperty.EqualsLiteral("transform")) {
       Layer* layer =
         FrameLayerBuilder::GetDedicatedLayer(frame,
                                              nsDisplayItem::TYPE_TRANSFORM);
       if (layer) {
         ShadowLayerForwarder* forwarder = layer->Manager()->AsShadowForwarder();
         if (forwarder && forwarder->HasShadowManager()) {
           MaybeTransform transform;
-          forwarder->GetShadowManager()->SendGetAnimationTransform(
-            layer->AsShadowableLayer()->GetShadow(), &transform);
+          forwarder->GetShadowManager()->
+            SendGetAnimationTransform(layer->GetCompositorAnimationsId(), &transform);
           if (transform.type() == MaybeTransform::TMatrix4x4) {
             Matrix4x4 matrix = transform.get_Matrix4x4();
             cssValue = nsComputedDOMStyle::MatrixToCSSValue(matrix);
           }
         }
       }
     }
   }
--- a/gfx/layers/AnimationHelper.cpp
+++ b/gfx/layers/AnimationHelper.cpp
@@ -16,16 +16,109 @@
 namespace mozilla {
 namespace layers {
 
 struct StyleAnimationValueCompositePair {
   StyleAnimationValue mValue;
   dom::CompositeOperation mComposite;
 };
 
+/*static*/
+StaticAutoPtr<CompositorAnimationStorage> CompositorAnimationStorage::sInstance;
+
+/*static*/
+CompositorAnimationStorage*
+CompositorAnimationStorage::GetInstance()
+{
+  MOZ_ASSERT(CompositorThreadHolder::IsInCompositorThread());
+  if (!sInstance) {
+    sInstance = new CompositorAnimationStorage;
+    //TODO how to clean up this after shutdown
+  }
+
+  return sInstance.get();
+}
+
+void
+CompositorAnimationStorage::Clear()
+{
+  mAnimatedValues.Clear();
+  mAnimations.Clear();
+}
+
+bool
+CompositorAnimationStorage::GetAnimatedValue(uint64_t aId, StyleAnimationValue& aValue)
+{
+  MOZ_ASSERT(CompositorThreadHolder::IsInCompositorThread());
+  bool found = false;
+  for (auto pair : mAnimatedValues) {
+    if (pair.first() == aId) {
+      aValue = pair.second();
+      found = true;
+      break;
+    }
+  }
+
+  return found;
+}
+
+void
+CompositorAnimationStorage::SetAnimatedValue(uint64_t aId, const StyleAnimationValue& aValue)
+{
+  MOZ_ASSERT(CompositorThreadHolder::IsInCompositorThread());
+
+  bool found = false;
+  for (uint32_t i = 0; i < mAnimatedValues.Length(); ++i) {
+    if (mAnimatedValues[i].first() == aId) {
+      mAnimatedValues[i].second() = aValue;
+      found = true;
+      break;
+    }
+  }
+
+  if (!found) {
+    mAnimatedValues.AppendElement(AnimatedValuePair(aId, aValue));
+  }
+}
+
+bool
+CompositorAnimationStorage::GetAnimations(uint64_t aId, AnimationArray& aValue)
+{
+  MOZ_ASSERT(CompositorThreadHolder::IsInCompositorThread());
+  bool found = false;
+  for (auto pair : mAnimations) {
+    if (pair.first() == aId) {
+      aValue = pair.second();
+      found = true;
+      break;
+    }
+  }
+
+  return found;
+}
+
+void
+CompositorAnimationStorage::SetAnimations(uint64_t aId, const AnimationArray& aValue)
+{
+  MOZ_ASSERT(CompositorThreadHolder::IsInCompositorThread());
+
+  bool found = false;
+  for (uint32_t i = 0; i < mAnimations.Length(); ++i) {
+    if (mAnimations[i].first() == aId) {
+      mAnimations[i].second() = aValue;
+      found = true;
+      break;
+    }
+  }
+
+  if (!found) {
+    mAnimations.AppendElement(AnimationsPair(aId, aValue));
+  }
+}
+
 static StyleAnimationValue
 SampleValue(float aPortion, const layers::Animation& aAnimation,
             const StyleAnimationValueCompositePair& aStart,
             const StyleAnimationValueCompositePair& aEnd,
             const StyleAnimationValue& aLastValue,
             uint64_t aCurrentIteration,
             const StyleAnimationValue& aUnderlyingValue)
 {
--- a/gfx/layers/AnimationHelper.h
+++ b/gfx/layers/AnimationHelper.h
@@ -7,42 +7,96 @@
 #ifndef mozilla_layers_AnimationHelper_h
 #define mozilla_layers_AnimationHelper_h
 
 #include "mozilla/ComputedTimingFunction.h" // for ComputedTimingFunction
 #include "mozilla/TimeStamp.h"          // for TimeStamp
 
 
 namespace mozilla {
-  class StyleAnimationValue;
+class StyleAnimationValue;
 namespace layers {
 class Animation;
 
 typedef InfallibleTArray<layers::Animation> AnimationArray;
 
 struct AnimData {
   InfallibleTArray<mozilla::StyleAnimationValue> mStartValues;
   InfallibleTArray<mozilla::StyleAnimationValue> mEndValues;
   InfallibleTArray<Maybe<mozilla::ComputedTimingFunction>> mFunctions;
 };
 
+// CompositorAnimationStorage is a singleton that stores the layer animations
+// and animated value after sampling based on an unique id(CompositorAnimationsId)
+class CompositorAnimationStorage final
+{
+typedef Pair<uint64_t, StyleAnimationValue> AnimatedValuePair;
+typedef nsTArray<AnimatedValuePair> AnimatedValues;
+
+typedef Pair<uint64_t, AnimationArray> AnimationsPair;
+typedef nsTArray<AnimationsPair> Animations;
+
+public:
+
+  /**
+   * Get the singleton instance.
+   */
+  static CompositorAnimationStorage* GetInstance();
+
+  /**
+   * Set the animated value based on the unique id
+   */
+  void SetAnimatedValue(uint64_t aId, const StyleAnimationValue& aValue);
+
+  /**
+   * Return true if a given id can map to its animated value
+   */
+  bool GetAnimatedValue(uint64_t aId, StyleAnimationValue& aValue);
+
+  /**
+   * Set the animations based on the unique id
+   */
+  void SetAnimations(uint64_t aId, const AnimationArray& aAnimations);
+
+  /**
+   * Return true if a given id can map to its animations
+   */
+  bool GetAnimations(uint64_t aId, AnimationArray& aAnimations);
+
+  /**
+   * Clear AnimatedValues and Animations data
+   */
+  void Clear();
+
+private:
+  static StaticAutoPtr<CompositorAnimationStorage> sInstance;
+
+  AnimatedValues mAnimatedValues;
+  Animations mAnimations;
+};
+
 class AnimationHelper
 {
 public:
-
   static bool
   SampleAnimationForEachNode(TimeStamp aPoint,
                              AnimationArray& aAnimations,
                              InfallibleTArray<AnimData>& aAnimationData,
                              StyleAnimationValue& aAnimationValue,
                              bool& aHasInEffectAnimations);
 
   static void
   SetAnimations(AnimationArray& aAnimations,
                 InfallibleTArray<AnimData>& aAnimData,
                 StyleAnimationValue& aBaseAnimationStyle);
   static uint64_t GetNextCompositorAnimationsId();
+
+  // AnimatedPropArray will only be used inside compositor thread.
+  // Store new AnimatedProp pair after sampling the new animation value.
+  static void InitAnimatedPropArray();
+  static void StoreAnimatedPropValue(uint64_t aKey, const StyleAnimationValue& aValue);
+  static bool GetAnimatedPropValue(uint64_t aKey, StyleAnimationValue& aValue);
 };
 
 } // namespace layers
 } // namespace mozilla
 
 #endif // mozilla_layers_AnimationHelper_h
--- a/gfx/layers/Layers.cpp
+++ b/gfx/layers/Layers.cpp
@@ -266,16 +266,20 @@ Layer::SetCompositorAnimations(const Com
   MOZ_LAYERS_LOG_IF_SHADOWABLE(this, ("Layer::Mutated(%p) SetCompositorAnimations with id %llu", this, mCompositorAnimationsId));
 
   mAnimations = aCompositorAnimations.animations();
   mCompositorAnimationsId = aCompositorAnimations.id();
   mAnimationData.Clear();
   AnimationHelper::SetAnimations(mAnimations,
                                  mAnimationData,
                                  mBaseAnimationStyle);
+  if (mCompositorAnimationsId) {
+    CompositorAnimationStorage::GetInstance()->
+      SetAnimations(mCompositorAnimationsId, mAnimations);
+  }
 
   Mutated();
 }
 
 void
 Layer::StartPendingAnimations(const TimeStamp& aReadyTime)
 {
   ForEachNode<ForwardIterator>(
--- a/gfx/layers/composite/AsyncCompositionManager.cpp
+++ b/gfx/layers/composite/AsyncCompositionManager.cpp
@@ -582,16 +582,19 @@ ApplyAnimatedValue(Layer* aLayer,
 {
   HostLayer* layerCompositor = aLayer->AsHostLayer();
   switch (aProperty) {
     case eCSSProperty_opacity: {
       MOZ_ASSERT(aValue.GetUnit() == StyleAnimationValue::eUnit_Float,
                  "Interpolated value for opacity should be float");
       layerCompositor->SetShadowOpacity(aValue.GetFloatValue());
       layerCompositor->SetShadowOpacitySetByAnimation(true);
+      CompositorAnimationStorage::GetInstance()->
+        SetAnimatedValue(aLayer->GetCompositorAnimationsId(),
+                         aValue);
       break;
     }
     case eCSSProperty_transform: {
       MOZ_ASSERT(aValue.GetUnit() == StyleAnimationValue::eUnit_Transform,
                  "The unit of interpolated value for transform should be "
                  "transform");
       nsCSSValueSharedList* list = aValue.GetCSSValueSharedListValue();
 
@@ -616,16 +619,19 @@ ApplyAnimatedValue(Layer* aLayer,
                                                         transformData.appUnitsPerDevPixel(),
                                                         flags, &transformData.bounds());
 
       if (ContainerLayer* c = aLayer->AsContainerLayer()) {
         transform.PostScale(c->GetInheritedXScale(), c->GetInheritedYScale(), 1);
       }
       layerCompositor->SetShadowBaseTransform(transform);
       layerCompositor->SetShadowTransformSetByAnimation(true);
+      CompositorAnimationStorage::GetInstance()->
+        SetAnimatedValue(aLayer->GetCompositorAnimationsId(),
+                         aValue);
       break;
     }
     default:
       MOZ_ASSERT_UNREACHABLE("Unhandled animated property");
   }
 }
 
 static bool
@@ -648,16 +654,22 @@ SampleAnimations(Layer* aLayer, TimeStam
         if (hasInEffectAnimations) {
           Animation& animation = layer->GetAnimations().LastElement();
           ApplyAnimatedValue(layer,
                              animation.property(),
                              animation.data(),
                              animationValue);
         }
       });
+
+  if (!activeAnimations) {
+    // Clean up the CompositorAnimationStorage because
+    // there are no active animations running
+    CompositorAnimationStorage::GetInstance()->Clear();
+  }
   return activeAnimations;
 }
 
 static bool
 SampleAPZAnimations(const LayerMetricsWrapper& aLayer, TimeStamp aSampleTime)
 {
   bool activeAnimations = false;
 
--- a/gfx/layers/ipc/LayerTransactionParent.cpp
+++ b/gfx/layers/ipc/LayerTransactionParent.cpp
@@ -10,32 +10,36 @@
 #include "apz/src/AsyncPanZoomController.h"
 #include "CompositableHost.h"           // for CompositableParent, Get, etc
 #include "ImageLayers.h"                // for ImageLayer
 #include "Layers.h"                     // for Layer, ContainerLayer, etc
 #include "CompositableTransactionParent.h"  // for EditReplyVector
 #include "CompositorBridgeParent.h"
 #include "gfxPrefs.h"
 #include "mozilla/gfx/BasePoint3D.h"    // for BasePoint3D
+#include "mozilla/layers/AnimationHelper.h" // for GetAnimatedPropValue
 #include "mozilla/layers/CanvasLayerComposite.h"
 #include "mozilla/layers/ColorLayerComposite.h"
 #include "mozilla/layers/Compositor.h"  // for Compositor
 #include "mozilla/layers/ContainerLayerComposite.h"
 #include "mozilla/layers/ImageBridgeParent.h" // for ImageBridgeParent
 #include "mozilla/layers/ImageLayerComposite.h"
 #include "mozilla/layers/LayerManagerComposite.h"
 #include "mozilla/layers/LayersMessages.h"  // for EditReply, etc
 #include "mozilla/layers/LayersTypes.h"  // for MOZ_LAYERS_LOG
 #include "mozilla/layers/TextureHostOGL.h"  // for TextureHostOGL
 #include "mozilla/layers/PaintedLayerComposite.h"
 #include "mozilla/mozalloc.h"           // for operator delete, etc
 #include "mozilla/Unused.h"
 #include "nsCoord.h"                    // for NSAppUnitsToFloatPixels
 #include "nsDebug.h"                    // for NS_RUNTIMEABORT
 #include "nsDeviceContext.h"            // for AppUnitsPerCSSPixel
+//TODO refactor
+#include "nsDisplayList.h"              // for nsDisplayTransform, etc
+#include "nsStyleTransformMatrix.h"
 #include "nsISupportsImpl.h"            // for Layer::Release, etc
 #include "nsLayoutUtils.h"              // for nsLayoutUtils
 #include "nsMathUtils.h"                // for NS_round
 #include "nsPoint.h"                    // for nsPoint
 #include "nsTArray.h"                   // for nsTArray, nsTArray_Impl, etc
 #include "TreeTraversal.h"              // for ForEachNode
 #include "GeckoProfiler.h"
 #include "mozilla/layers/TextureHost.h"
@@ -697,117 +701,103 @@ LayerTransactionParent::RecvSetTestSampl
 mozilla::ipc::IPCResult
 LayerTransactionParent::RecvLeaveTestMode()
 {
   mCompositorBridge->LeaveTestMode(this);
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult
-LayerTransactionParent::RecvGetAnimationOpacity(const LayerHandle& aParent,
+LayerTransactionParent::RecvGetAnimationOpacity(const uint64_t& aCompositorAnimationsId,
                                                 float* aOpacity,
                                                 bool* aHasAnimationOpacity)
 {
   *aHasAnimationOpacity = false;
   if (mDestroyed || !layer_manager() || layer_manager()->IsDestroyed()) {
     return IPC_FAIL_NO_REASON(this);
   }
 
-  RefPtr<Layer> layer = AsLayer(aParent);
-  if (!layer) {
-    return IPC_FAIL_NO_REASON(this);
-  }
-
   mCompositorBridge->ApplyAsyncProperties(this);
 
-  if (!layer->AsHostLayer()->GetShadowOpacitySetByAnimation()) {
+  StyleAnimationValue value;
+  CompositorAnimationStorage::GetInstance()->
+    GetAnimatedValue(aCompositorAnimationsId, value);
+
+  if (value.IsNull()) {
     return IPC_OK();
   }
 
-  *aOpacity = layer->GetLocalOpacity();
+  *aOpacity = value.GetFloatValue();
   *aHasAnimationOpacity = true;
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult
-LayerTransactionParent::RecvGetAnimationTransform(const LayerHandle& aLayerHandle,
+LayerTransactionParent::RecvGetAnimationTransform(const uint64_t& aCompositorAnimationsId,
                                                   MaybeTransform* aTransform)
 {
   if (mDestroyed || !layer_manager() || layer_manager()->IsDestroyed()) {
     return IPC_FAIL_NO_REASON(this);
   }
 
-  Layer* layer = AsLayer(aLayerHandle);
-  if (!layer) {
-    return IPC_FAIL_NO_REASON(this);
-  }
-
   // Make sure we apply the latest animation style or else we can end up with
   // a race between when we temporarily clear the animation transform (in
   // CompositorBridgeParent::SetShadowProperties) and when animation recalculates
   // the value.
   mCompositorBridge->ApplyAsyncProperties(this);
 
-  // This method is specific to transforms applied by animation.
-  // This is because this method uses the information stored with an animation
-  // such as the origin of the reference frame corresponding to the layer, to
-  // recover the untranslated transform from the shadow transform. For
-  // transforms that are not set by animation we don't have this information
-  // available.
-  if (!layer->AsHostLayer()->GetShadowTransformSetByAnimation()) {
+  StyleAnimationValue value;
+  CompositorAnimationStorage::GetInstance()->
+    GetAnimatedValue(aCompositorAnimationsId, value);
+
+  if (value.IsNull()) {
     *aTransform = mozilla::void_t();
     return IPC_OK();
   }
 
-  // The following code recovers the untranslated transform
-  // from the shadow transform by undoing the translations in
-  // AsyncCompositionManager::SampleValue.
+  AnimationArray animations;
+  CompositorAnimationStorage::GetInstance()->
+    GetAnimations(aCompositorAnimationsId, animations);
 
-  Matrix4x4 transform = layer->AsHostLayer()->GetShadowBaseTransform();
-  if (ContainerLayer* c = layer->AsContainerLayer()) {
-    // Undo the scale transform applied by AsyncCompositionManager::SampleValue
-    transform.PostScale(1.0f/c->GetInheritedXScale(),
-                        1.0f/c->GetInheritedYScale(),
-                        1.0f);
-  }
   float scale = 1;
-  Point3D scaledOrigin;
   Point3D transformOrigin;
-  for (uint32_t i=0; i < layer->GetAnimations().Length(); i++) {
-    if (layer->GetAnimations()[i].data().type() == AnimationData::TTransformData) {
-      const TransformData& data = layer->GetAnimations()[i].data().get_TransformData();
+  for (uint32_t i=0; i < animations.Length(); i++) {
+    if (animations[i].data().type() == AnimationData::TTransformData) {
+      const TransformData& data = animations[i].data().get_TransformData();
       scale = data.appUnitsPerDevPixel();
-      scaledOrigin =
-        Point3D(NS_round(NSAppUnitsToFloatPixels(data.origin().x, scale)),
-                NS_round(NSAppUnitsToFloatPixels(data.origin().y, scale)),
-                0.0f);
       transformOrigin = data.transformOrigin();
       break;
     }
   }
 
-  // If our parent isn't a perspective layer, then the offset into reference
-  // frame coordinates will have been applied to us. Add an inverse translation
-  // to cancel it out.
-  if (!layer->GetParent() || !layer->GetParent()->GetTransformIsPerspective()) {
-    transform.PostTranslate(-scaledOrigin.x, -scaledOrigin.y, -scaledOrigin.z);
+  nsCSSValueSharedList* list = value.GetCSSValueSharedListValue();
+  // we expect all our transform data to arrive in device pixels
+  nsDisplayTransform::FrameTransformProperties props(list,
+                                                     transformOrigin);
+  //TODO are we going to handle SVG?
+  // Get a matrix in device pixel from a transform list in nsCSSValueList.
+  Matrix4x4 transform;
+  RuleNodeCacheConditions dummy;
+  bool dummyBool;
+  nsStyleTransformMatrix::TransformReferenceBox emptyRefBox;
+  const nsIFrame *frame = props.mFrame;
+  if (props.mTransformList) {
+    transform = nsStyleTransformMatrix::ReadTransforms(props.mTransformList->mHead,
+                                                       frame ? frame->StyleContext() : nullptr,
+                                                       frame ? frame->PresContext() : nullptr,
+                                                       dummy, emptyRefBox, scale,
+                                                       &dummyBool);
   }
 
-  // Undo the rebasing applied by
-  // nsDisplayTransform::GetResultingTransformMatrixInternal
-  transform.ChangeBasis(-transformOrigin);
-
-  // Convert to CSS pixels (this undoes the operations performed by
-  // nsStyleTransformMatrix::ProcessTranslatePart which is called from
-  // nsDisplayTransform::GetResultingTransformMatrix)
-  double devPerCss =
+  // Convert to CSS pixels
+  double cssPerDev =
     double(scale) / double(nsDeviceContext::AppUnitsPerCSSPixel());
-  transform._41 *= devPerCss;
-  transform._42 *= devPerCss;
-  transform._43 *= devPerCss;
+  transform._41 *= cssPerDev;
+  transform._42 *= cssPerDev;
+  transform._43 *= cssPerDev;
 
   *aTransform = transform;
   return IPC_OK();
 }
 
 static AsyncPanZoomController*
 GetAPZCForViewID(Layer* aLayer, FrameMetrics::ViewID aScrollID)
 {
--- a/gfx/layers/ipc/LayerTransactionParent.h
+++ b/gfx/layers/ipc/LayerTransactionParent.h
@@ -122,20 +122,20 @@ protected:
                                                       const TextureInfo& aInfo) override;
   virtual mozilla::ipc::IPCResult RecvReleaseLayer(const LayerHandle& aHandle) override;
   virtual mozilla::ipc::IPCResult RecvReleaseCompositable(const CompositableHandle& aHandle) override;
 
   virtual mozilla::ipc::IPCResult RecvClearCachedResources() override;
   virtual mozilla::ipc::IPCResult RecvForceComposite() override;
   virtual mozilla::ipc::IPCResult RecvSetTestSampleTime(const TimeStamp& aTime) override;
   virtual mozilla::ipc::IPCResult RecvLeaveTestMode() override;
-  virtual mozilla::ipc::IPCResult RecvGetAnimationOpacity(const LayerHandle& aLayerHandle,
+  virtual mozilla::ipc::IPCResult RecvGetAnimationOpacity(const uint64_t& aCompositorAnimationsId,
                                                           float* aOpacity,
                                                           bool* aHasAnimationOpacity) override;
-  virtual mozilla::ipc::IPCResult RecvGetAnimationTransform(const LayerHandle& aLayerHandle,
+  virtual mozilla::ipc::IPCResult RecvGetAnimationTransform(const uint64_t& aCompositorAnimationsId,
                                                             MaybeTransform* aTransform)
                                          override;
   virtual mozilla::ipc::IPCResult RecvSetAsyncScrollOffset(const FrameMetrics::ViewID& aId,
                                                            const float& aX, const float& aY) override;
   virtual mozilla::ipc::IPCResult RecvSetAsyncZoom(const FrameMetrics::ViewID& aId,
                                                    const float& aValue) override;
   virtual mozilla::ipc::IPCResult RecvFlushApzRepaints() override;
   virtual mozilla::ipc::IPCResult RecvGetAPZTestData(APZTestData* aOutData) override;
--- a/gfx/layers/ipc/PLayerTransaction.ipdl
+++ b/gfx/layers/ipc/PLayerTransaction.ipdl
@@ -75,25 +75,25 @@ parent:
   // animations. sampleTime must not be null.
   sync SetTestSampleTime(TimeStamp sampleTime);
   // Leave test mode and resume normal compositing
   sync LeaveTestMode();
 
   // Returns the value of the opacity applied to the layer by animation.
   // |hasAnimationOpacity| is true if the layer has an opacity value
   // specified by animation. If it's false, |opacity| value is indefinite.
-  sync GetAnimationOpacity(LayerHandle layer) returns (float opacity,
+  sync GetAnimationOpacity(uint64_t aCompositorAnimationsId) returns (float opacity,
                                                   bool hasAnimationOpacity);
 
   // Returns the value of the transform applied to the layer by animation after
   // factoring out translation components introduced to account for the offset
   // of the corresponding frame and transform origin and after converting to CSS
   // pixels. If the layer is not transformed by animation, the return value will
   // be void_t.
-  sync GetAnimationTransform(LayerHandle layer) returns (MaybeTransform transform);
+  sync GetAnimationTransform(uint64_t aCompositorAnimationId) returns (MaybeTransform transform);
 
   // The next time the layer tree is composited, add this async scroll offset in
   // CSS pixels for the given ViewID.
   // Useful for testing rendering of async scrolling.
   sync SetAsyncScrollOffset(ViewID id, float x, float y);
 
   // The next time the layer tree is composited, include this async zoom in
   // for the given ViewID.