Bug 1137875 - Have the LayerTransactionChild hold a copy of the layers id. r=nical
authorKartikaya Gupta <kgupta@mozilla.com>
Fri, 06 Mar 2015 06:25:33 -0500
changeset 232274 2b53655f3db5ab81424dfa4a57876da4c550b980
parent 232273 323936539fd74ca0a0e76cff9784efad8741b277
child 232275 c0331a879deec9bb922563c278b4ca38caa6332d
push id28375
push userryanvm@gmail.com
push dateFri, 06 Mar 2015 21:23:20 +0000
treeherdermozilla-central@43fb1f92e8d4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnical
bugs1137875
milestone39.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1137875 - Have the LayerTransactionChild hold a copy of the layers id. r=nical
gfx/layers/ipc/CompositorChild.cpp
gfx/layers/ipc/LayerTransactionChild.h
--- a/gfx/layers/ipc/CompositorChild.cpp
+++ b/gfx/layers/ipc/CompositorChild.cpp
@@ -116,17 +116,17 @@ CompositorChild::Get()
 
 PLayerTransactionChild*
 CompositorChild::AllocPLayerTransactionChild(const nsTArray<LayersBackend>& aBackendHints,
                                              const uint64_t& aId,
                                              TextureFactoryIdentifier*,
                                              bool*)
 {
   MOZ_ASSERT(mCanSend);
-  LayerTransactionChild* c = new LayerTransactionChild();
+  LayerTransactionChild* c = new LayerTransactionChild(aId);
   c->AddIPDLReference();
   return c;
 }
 
 bool
 CompositorChild::DeallocPLayerTransactionChild(PLayerTransactionChild* actor)
 {
   static_cast<LayerTransactionChild*>(actor)->ReleaseIPDLReference();
--- a/gfx/layers/ipc/LayerTransactionChild.h
+++ b/gfx/layers/ipc/LayerTransactionChild.h
@@ -46,21 +46,24 @@ public:
   {
     mForwarder = aForwarder;
   }
 
   virtual void SendFenceHandle(AsyncTransactionTracker* aTracker,
                                PTextureChild* aTexture,
                                const FenceHandle& aFence);
 
+  uint64_t GetId() const { return mId; }
+
 protected:
-  LayerTransactionChild()
+  explicit LayerTransactionChild(const uint64_t& aId)
     : mForwarder(nullptr)
     , mIPCOpen(false)
     , mDestroyed(false)
+    , mId(aId)
   {}
   ~LayerTransactionChild() { }
 
   virtual PLayerChild* AllocPLayerChild() MOZ_OVERRIDE;
   virtual bool DeallocPLayerChild(PLayerChild* actor) MOZ_OVERRIDE;
 
   virtual PCompositableChild* AllocPCompositableChild(const TextureInfo& aInfo) MOZ_OVERRIDE;
   virtual bool DeallocPCompositableChild(PCompositableChild* actor) MOZ_OVERRIDE;
@@ -85,14 +88,15 @@ protected:
     Release();
   }
   friend class CompositorChild;
   friend class layout::RenderFrameChild;
 
   ShadowLayerForwarder* mForwarder;
   bool mIPCOpen;
   bool mDestroyed;
+  uint64_t mId;
 };
 
 } // namespace layers
 } // namespace mozilla
 
 #endif // MOZILLA_LAYERS_LAYERTRANSACTIONCHILD_H