diff --git a/gfx/layers/AnimationHelper.cpp b/gfx/layers/AnimationHelper.cpp index 9ceb1daedc95..1627b9af2ad1 100644 --- a/gfx/layers/AnimationHelper.cpp +++ b/gfx/layers/AnimationHelper.cpp @@ -45,46 +45,6 @@ CompositorAnimationStorage::GetAnimatedValue(const uint64_t& aId) const return mAnimatedValues.Get(aId); } -Maybe -CompositorAnimationStorage::GetAnimationOpacity(const uint64_t& aId) const -{ - auto value = GetAnimatedValue(aId); - if (!value || value->mType != AnimatedValue::OPACITY) { - return Nothing(); - } - - return Some(value->mOpacity); -} - -Maybe -CompositorAnimationStorage::GetAnimationTransform(const uint64_t& aId) const -{ - auto value = GetAnimatedValue(aId); - if (!value || value->mType != AnimatedValue::TRANSFORM) { - return Nothing(); - } - - gfx::Matrix4x4 transform = value->mTransform.mFrameTransform; - const TransformData& data = value->mTransform.mData; - float scale = data.appUnitsPerDevPixel(); - gfx::Point3D transformOrigin = data.transformOrigin(); - - // 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 = - double(scale) / double(nsDeviceContext::AppUnitsPerCSSPixel()); - transform._41 *= devPerCss; - transform._42 *= devPerCss; - transform._43 *= devPerCss; - - return Some(transform); -} - OMTAValue CompositorAnimationStorage::GetOMTAValue(const uint64_t& aId) const { diff --git a/gfx/layers/AnimationHelper.h b/gfx/layers/AnimationHelper.h index 9c1786dd453d..8c9c1ef29c6d 100644 --- a/gfx/layers/AnimationHelper.h +++ b/gfx/layers/AnimationHelper.h @@ -132,20 +132,6 @@ public: */ AnimatedValue* GetAnimatedValue(const uint64_t& aId) const; - /** - * Like GetAnimatedValue(), but ensures the value is an opacity and returns - * the float value if possible, or Nothing() otherwise. - */ - Maybe GetAnimationOpacity(const uint64_t& aId) const; - - /** - * Like GetAnimatedValue(), but ensures the value is a transform and returns - * the transform matrix if possible, or Nothing() otherwise. It also does - * some post-processing on the transform matrix as well. See the comments - * inside the function for details. - */ - Maybe GetAnimationTransform(const uint64_t& aId) const; - OMTAValue GetOMTAValue(const uint64_t& aId) const; /** diff --git a/gfx/layers/ipc/LayerTransactionParent.cpp b/gfx/layers/ipc/LayerTransactionParent.cpp index 872b75e4aa5d..8d57873c234a 100644 --- a/gfx/layers/ipc/LayerTransactionParent.cpp +++ b/gfx/layers/ipc/LayerTransactionParent.cpp @@ -680,59 +680,6 @@ LayerTransactionParent::RecvLeaveTestMode() return IPC_OK(); } -mozilla::ipc::IPCResult -LayerTransactionParent::RecvGetAnimationOpacity(const uint64_t& aCompositorAnimationsId, - float* aOpacity, - bool* aHasAnimationOpacity) -{ - *aHasAnimationOpacity = false; - if (mDestroyed || !mLayerManager || mLayerManager->IsDestroyed()) { - return IPC_FAIL_NO_REASON(this); - } - - mCompositorBridge->ApplyAsyncProperties( - this, CompositorBridgeParentBase::TransformsToSkip::APZ); - - if (!mAnimStorage) { - return IPC_FAIL_NO_REASON(this); - } - - Maybe opacity = mAnimStorage->GetAnimationOpacity(aCompositorAnimationsId); - if (opacity) { - *aOpacity = *opacity; - *aHasAnimationOpacity = true; - } - return IPC_OK(); -} - -mozilla::ipc::IPCResult -LayerTransactionParent::RecvGetAnimationTransform(const uint64_t& aCompositorAnimationsId, - MaybeTransform* aTransform) -{ - if (mDestroyed || !mLayerManager || mLayerManager->IsDestroyed()) { - 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, CompositorBridgeParentBase::TransformsToSkip::APZ); - - if (!mAnimStorage) { - return IPC_FAIL_NO_REASON(this); - } - - Maybe transform = mAnimStorage->GetAnimationTransform(aCompositorAnimationsId); - if (transform) { - *aTransform = *transform; - } else { - *aTransform = mozilla::void_t(); - } - return IPC_OK(); -} - mozilla::ipc::IPCResult LayerTransactionParent::RecvGetAnimationValue(const uint64_t& aCompositorAnimationsId, OMTAValue* aValue) diff --git a/gfx/layers/ipc/LayerTransactionParent.h b/gfx/layers/ipc/LayerTransactionParent.h index e0236795b074..81628cc31869 100644 --- a/gfx/layers/ipc/LayerTransactionParent.h +++ b/gfx/layers/ipc/LayerTransactionParent.h @@ -125,11 +125,6 @@ protected: mozilla::ipc::IPCResult RecvScheduleComposite() override; mozilla::ipc::IPCResult RecvSetTestSampleTime(const TimeStamp& aTime) override; mozilla::ipc::IPCResult RecvLeaveTestMode() override; - mozilla::ipc::IPCResult RecvGetAnimationOpacity(const uint64_t& aCompositorAnimationsId, - float* aOpacity, - bool* aHasAnimationOpacity) override; - mozilla::ipc::IPCResult RecvGetAnimationTransform(const uint64_t& aCompositorAnimationsId, - MaybeTransform* aTransform) override; mozilla::ipc::IPCResult RecvGetAnimationValue(const uint64_t& aCompositorAnimationsId, OMTAValue* aValue) override; mozilla::ipc::IPCResult RecvGetTransform(const LayerHandle& aHandle, diff --git a/gfx/layers/ipc/PLayerTransaction.ipdl b/gfx/layers/ipc/PLayerTransaction.ipdl index b4efb517384f..0507474a56b8 100644 --- a/gfx/layers/ipc/PLayerTransaction.ipdl +++ b/gfx/layers/ipc/PLayerTransaction.ipdl @@ -80,19 +80,6 @@ parent: // Returns |OMTAValue| applied to the layer. sync GetAnimationValue(uint64_t aCompositorAnimationId) returns (OMTAValue value); - // 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(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(uint64_t aCompositorAnimationId) returns (MaybeTransform transform); - // Returns the value of the transform applied to the layer by animation and // APZC. sync GetTransform(LayerHandle layer) returns (MaybeTransform transform); diff --git a/gfx/layers/ipc/PWebRenderBridge.ipdl b/gfx/layers/ipc/PWebRenderBridge.ipdl index d433ee467e4d..fa8cf06c9ce7 100644 --- a/gfx/layers/ipc/PWebRenderBridge.ipdl +++ b/gfx/layers/ipc/PWebRenderBridge.ipdl @@ -71,9 +71,6 @@ parent: sync SetTestSampleTime(TimeStamp sampleTime); sync LeaveTestMode(); sync GetAnimationValue(uint64_t aCompositorAnimationsId) returns (OMTAValue value); - sync GetAnimationOpacity(uint64_t aCompositorAnimationsId) returns (float opacity, - bool hasAnimationOpacity); - sync GetAnimationTransform(uint64_t aCompositorAnimationId) returns (MaybeTransform transform); sync SetAsyncScrollOffset(ViewID scrollId, float x, float y); sync SetAsyncZoom(ViewID scrollId, float zoom); async FlushApzRepaints(); diff --git a/gfx/layers/wr/WebRenderBridgeParent.cpp b/gfx/layers/wr/WebRenderBridgeParent.cpp index 997d13e93bea..49075cc6e010 100644 --- a/gfx/layers/wr/WebRenderBridgeParent.cpp +++ b/gfx/layers/wr/WebRenderBridgeParent.cpp @@ -1379,56 +1379,6 @@ WebRenderBridgeParent::RecvGetAnimationValue(const uint64_t& aCompositorAnimatio return IPC_OK(); } -mozilla::ipc::IPCResult -WebRenderBridgeParent::RecvGetAnimationOpacity(const uint64_t& aCompositorAnimationsId, - float* aOpacity, - bool* aHasAnimationOpacity) -{ - if (mDestroyed) { - return IPC_FAIL_NO_REASON(this); - } - - MOZ_ASSERT(mAnimStorage); - if (RefPtr root = GetRootWebRenderBridgeParent()) { - root->AdvanceAnimations(); - } else { - AdvanceAnimations(); - } - - Maybe opacity = mAnimStorage->GetAnimationOpacity(aCompositorAnimationsId); - if (opacity) { - *aOpacity = *opacity; - *aHasAnimationOpacity = true; - } else { - *aHasAnimationOpacity = false; - } - return IPC_OK(); -} - -mozilla::ipc::IPCResult -WebRenderBridgeParent::RecvGetAnimationTransform(const uint64_t& aCompositorAnimationsId, - MaybeTransform* aTransform) -{ - if (mDestroyed) { - return IPC_FAIL_NO_REASON(this); - } - - MOZ_ASSERT(mAnimStorage); - if (RefPtr root = GetRootWebRenderBridgeParent()) { - root->AdvanceAnimations(); - } else { - AdvanceAnimations(); - } - - Maybe transform = mAnimStorage->GetAnimationTransform(aCompositorAnimationsId); - if (transform) { - *aTransform = *transform; - } else { - *aTransform = mozilla::void_t(); - } - return IPC_OK(); -} - mozilla::ipc::IPCResult WebRenderBridgeParent::RecvSetAsyncScrollOffset(const FrameMetrics::ViewID& aScrollId, const float& aX, diff --git a/gfx/layers/wr/WebRenderBridgeParent.h b/gfx/layers/wr/WebRenderBridgeParent.h index e4fbf9c6abc0..f5ff8eeb2091 100644 --- a/gfx/layers/wr/WebRenderBridgeParent.h +++ b/gfx/layers/wr/WebRenderBridgeParent.h @@ -120,11 +120,6 @@ public: mozilla::ipc::IPCResult RecvLeaveTestMode() override; mozilla::ipc::IPCResult RecvGetAnimationValue(const uint64_t& aCompositorAnimationsId, OMTAValue* aValue) override; - mozilla::ipc::IPCResult RecvGetAnimationOpacity(const uint64_t& aCompositorAnimationsId, - float* aOpacity, - bool* aHasAnimationOpacity) override; - mozilla::ipc::IPCResult RecvGetAnimationTransform(const uint64_t& aCompositorAnimationsId, - MaybeTransform* aTransform) override; mozilla::ipc::IPCResult RecvSetAsyncScrollOffset(const FrameMetrics::ViewID& aScrollId, const float& aX, const float& aY) override; diff --git a/ipc/ipdl/sync-messages.ini b/ipc/ipdl/sync-messages.ini index 101119c4a9d0..625882008c30 100644 --- a/ipc/ipdl/sync-messages.ini +++ b/ipc/ipdl/sync-messages.ini @@ -995,10 +995,6 @@ description = description = [PLayerTransaction::LeaveTestMode] description = -[PLayerTransaction::GetAnimationOpacity] -description = -[PLayerTransaction::GetAnimationTransform] -description = [PLayerTransaction::GetAnimationValue] description = test only [PLayerTransaction::GetTransform] @@ -1029,10 +1025,6 @@ description = test only description = test only [PWebRenderBridge::GetAnimationValue] description = test only -[PWebRenderBridge::GetAnimationOpacity] -description = test only -[PWebRenderBridge::GetAnimationTransform] -description = test only [PWebRenderBridge::SetAsyncScrollOffset] description = test only [PWebRenderBridge::SetAsyncZoom]