Bug 1402439 - Clean up the animations when the retained animation data got destroyed, r?kats draft
authorpeter chang <pchang@mozilla.com>
Mon, 25 Sep 2017 10:40:18 +0800
changeset 669620 bedcc790a17a7af1c1957429f56f4e8f4a619e65
parent 669596 7e962631ba4298bcefa571008661983d77c3e652
child 733007 af4ce1ec7ee4bf439912daaad30ab9b022ca87b7
push id81383
push userbmo:howareyou322@gmail.com
push dateMon, 25 Sep 2017 04:06:26 +0000
reviewerskats
bugs1402439
milestone58.0a1
Bug 1402439 - Clean up the animations when the retained animation data got destroyed, r?kats MozReview-Commit-ID: 6LnVMn2yPGH
gfx/layers/AnimationInfo.cpp
gfx/layers/wr/WebRenderContainerLayer.h
--- 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; }