Bug 1148949 - Apply async properties when querying the animated transform for cross-process compositor parents too. r=mattwoodrow, a=lmandel
authorBrian Birtles <birtles@gmail.com>
Tue, 21 Apr 2015 12:00:33 +0900
changeset 267177 17d1f11c999838d7b016deba159d439ee3888a9d
parent 267176 42b0638603a05e0d449bdd00595e5ba30e09234e
child 267178 26cd78475d8bfccd990e72bd273238dbc378ccbe
push id830
push userraliiev@mozilla.com
push dateFri, 19 Jun 2015 19:24:37 +0000
treeherdermozilla-release@932614382a68 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattwoodrow, lmandel
bugs1148949, 1113425
milestone39.0a2
Bug 1148949 - Apply async properties when querying the animated transform for cross-process compositor parents too. r=mattwoodrow, a=lmandel Bug 1113425 (specifically, part 2: https://hg.mozilla.org/mozilla-central/rev/bb3866dea03e) introduced a fix for a race condition that occurs when querying the animated transform of a layer. However, that fix failed to update CrossProcessCompositorParent and hence the issue still arises when e10s is enabled. This patch applies the fix from that bug to CrossProcessCompositorParent.
gfx/layers/ipc/CompositorParent.cpp
gfx/layers/ipc/ShadowLayersManager.h
--- a/gfx/layers/ipc/CompositorParent.cpp
+++ b/gfx/layers/ipc/CompositorParent.cpp
@@ -1574,16 +1574,18 @@ public:
                                    bool aScheduleComposite,
                                    uint32_t aPaintSequenceNumber,
                                    bool aIsRepeatTransaction) override;
   virtual void ForceComposite(LayerTransactionParent* aLayerTree) override;
   virtual void NotifyClearCachedResources(LayerTransactionParent* aLayerTree) override;
   virtual bool SetTestSampleTime(LayerTransactionParent* aLayerTree,
                                  const TimeStamp& aTime) override;
   virtual void LeaveTestMode(LayerTransactionParent* aLayerTree) override;
+  virtual void ApplyAsyncProperties(LayerTransactionParent* aLayerTree)
+               override;
   virtual void GetAPZTestData(const LayerTransactionParent* aLayerTree,
                               APZTestData* aOutData) override;
 
   virtual AsyncCompositionManager* GetCompositionManager(LayerTransactionParent* aParent) override;
 
   void DidComposite(uint64_t aId);
 
 private:
@@ -1956,16 +1958,32 @@ CrossProcessCompositorParent::LeaveTestM
     return;
   }
 
   MOZ_ASSERT(state->mParent);
   state->mParent->LeaveTestMode(aLayerTree);
 }
 
 void
+CrossProcessCompositorParent::ApplyAsyncProperties(
+    LayerTransactionParent* aLayerTree)
+{
+  uint64_t id = aLayerTree->GetId();
+  MOZ_ASSERT(id != 0);
+  const CompositorParent::LayerTreeState* state =
+    CompositorParent::GetIndirectShadowTree(id);
+  if (!state) {
+    return;
+  }
+
+  MOZ_ASSERT(state->mParent);
+  state->mParent->ApplyAsyncProperties(aLayerTree);
+}
+
+void
 CrossProcessCompositorParent::GetAPZTestData(const LayerTransactionParent* aLayerTree,
                                              APZTestData* aOutData)
 {
   uint64_t id = aLayerTree->GetId();
   MOZ_ASSERT(id != 0);
   MonitorAutoLock lock(*sIndirectLayerTreesLock);
   *aOutData = sIndirectLayerTrees[id].mApzTestData;
 }
--- a/gfx/layers/ipc/ShadowLayersManager.h
+++ b/gfx/layers/ipc/ShadowLayersManager.h
@@ -30,17 +30,17 @@ public:
     virtual AsyncCompositionManager* GetCompositionManager(LayerTransactionParent* aLayerTree) { return nullptr; }
 
     virtual void NotifyClearCachedResources(LayerTransactionParent* aLayerTree) { }
 
     virtual void ForceComposite(LayerTransactionParent* aLayerTree) { }
     virtual bool SetTestSampleTime(LayerTransactionParent* aLayerTree,
                                    const TimeStamp& aTime) { return true; }
     virtual void LeaveTestMode(LayerTransactionParent* aLayerTree) { }
-    virtual void ApplyAsyncProperties(LayerTransactionParent* aLayerTree) { }
+    virtual void ApplyAsyncProperties(LayerTransactionParent* aLayerTree) = 0;
     virtual void GetAPZTestData(const LayerTransactionParent* aLayerTree,
                                 APZTestData* aOutData) { }
 };
 
 } // layers
 } // mozilla
 
 #endif // mozilla_layers_ShadowLayersManager_h