Bug 1402439 - Clean up the animations when the retained animation data got destroyed, r?kats
MozReview-Commit-ID: 6LnVMn2yPGH
--- a/gfx/layers/AnimationInfo.cpp
+++ b/gfx/layers/AnimationInfo.cpp
@@ -17,16 +17,17 @@ AnimationInfo::AnimationInfo(LayerManage
mCompositorAnimationsId(0),
mAnimationGeneration(0),
mMutated(false)
{
}
AnimationInfo::~AnimationInfo()
{
+ ClearAnimations();
}
void
AnimationInfo::EnsureAnimationsId()
{
if (!mCompositorAnimationsId) {
mCompositorAnimationsId = AnimationHelper::GetNextCompositorAnimationsId();
}
--- a/gfx/layers/wr/WebRenderContainerLayer.h
+++ b/gfx/layers/wr/WebRenderContainerLayer.h
@@ -22,21 +22,16 @@ public:
: ContainerLayer(aManager, static_cast<WebRenderLayer*>(this))
{
MOZ_COUNT_CTOR(WebRenderContainerLayer);
}
protected:
virtual ~WebRenderContainerLayer()
{
- if (!GetAnimations().IsEmpty()) {
- mManager->AsWebRenderLayerManager()->
- AddCompositorAnimationsIdForDiscard(GetCompositorAnimationsId());
- }
-
ContainerLayer::RemoveAllChildren();
MOZ_COUNT_DTOR(WebRenderContainerLayer);
}
void UpdateTransformDataForAnimation();
public:
Layer* GetLayer() override { return this; }