Bug 897452 - Part 3 - Clean up some unused code after PTexture change - r=mattwoodrow
☠☠ backed out by ff1bf2049ecf ☠ ☠
authorNicolas Silva <nical@mozilla.com>
Wed, 11 Dec 2013 13:05:13 -0500
changeset 159965 3b9ddce12b7a96ccfbbb11b38ab1ed79638c0478
parent 159964 7aec6387f3e96adf7207e48e6ff41d6e5cc8302d
child 159966 5e9d3c681ee96cdf52a37c80d11eeee21bf05f03
push id25821
push usercbook@mozilla.com
push dateThu, 12 Dec 2013 11:53:39 +0000
treeherdermozilla-central@d15ed5648a5f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattwoodrow
bugs897452
milestone29.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 897452 - Part 3 - Clean up some unused code after PTexture change - r=mattwoodrow
gfx/layers/basic/MacIOSurfaceTextureHostBasic.cpp
gfx/layers/basic/MacIOSurfaceTextureHostBasic.h
gfx/layers/basic/TextureHostBasic.cpp
gfx/layers/client/CompositableClient.cpp
gfx/layers/client/CompositableClient.h
gfx/layers/client/TextureClient.cpp
gfx/layers/client/TextureClient.h
gfx/layers/composite/CompositableHost.cpp
gfx/layers/composite/CompositableHost.h
gfx/layers/composite/TextureHost.cpp
gfx/layers/composite/TextureHost.h
gfx/layers/opengl/GrallocTextureHost.cpp
gfx/layers/opengl/GrallocTextureHost.h
gfx/layers/opengl/MacIOSurfaceTextureHostOGL.cpp
gfx/layers/opengl/MacIOSurfaceTextureHostOGL.h
gfx/layers/opengl/TextureHostOGL.cpp
gfx/layers/opengl/TextureHostOGL.h
gfx/tests/gtest/TestTextures.cpp
--- a/gfx/layers/basic/MacIOSurfaceTextureHostBasic.cpp
+++ b/gfx/layers/basic/MacIOSurfaceTextureHostBasic.cpp
@@ -30,21 +30,20 @@ MacIOSurfaceTextureSourceBasic::GetSize(
 
 gfx::SurfaceFormat
 MacIOSurfaceTextureSourceBasic::GetFormat() const
 {
   return mSurface->HasAlpha() ? gfx::FORMAT_R8G8B8A8 : gfx::FORMAT_B8G8R8X8;
 }
 
 MacIOSurfaceTextureHostBasic::MacIOSurfaceTextureHostBasic(
-    uint64_t aID,
     TextureFlags aFlags,
     const SurfaceDescriptorMacIOSurface& aDescriptor
 )
-  : TextureHost(aID, aFlags)
+  : TextureHost(aFlags)
 {
   mSurface = MacIOSurface::LookupSurface(aDescriptor.surface(),
                                          aDescriptor.scaleFactor(),
                                          aDescriptor.hasAlpha());
 }
 
 gfx::SourceSurface*
 MacIOSurfaceTextureSourceBasic::GetSurface()
--- a/gfx/layers/basic/MacIOSurfaceTextureHostBasic.h
+++ b/gfx/layers/basic/MacIOSurfaceTextureHostBasic.h
@@ -51,19 +51,18 @@ protected:
 /**
  * A TextureHost for shared MacIOSurface
  *
  * Most of the logic actually happens in MacIOSurfaceTextureSourceBasic.
  */
 class MacIOSurfaceTextureHostBasic : public TextureHost
 {
 public:
-  MacIOSurfaceTextureHostBasic(uint64_t aID,
-                             TextureFlags aFlags,
-                             const SurfaceDescriptorMacIOSurface& aDescriptor);
+  MacIOSurfaceTextureHostBasic(TextureFlags aFlags,
+                               const SurfaceDescriptorMacIOSurface& aDescriptor);
 
   virtual void SetCompositor(Compositor* aCompositor) MOZ_OVERRIDE;
 
   virtual bool Lock() MOZ_OVERRIDE;
 
   virtual gfx::SurfaceFormat GetFormat() const MOZ_OVERRIDE;
 
   virtual NewTextureSource* GetTextureSources() MOZ_OVERRIDE
--- a/gfx/layers/basic/TextureHostBasic.cpp
+++ b/gfx/layers/basic/TextureHostBasic.cpp
@@ -8,33 +8,32 @@
 
 using namespace mozilla::gl;
 using namespace mozilla::gfx;
 
 namespace mozilla {
 namespace layers {
 
 TemporaryRef<TextureHost>
-CreateTextureHostBasic(uint64_t aID,
-                       const SurfaceDescriptor& aDesc,
+CreateTextureHostBasic(const SurfaceDescriptor& aDesc,
                        ISurfaceAllocator* aDeallocator,
                        TextureFlags aFlags)
 {
   RefPtr<TextureHost> result;
   switch (aDesc.type()) {
 #ifdef XP_MACOSX
     case SurfaceDescriptor::TSurfaceDescriptorMacIOSurface: {
       const SurfaceDescriptorMacIOSurface& desc =
         aDesc.get_SurfaceDescriptorMacIOSurface();
-      result = new MacIOSurfaceTextureHostBasic(aID, aFlags, desc);
+      result = new MacIOSurfaceTextureHostBasic(aFlags, desc);
       break;
     }
 #endif
     default: {
-      result = CreateBackendIndependentTextureHost(aID, aDesc, aDeallocator, aFlags);
+      result = CreateBackendIndependentTextureHost(aDesc, aDeallocator, aFlags);
       break;
     }
   }
 
   return result;
 }
 
 } // namespace layers
--- a/gfx/layers/client/CompositableClient.cpp
+++ b/gfx/layers/client/CompositableClient.cpp
@@ -19,18 +19,17 @@
 #endif
 
 using namespace mozilla::gfx;
 
 namespace mozilla {
 namespace layers {
 
 CompositableClient::CompositableClient(CompositableForwarder* aForwarder)
-: mNextTextureID(1)
-, mCompositableChild(nullptr)
+: mCompositableChild(nullptr)
 , mForwarder(aForwarder)
 {
   MOZ_COUNT_CTOR(CompositableClient);
 }
 
 
 CompositableClient::~CompositableClient()
 {
@@ -244,17 +243,16 @@ CompositableClient::NextTextureID()
   }
 
   return mNextTextureID;
 }
 
 bool
 CompositableClient::AddTextureClient(TextureClient* aClient)
 {
-  aClient->SetID(NextTextureID());
   return aClient->InitIPDLActor(mForwarder);
 }
 
 void
 CompositableClient::OnTransaction()
 {
 }
 
--- a/gfx/layers/client/CompositableClient.h
+++ b/gfx/layers/client/CompositableClient.h
@@ -146,17 +146,16 @@ public:
    * Our IPDL actor is being destroyed, get rid of any shmem resources now.
    */
   virtual void OnActorDestroy() = 0;
 
 protected:
   // return the next texture ID
   uint64_t NextTextureID();
 
-  uint64_t mNextTextureID;
   CompositableChild* mCompositableChild;
   CompositableForwarder* mForwarder;
 };
 
 /**
  * IPDL actor used by CompositableClient to match with its corresponding
  * CompositableHost on the compositor side.
  *
--- a/gfx/layers/client/TextureClient.cpp
+++ b/gfx/layers/client/TextureClient.cpp
@@ -212,17 +212,16 @@ ShmemTextureClient::DropTextureData()
   MarkInvalid();
   mShmem = ipc::Shmem();
   return result;
 }
 
 TextureClient::TextureClient(TextureFlags aFlags)
   : mRefCount(0)
   , mActor(nullptr)
-  , mID(0)
   , mFlags(aFlags)
   , mShared(false)
   , mValid(true)
 {}
 
 TextureClient::~TextureClient()
 {
   // All the destruction code that may lead to virtual method calls must
--- a/gfx/layers/client/TextureClient.h
+++ b/gfx/layers/client/TextureClient.h
@@ -199,40 +199,16 @@ public:
    * TextureChild is an implementation detail of TextureHost that is not
    * exposed to the rest of the code base. CreateIPDLActor and DestroyIPDLActor
    * are for use with the maging IPDL protocols only (so that they can
    * implement AllocPextureChild and DeallocPTextureChild).
    */
   static PTextureChild* CreateIPDLActor();
   static bool DestroyIPDLActor(PTextureChild* actor);
 
-  /**
-   * Sets this texture's ID.
-   *
-   * This ID is used to match a texture client with his corresponding TextureHost.
-   * Only the CompositableClient should be allowed to set or clear the ID.
-   * Zero is always an invalid ID.
-   * For a given compositableClient, there can never be more than one texture
-   * client with the same non-zero ID.
-   * Texture clients from different compositables may have the same ID.
-   */
-  void SetID(uint64_t aID)
-  {
-    MOZ_ASSERT(mID == 0 && aID != 0);
-    mID = aID;
-    mShared = true;
-  }
-  void ClearID()
-  {
-    MOZ_ASSERT(mID != 0);
-    mID = 0;
-  }
-
-  uint64_t GetID() const { return mID; }
-
   virtual bool IsAllocated() const = 0;
 
   virtual bool ToSurfaceDescriptor(SurfaceDescriptor& aDescriptor) = 0;
 
   virtual gfx::IntSize GetSize() const = 0;
 
   /**
    * Drop the shared data into a TextureClientData object and mark this
@@ -315,17 +291,16 @@ private:
 protected:
   void AddFlags(TextureFlags  aFlags)
   {
     MOZ_ASSERT(!IsSharedWithCompositor());
     mFlags |= aFlags;
   }
 
   TextureChild* mActor;
-  uint64_t mID;
   TextureFlags mFlags;
   bool mShared;
   bool mValid;
 };
 
 /**
  * TextureClient that wraps a random access buffer such as a Shmem or raw memory.
  * This class must be inherited to implement the memory allocation and access bits.
--- a/gfx/layers/composite/CompositableHost.cpp
+++ b/gfx/layers/composite/CompositableHost.cpp
@@ -31,103 +31,42 @@ CompositableHost::CompositableHost(const
   , mKeepAttached(false)
 {
   MOZ_COUNT_CTOR(CompositableHost);
 }
 
 CompositableHost::~CompositableHost()
 {
   MOZ_COUNT_DTOR(CompositableHost);
-
-  RefPtr<TextureHost> it = mFirstTexture;
-  while (it) {
-    if (!(it->GetFlags() & TEXTURE_DEALLOCATE_CLIENT)) {
-      it->DeallocateSharedData();
-    }
-    it = it->GetNextSibling();
-  }
 }
 
 void
 CompositableHost::UseTextureHost(TextureHost* aTexture)
 {
   if (!aTexture) {
     return;
   }
   aTexture->SetCompositor(GetCompositor());
   aTexture->SetCompositableBackendSpecificData(GetCompositableBackendSpecificData());
 }
 
-
-void
-CompositableHost::AddTextureHost(TextureHost* aTexture)
-{
-  MOZ_ASSERT(aTexture);
-  MOZ_ASSERT(GetTextureHost(aTexture->GetID()) == nullptr,
-             "A texture is already present with this ID");
-  RefPtr<TextureHost> second = mFirstTexture;
-  mFirstTexture = aTexture;
-  aTexture->SetNextSibling(second);
-  aTexture->SetCompositableBackendSpecificData(GetCompositableBackendSpecificData());
-}
-
-void
-CompositableHost::RemoveTextureHost(TextureHost* aTexture)
-{
-  uint64_t textureID = aTexture->GetID();
-  if (mFirstTexture && mFirstTexture->GetID() == textureID) {
-    mFirstTexture = mFirstTexture->GetNextSibling();
-    aTexture->SetNextSibling(nullptr);
-  }
-  RefPtr<TextureHost> it = mFirstTexture;
-  while (it) {
-    if (it->GetNextSibling() &&
-        it->GetNextSibling()->GetID() == textureID) {
-      it->SetNextSibling(it->GetNextSibling()->GetNextSibling());
-      aTexture->SetNextSibling(nullptr);
-    }
-    it = it->GetNextSibling();
-  }
-  if (!mFirstTexture && mBackendData) {
-    mBackendData->ClearData();
-  }
-}
-
-TextureHost*
-CompositableHost::GetTextureHost(uint64_t aTextureID)
-{
-  RefPtr<TextureHost> it = mFirstTexture;
-  while (it) {
-    if (it->GetID() == aTextureID) {
-      return it;
-    }
-    it = it->GetNextSibling();
-  }
-  return nullptr;
-}
-
 void
 CompositableHost::OnActorDestroy()
 {
   TextureHost* it = mFirstTexture;
   while (it) {
     it->OnActorDestroy();
     it = it->GetNextSibling();
   }
 }
 
 void
 CompositableHost::SetCompositor(Compositor* aCompositor)
 {
   mCompositor = aCompositor;
-  RefPtr<TextureHost> it = mFirstTexture;
-  while (!!it) {
-    it->SetCompositor(aCompositor);
-    it = it->GetNextSibling();
-  }
 }
 
 bool
 CompositableHost::Update(const SurfaceDescriptor& aImage,
                          SurfaceDescriptor* aResult)
 {
   if (!GetDeprecatedTextureHost()) {
     *aResult = aImage;
--- a/gfx/layers/composite/CompositableHost.h
+++ b/gfx/layers/composite/CompositableHost.h
@@ -289,26 +289,17 @@ public:
   static void DumpDeprecatedTextureHost(FILE* aFile, DeprecatedTextureHost* aTexture);
   static void DumpTextureHost(FILE* aFile, TextureHost* aTexture);
 
   virtual TemporaryRef<gfx::DataSourceSurface> GetAsSurface() { return nullptr; }
 #endif
 
   virtual void PrintInfo(nsACString& aTo, const char* aPrefix) { }
 
-  void AddTextureHost(TextureHost* aTexture);
   virtual void UseTextureHost(TextureHost* aTexture);
-  // If a texture host is flagged for deferred removal, the compositable will
-  // get an option to run any cleanup code early, that is when it would have
-  // been run if the texture host was not marked deferred.
-  // If the compositable does not cleanup the texture host now, it is the
-  // compositable's responsibility to cleanup the texture host before the
-  // texture host dies.
-  virtual void RemoveTextureHost(TextureHost* aTexture);
-  TextureHost* GetTextureHost(uint64_t aTextureID);
 
 protected:
   TextureInfo mTextureInfo;
   Compositor* mCompositor;
   Layer* mLayer;
   RefPtr<CompositableBackendSpecificData> mBackendData;
   RefPtr<TextureHost> mFirstTexture;
   bool mAttached;
--- a/gfx/layers/composite/TextureHost.cpp
+++ b/gfx/layers/composite/TextureHost.cpp
@@ -132,78 +132,72 @@ DeprecatedTextureHost::CreateDeprecatedT
                                           aDeprecatedTextureHostFlags,
                                           aTextureFlags);
     default:
       MOZ_CRASH("Couldn't create texture host");
   }
 }
 
 // implemented in TextureHostOGL.cpp
-TemporaryRef<TextureHost> CreateTextureHostOGL(uint64_t aID,
-                                               const SurfaceDescriptor& aDesc,
+TemporaryRef<TextureHost> CreateTextureHostOGL(const SurfaceDescriptor& aDesc,
                                                ISurfaceAllocator* aDeallocator,
                                                TextureFlags aFlags);
 
 // implemented in TextureHostBasic.cpp
-TemporaryRef<TextureHost> CreateTextureHostBasic(uint64_t aID,
-                                               const SurfaceDescriptor& aDesc,
-                                               ISurfaceAllocator* aDeallocator,
-                                               TextureFlags aFlags);
+TemporaryRef<TextureHost> CreateTextureHostBasic(const SurfaceDescriptor& aDesc,
+                                                 ISurfaceAllocator* aDeallocator,
+                                                 TextureFlags aFlags);
 
 // static
 TemporaryRef<TextureHost>
-TextureHost::Create(uint64_t aID,
-                    const SurfaceDescriptor& aDesc,
+TextureHost::Create(const SurfaceDescriptor& aDesc,
                     ISurfaceAllocator* aDeallocator,
                     TextureFlags aFlags)
 {
   switch (Compositor::GetBackend()) {
     case LAYERS_OPENGL:
-      return CreateTextureHostOGL(aID, aDesc, aDeallocator, aFlags);
+      return CreateTextureHostOGL(aDesc, aDeallocator, aFlags);
     case LAYERS_BASIC:
-      return CreateTextureHostBasic(aID, aDesc, aDeallocator, aFlags);
+      return CreateTextureHostBasic(aDesc, aDeallocator, aFlags);
 #ifdef MOZ_WIDGET_GONK
     case LAYERS_NONE:
       // Power on video reqests to allocate TextureHost,
       // when Compositor is still not present. This is a very hacky workaround.
       // See Bug 944420.
-      return CreateTextureHostOGL(aID, aDesc, aDeallocator, aFlags);
+      return CreateTextureHostOGL(aDesc, aDeallocator, aFlags);
 #endif
 #ifdef XP_WIN
     case LAYERS_D3D11:
     case LAYERS_D3D9:
       // XXX - not implemented yet
 #endif
     default:
       MOZ_CRASH("Couldn't create texture host");
       return nullptr;
   }
 }
 
 TemporaryRef<TextureHost>
-CreateBackendIndependentTextureHost(uint64_t aID,
-                                    const SurfaceDescriptor& aDesc,
+CreateBackendIndependentTextureHost(const SurfaceDescriptor& aDesc,
                                     ISurfaceAllocator* aDeallocator,
                                     TextureFlags aFlags)
 {
   RefPtr<TextureHost> result;
   switch (aDesc.type()) {
     case SurfaceDescriptor::TSurfaceDescriptorShmem: {
       const SurfaceDescriptorShmem& descriptor = aDesc.get_SurfaceDescriptorShmem();
-      result = new ShmemTextureHost(aID,
-                                    descriptor.data(),
+      result = new ShmemTextureHost(descriptor.data(),
                                     descriptor.format(),
                                     aDeallocator,
                                     aFlags);
       break;
     }
     case SurfaceDescriptor::TSurfaceDescriptorMemory: {
       const SurfaceDescriptorMemory& descriptor = aDesc.get_SurfaceDescriptorMemory();
-      result = new MemoryTextureHost(aID,
-                                     reinterpret_cast<uint8_t*>(descriptor.data()),
+      result = new MemoryTextureHost(reinterpret_cast<uint8_t*>(descriptor.data()),
                                      descriptor.format(),
                                      aFlags);
       break;
     }
     default: {
       NS_WARNING("No backend independent TextureHost for this descriptor type");
     }
   }
@@ -212,21 +206,18 @@ CreateBackendIndependentTextureHost(uint
 
 void
 TextureHost::SetCompositableBackendSpecificData(CompositableBackendSpecificData* aBackendData)
 {
     mCompositableBackendData = aBackendData;
 }
 
 
-TextureHost::TextureHost(uint64_t aID,
-                         TextureFlags aFlags)
-    : mID(aID)
-    , mNextTexture(nullptr)
-    , mFlags(aFlags)
+TextureHost::TextureHost(TextureFlags aFlags)
+    : mFlags(aFlags)
 {}
 
 TextureHost::~TextureHost()
 {
 }
 
 void
 TextureHost::PrintInfo(nsACString& aTo, const char* aPrefix)
@@ -330,20 +321,19 @@ DeprecatedTextureHost::PrintInfo(nsACStr
 void
 DeprecatedTextureHost::SetBuffer(SurfaceDescriptor* aBuffer, ISurfaceAllocator* aAllocator)
 {
   MOZ_ASSERT(!mBuffer || mBuffer == aBuffer, "Will leak the old mBuffer");
   mBuffer = aBuffer;
   mDeAllocator = aAllocator;
 }
 
-BufferTextureHost::BufferTextureHost(uint64_t aID,
-                                     gfx::SurfaceFormat aFormat,
+BufferTextureHost::BufferTextureHost(gfx::SurfaceFormat aFormat,
                                      TextureFlags aFlags)
-: TextureHost(aID, aFlags)
+: TextureHost(aFlags)
 , mCompositor(nullptr)
 , mFormat(aFormat)
 , mUpdateSerial(1)
 , mLocked(false)
 , mPartialUpdate(false)
 {}
 
 BufferTextureHost::~BufferTextureHost()
@@ -552,22 +542,21 @@ BufferTextureHost::GetAsSurface()
     if (!deserializer.IsValid()) {
       return nullptr;
     }
     result = deserializer.GetAsSurface();
   }
   return result.forget();
 }
 
-ShmemTextureHost::ShmemTextureHost(uint64_t aID,
-                                   const ipc::Shmem& aShmem,
+ShmemTextureHost::ShmemTextureHost(const ipc::Shmem& aShmem,
                                    gfx::SurfaceFormat aFormat,
                                    ISurfaceAllocator* aDeallocator,
                                    TextureFlags aFlags)
-: BufferTextureHost(aID, aFormat, aFlags)
+: BufferTextureHost(aFormat, aFlags)
 , mShmem(new ipc::Shmem(aShmem))
 , mDeallocator(aDeallocator)
 {
   MOZ_COUNT_CTOR(ShmemTextureHost);
 }
 
 ShmemTextureHost::~ShmemTextureHost()
 {
@@ -604,21 +593,20 @@ ShmemTextureHost::OnActorDestroy()
   mShmem = nullptr;
 }
 
 uint8_t* ShmemTextureHost::GetBuffer()
 {
   return mShmem ? mShmem->get<uint8_t>() : nullptr;
 }
 
-MemoryTextureHost::MemoryTextureHost(uint64_t aID,
-                                     uint8_t* aBuffer,
+MemoryTextureHost::MemoryTextureHost(uint8_t* aBuffer,
                                      gfx::SurfaceFormat aFormat,
                                      TextureFlags aFlags)
-: BufferTextureHost(aID, aFormat, aFlags)
+: BufferTextureHost(aFormat, aFlags)
 , mBuffer(aBuffer)
 {
   MOZ_COUNT_CTOR(MemoryTextureHost);
 }
 
 MemoryTextureHost::~MemoryTextureHost()
 {
   DeallocateDeviceData();
@@ -659,18 +647,17 @@ TextureParent::~TextureParent()
   MOZ_COUNT_DTOR(TextureParent);
   mTextureHost = nullptr;
 }
 
 bool
 TextureParent::RecvInit(const SurfaceDescriptor& aSharedData,
                         const TextureFlags& aFlags)
 {
-  mTextureHost = TextureHost::Create(0, // XXX legacy texture id, see subsequent patch
-                                     aSharedData,
+  mTextureHost = TextureHost::Create(aSharedData,
                                      mAllocator,
                                      aFlags);
   return !!mTextureHost;
 }
 
 bool
 TextureParent::RecvRemoveTexture()
 {
--- a/gfx/layers/composite/TextureHost.h
+++ b/gfx/layers/composite/TextureHost.h
@@ -256,26 +256,24 @@ private:
  * reponsibility of the compositable (which would use two Texture pairs).
  *
  * The Lock/Unlock mecanism here mirrors Lock/Unlock in TextureClient.
  *
  */
 class TextureHost : public RefCounted<TextureHost>
 {
 public:
-  TextureHost(uint64_t aID,
-              TextureFlags aFlags);
+  TextureHost(TextureFlags aFlags);
 
   virtual ~TextureHost();
 
   /**
    * Factory method.
    */
-  static TemporaryRef<TextureHost> Create(uint64_t aID,
-                                          const SurfaceDescriptor& aDesc,
+  static TemporaryRef<TextureHost> Create(const SurfaceDescriptor& aDesc,
                                           ISurfaceAllocator* aDeallocator,
                                           TextureFlags aFlags);
 
   /**
    * Lock the texture host for compositing.
    */
   virtual bool Lock() { return true; }
 
@@ -335,39 +333,19 @@ public:
   /**
    * Should be overridden in order to force the TextureHost to drop all references
    * to it's shared data.
    *
    * This is important to ensure the correctness of the deallocation protocol.
    */
   virtual void ForgetSharedData() {}
 
-  /**
-   * An ID to differentiate TextureHosts of a given CompositableHost.
-   *
-   * A TextureHost and its corresponding TextureClient always have the same ID.
-   * TextureHosts of a given CompositableHost always have different IDs.
-   * TextureHosts of different CompositableHosts, may have the same ID.
-   * Zero is always an invalid ID.
-   */
-  uint64_t GetID() const { return mID; }
-
   virtual gfx::IntSize GetSize() const = 0;
 
   /**
-   * TextureHosts are kept as a linked list in their compositable
-   * XXX - This is just a poor man's PTexture. The purpose of this list is
-   * to keep TextureHost alive which should be independent from compositables.
-   * It will be removed when we add the PTetxure protocol (which will more
-   * gracefully handle the lifetime of textures). See bug 897452
-   */
-  TextureHost* GetNextSibling() const { return mNextTexture; }
-  void SetNextSibling(TextureHost* aNext) { mNextTexture = aNext; }
-
-  /**
    * Debug facility.
    * XXX - cool kids use Moz2D. See bug 882113.
    */
   virtual TemporaryRef<gfx::DataSourceSurface> GetAsSurface() = 0;
 
   /**
    * XXX - Flags should only be set at creation time, this will be removed.
    */
@@ -417,18 +395,16 @@ public:
   // If a texture host holds a reference to shmem, it should override this method
   // to forget about the shmem _without_ releasing it.
   virtual void OnActorDestroy() {}
 
   virtual const char *Name() { return "TextureHost"; }
   virtual void PrintInfo(nsACString& aTo, const char* aPrefix);
 
 protected:
-  uint64_t mID;
-  RefPtr<TextureHost> mNextTexture;
   TextureFlags mFlags;
   RefPtr<CompositableBackendSpecificData> mCompositableBackendData;
 };
 
 /**
  * TextureHost that wraps a random access buffer such as a Shmem or some raw
  * memory.
  *
@@ -439,18 +415,17 @@ protected:
  *
  * Uploads happen when Lock is called.
  *
  * BufferTextureHost supports YCbCr and flavours of RGBA images (RGBX, A, etc.).
  */
 class BufferTextureHost : public TextureHost
 {
 public:
-  BufferTextureHost(uint64_t aID,
-                    gfx::SurfaceFormat aFormat,
+  BufferTextureHost(gfx::SurfaceFormat aFormat,
                     TextureFlags aFlags);
 
   ~BufferTextureHost();
 
   virtual uint8_t* GetBuffer() = 0;
 
   virtual void Updated(const nsIntRegion* aRegion = nullptr) MOZ_OVERRIDE;
 
@@ -495,18 +470,17 @@ protected:
 /**
  * TextureHost that wraps shared memory.
  * the corresponding texture on the client side is ShmemTextureClient.
  * This TextureHost is backend-independent.
  */
 class ShmemTextureHost : public BufferTextureHost
 {
 public:
-  ShmemTextureHost(uint64_t aID,
-                   const mozilla::ipc::Shmem& aShmem,
+  ShmemTextureHost(const mozilla::ipc::Shmem& aShmem,
                    gfx::SurfaceFormat aFormat,
                    ISurfaceAllocator* aDeallocator,
                    TextureFlags aFlags);
 
   ~ShmemTextureHost();
 
   virtual void DeallocateSharedData() MOZ_OVERRIDE;
 
@@ -527,18 +501,17 @@ protected:
  * TextureHost that wraps raw memory.
  * The corresponding texture on the client side is MemoryTextureClient.
  * Can obviously not be used in a cross process setup.
  * This TextureHost is backend-independent.
  */
 class MemoryTextureHost : public BufferTextureHost
 {
 public:
-  MemoryTextureHost(uint64_t aID,
-                    uint8_t* aBuffer,
+  MemoryTextureHost(uint8_t* aBuffer,
                     gfx::SurfaceFormat aFormat,
                     TextureFlags aFlags);
 
   ~MemoryTextureHost();
 
   virtual void DeallocateSharedData() MOZ_OVERRIDE;
 
   virtual void ForgetSharedData() MOZ_OVERRIDE;
@@ -843,17 +816,16 @@ private:
   gfx::IntPoint mOrigin;
 };
 
 /**
  * Creates a TextureHost that can be used with any of the existing backends
  * Not all SurfaceDescriptor types are supported
  */
 TemporaryRef<TextureHost>
-CreateBackendIndependentTextureHost(uint64_t aID,
-                                    const SurfaceDescriptor& aDesc,
+CreateBackendIndependentTextureHost(const SurfaceDescriptor& aDesc,
                                     ISurfaceAllocator* aDeallocator,
                                     TextureFlags aFlags);
 
 }
 }
 
 #endif
--- a/gfx/layers/opengl/GrallocTextureHost.cpp
+++ b/gfx/layers/opengl/GrallocTextureHost.cpp
@@ -215,20 +215,19 @@ GrallocTextureSourceOGL::DeallocateDevic
   if (mEGLImage) {
     MOZ_ASSERT(gl());
     gl()->MakeCurrent();
     gl()->DestroyEGLImage(mEGLImage);
     mEGLImage = 0;
   }
 }
 
-GrallocTextureHostOGL::GrallocTextureHostOGL(uint64_t aID,
-                                             TextureFlags aFlags,
+GrallocTextureHostOGL::GrallocTextureHostOGL(TextureFlags aFlags,
                                              const NewSurfaceDescriptorGralloc& aDescriptor)
-  : TextureHost(aID, aFlags)
+  : TextureHost(aFlags)
 {
   mGrallocActor =
     static_cast<GrallocBufferActor*>(aDescriptor.bufferParent());
 
   android::GraphicBuffer* graphicBuffer = mGrallocActor->GetGraphicBuffer();
 
   mSize = aDescriptor.size();
   gfx::SurfaceFormat format =
--- a/gfx/layers/opengl/GrallocTextureHost.h
+++ b/gfx/layers/opengl/GrallocTextureHost.h
@@ -71,18 +71,17 @@ protected:
   gfx::SurfaceFormat mFormat;
   bool mNeedsReset;
 };
 
 class GrallocTextureHostOGL : public TextureHost
 {
   friend class GrallocBufferActor;
 public:
-  GrallocTextureHostOGL(uint64_t aID,
-                        TextureFlags aFlags,
+  GrallocTextureHostOGL(TextureFlags aFlags,
                         const NewSurfaceDescriptorGralloc& aDescriptor);
 
   virtual ~GrallocTextureHostOGL();
 
   virtual void Updated(const nsIntRegion* aRegion) MOZ_OVERRIDE {}
 
   virtual bool Lock() MOZ_OVERRIDE;
 
--- a/gfx/layers/opengl/MacIOSurfaceTextureHostOGL.cpp
+++ b/gfx/layers/opengl/MacIOSurfaceTextureHostOGL.cpp
@@ -29,20 +29,19 @@ MacIOSurfaceTextureSourceOGL::GetSize() 
 }
 
 gfx::SurfaceFormat
 MacIOSurfaceTextureSourceOGL::GetFormat() const
 {
   return mSurface->HasAlpha() ? gfx::FORMAT_R8G8B8A8 : gfx::FORMAT_B8G8R8X8;
 }
 
-MacIOSurfaceTextureHostOGL::MacIOSurfaceTextureHostOGL(uint64_t aID,
-                                                       TextureFlags aFlags,
+MacIOSurfaceTextureHostOGL::MacIOSurfaceTextureHostOGL(TextureFlags aFlags,
                                                        const SurfaceDescriptorMacIOSurface& aDescriptor)
-  : TextureHost(aID, aFlags)
+  : TextureHost(aFlags)
 {
   mSurface = MacIOSurface::LookupSurface(aDescriptor.surface(),
                                          aDescriptor.scaleFactor(),
                                          aDescriptor.hasAlpha());
 }
 
 bool
 MacIOSurfaceTextureHostOGL::Lock()
--- a/gfx/layers/opengl/MacIOSurfaceTextureHostOGL.h
+++ b/gfx/layers/opengl/MacIOSurfaceTextureHostOGL.h
@@ -60,18 +60,17 @@ protected:
 /**
  * A TextureHost for shared MacIOSurface
  *
  * Most of the logic actually happens in MacIOSurfaceTextureSourceOGL.
  */
 class MacIOSurfaceTextureHostOGL : public TextureHost
 {
 public:
-  MacIOSurfaceTextureHostOGL(uint64_t aID,
-                             TextureFlags aFlags,
+  MacIOSurfaceTextureHostOGL(TextureFlags aFlags,
                              const SurfaceDescriptorMacIOSurface& aDescriptor);
 
   // SharedTextureHostOGL doesn't own any GL texture
   virtual void DeallocateDeviceData() MOZ_OVERRIDE {}
 
   virtual void SetCompositor(Compositor* aCompositor) MOZ_OVERRIDE;
 
   virtual bool Lock() MOZ_OVERRIDE;
--- a/gfx/layers/opengl/TextureHostOGL.cpp
+++ b/gfx/layers/opengl/TextureHostOGL.cpp
@@ -82,51 +82,50 @@ CreateDeprecatedTextureHostOGL(SurfaceDe
   NS_ASSERTION(result, "Result should have been created.");
 
   result->SetFlags(aTextureFlags);
   return result.forget();
 }
 
 
 TemporaryRef<TextureHost>
-CreateTextureHostOGL(uint64_t aID,
-                     const SurfaceDescriptor& aDesc,
+CreateTextureHostOGL(const SurfaceDescriptor& aDesc,
                      ISurfaceAllocator* aDeallocator,
                      TextureFlags aFlags)
 {
   RefPtr<TextureHost> result;
   switch (aDesc.type()) {
     case SurfaceDescriptor::TSurfaceDescriptorShmem:
     case SurfaceDescriptor::TSurfaceDescriptorMemory: {
-      result = CreateBackendIndependentTextureHost(aID, aDesc,
+      result = CreateBackendIndependentTextureHost(aDesc,
                                                    aDeallocator, aFlags);
       break;
     }
     case SurfaceDescriptor::TSharedTextureDescriptor: {
       const SharedTextureDescriptor& desc = aDesc.get_SharedTextureDescriptor();
-      result = new SharedTextureHostOGL(aID, aFlags,
+      result = new SharedTextureHostOGL(aFlags,
                                         desc.shareType(),
                                         desc.handle(),
                                         gfx::ToIntSize(desc.size()),
                                         desc.inverted());
       break;
     }
 #ifdef XP_MACOSX
     case SurfaceDescriptor::TSurfaceDescriptorMacIOSurface: {
       const SurfaceDescriptorMacIOSurface& desc =
         aDesc.get_SurfaceDescriptorMacIOSurface();
-      result = new MacIOSurfaceTextureHostOGL(aID, aFlags, desc);
+      result = new MacIOSurfaceTextureHostOGL(aFlags, desc);
       break;
     }
 #endif
 #ifdef MOZ_WIDGET_GONK
     case SurfaceDescriptor::TNewSurfaceDescriptorGralloc: {
       const NewSurfaceDescriptorGralloc& desc =
         aDesc.get_NewSurfaceDescriptorGralloc();
-      result = new GrallocTextureHostOGL(aID, aFlags, desc);
+      result = new GrallocTextureHostOGL(aFlags, desc);
       break;
     }
 #endif
     default: return nullptr;
   }
   return result.forget();
 }
 
@@ -371,23 +370,22 @@ SharedTextureSourceOGL::GetTextureTransf
   if (!GetSharedHandleDetails(gl(), mShareType, mSharedHandle, handleDetails)) {
     NS_WARNING("Could not get shared handle details");
     return gfx3DMatrix();
   }
 
   return handleDetails.mTextureTransform;
 }
 
-SharedTextureHostOGL::SharedTextureHostOGL(uint64_t aID,
-                                           TextureFlags aFlags,
+SharedTextureHostOGL::SharedTextureHostOGL(TextureFlags aFlags,
                                            gl::SharedTextureShareType aShareType,
                                            gl::SharedTextureHandle aSharedHandle,
                                            gfx::IntSize aSize,
                                            bool inverted)
-  : TextureHost(aID, aFlags)
+  : TextureHost(aFlags)
   , mSize(aSize)
   , mCompositor(nullptr)
   , mSharedHandle(aSharedHandle)
   , mShareType(aShareType)
 {
 }
 
 SharedTextureHostOGL::~SharedTextureHostOGL()
--- a/gfx/layers/opengl/TextureHostOGL.h
+++ b/gfx/layers/opengl/TextureHostOGL.h
@@ -293,18 +293,17 @@ protected:
 /**
  * A TextureHost for shared GL Textures
  *
  * Most of the logic actually happens in SharedTextureSourceOGL.
  */
 class SharedTextureHostOGL : public TextureHost
 {
 public:
-  SharedTextureHostOGL(uint64_t aID,
-                       TextureFlags aFlags,
+  SharedTextureHostOGL(TextureFlags aFlags,
                        gl::SharedTextureShareType aShareType,
                        gl::SharedTextureHandle aSharedhandle,
                        gfx::IntSize aSize,
                        bool inverted);
 
   virtual ~SharedTextureHostOGL();
 
   // SharedTextureHostOGL doesn't own any GL texture
--- a/gfx/tests/gtest/TestTextures.cpp
+++ b/gfx/tests/gtest/TestTextures.cpp
@@ -114,30 +114,27 @@ void TestTextureClientSurface(TextureCli
   nsRefPtr<gfxASurface> aSurface = client->GetAsSurface();
   nsRefPtr<gfxImageSurface> clientSurface = aSurface->GetAsImageSurface();
 
   ASSERT_TRUE(texture->Lock(OPEN_READ_ONLY));
   AssertSurfacesEqual(surface, clientSurface);
   texture->Unlock();
 
   // client serialization
-  texture->SetID(1);
   SurfaceDescriptor descriptor;
   ASSERT_TRUE(texture->ToSurfaceDescriptor(descriptor));
 
   ASSERT_NE(descriptor.type(), SurfaceDescriptor::Tnull_t);
 
   // host deserialization
-  RefPtr<TextureHost> host = CreateBackendIndependentTextureHost(texture->GetID(),
-                                                                 descriptor, nullptr,
+  RefPtr<TextureHost> host = CreateBackendIndependentTextureHost(descriptor, nullptr,
                                                                  texture->GetFlags());
 
   ASSERT_TRUE(host.get() != nullptr);
   ASSERT_EQ(host->GetFlags(), texture->GetFlags());
-  ASSERT_EQ(host->GetID(), texture->GetID());
 
   // host read
   ASSERT_TRUE(host->Lock());
   RefPtr<mozilla::gfx::DataSourceSurface> hostDataSurface = host->GetAsSurface();
   host->Unlock();
 
   nsRefPtr<gfxImageSurface> hostSurface =
     new gfxImageSurface(hostDataSurface->GetData(),
@@ -163,32 +160,29 @@ void TestTextureClientYCbCr(TextureClien
 
   // client painting
   texture->UpdateYCbCr(ycbcrData);
 
   ASSERT_TRUE(client->Lock(OPEN_READ_ONLY));
   client->Unlock();
 
   // client serialization
-  client->SetID(1);
   SurfaceDescriptor descriptor;
   ASSERT_TRUE(client->ToSurfaceDescriptor(descriptor));
 
   ASSERT_NE(descriptor.type(), SurfaceDescriptor::Tnull_t);
 
   // host deserialization
-  RefPtr<TextureHost> textureHost = CreateBackendIndependentTextureHost(client->GetID(),
-                                                                        descriptor, nullptr,
+  RefPtr<TextureHost> textureHost = CreateBackendIndependentTextureHost(descriptor, nullptr,
                                                                         client->GetFlags());
 
   RefPtr<BufferTextureHost> host = static_cast<BufferTextureHost*>(textureHost.get());
 
   ASSERT_TRUE(host.get() != nullptr);
   ASSERT_EQ(host->GetFlags(), client->GetFlags());
-  ASSERT_EQ(host->GetID(), client->GetID());
 
   // This will work iff the compositor is not BasicCompositor
   ASSERT_EQ(host->GetFormat(), mozilla::gfx::FORMAT_YUV);
 
   // host read
   ASSERT_TRUE(host->Lock());
 
   ASSERT_TRUE(host->GetFormat() == mozilla::gfx::FORMAT_YUV);