Bug 989883 - Remove deprecated ImageClient/Host. r=mattwoodrow
authorNicolas Silva <nical@mozilla.com>
Tue, 01 Apr 2014 14:28:00 +0800
changeset 194974 71789ed795c675b1db2229809c4f13cccba342a2
parent 194973 8560fc7e284964200de406d17b0d7033c3ef10dd
child 194975 88b79c3c7d479c3770fc379fc3639bebec32d5bf
push id3624
push userasasaki@mozilla.com
push dateMon, 09 Jun 2014 21:49:01 +0000
treeherdermozilla-beta@b1a5da15899a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattwoodrow
bugs989883
milestone31.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 989883 - Remove deprecated ImageClient/Host. r=mattwoodrow
gfx/layers/ImageContainer.h
gfx/layers/ImageTypes.h
gfx/layers/client/CompositableClient.cpp
gfx/layers/client/ImageClient.cpp
gfx/layers/client/ImageClient.h
gfx/layers/client/TextureClient.cpp
gfx/layers/client/TextureClient.h
gfx/layers/composite/CompositableHost.cpp
gfx/layers/composite/ImageHost.cpp
gfx/layers/composite/ImageHost.h
gfx/layers/ipc/SharedPlanarYCbCrImage.cpp
gfx/layers/ipc/SharedPlanarYCbCrImage.h
gfx/layers/ipc/SharedRGBImage.cpp
gfx/layers/ipc/SharedRGBImage.h
--- a/gfx/layers/ImageContainer.h
+++ b/gfx/layers/ImageContainer.h
@@ -141,17 +141,16 @@ typedef void* HANDLE;
 namespace mozilla {
 
 class CrossProcessMutex;
 
 namespace layers {
 
 class ImageClient;
 class SharedPlanarYCbCrImage;
-class DeprecatedSharedPlanarYCbCrImage;
 class TextureClient;
 class CompositableClient;
 class CompositableForwarder;
 class SurfaceDescriptor;
 
 struct ImageBackendData
 {
   virtual ~ImageBackendData() {}
@@ -856,17 +855,16 @@ public:
 
   virtual bool IsValid() { return !!mBufferSize; }
 
   virtual gfx::IntSize GetSize() { return mSize; }
 
   PlanarYCbCrImage(BufferRecycleBin *aRecycleBin);
 
   virtual SharedPlanarYCbCrImage *AsSharedPlanarYCbCrImage() { return nullptr; }
-  virtual DeprecatedSharedPlanarYCbCrImage *AsDeprecatedSharedPlanarYCbCrImage() { return nullptr; }
 
   virtual size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const {
     return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf);
   }
 
   virtual size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const;
 
 protected:
--- a/gfx/layers/ImageTypes.h
+++ b/gfx/layers/ImageTypes.h
@@ -21,17 +21,17 @@ MOZ_BEGIN_ENUM_CLASS(ImageFormat)
   /**
    * The GRALLOC_PLANAR_YCBCR format creates a GrallocImage, a subtype of
    * PlanarYCbCrImage. It takes a PlanarYCbCrImage data or the raw gralloc
    * data and can be used as a texture by Gonk backend directly.
    */
   GRALLOC_PLANAR_YCBCR,
 
   /**
-   * The SHARED_RGB format creates a DeprecatedSharedRGBImage, which stores RGB data in
+   * The SHARED_RGB format creates a SharedRGBImage, which stores RGB data in
    * shared memory. Some Android hardware video decoders require this format.
    * Currently only used on Android.
    */
   SHARED_RGB,
 
   /**
    * The CAIRO_SURFACE format creates a CairoImage. All backends should
    * support this format, because video rendering sometimes requires it.
--- a/gfx/layers/client/CompositableClient.cpp
+++ b/gfx/layers/client/CompositableClient.cpp
@@ -99,25 +99,18 @@ CompositableClient::CreateDeprecatedText
   MOZ_ASSERT(GetForwarder(), "Can't create a texture client if the compositable is not connected to the compositor.");
   LayersBackend parentBackend = GetForwarder()->GetCompositorBackendType();
   RefPtr<DeprecatedTextureClient> result;
 
   switch (aDeprecatedTextureClientType) {
   case TEXTURE_SHARED_GL:
   case TEXTURE_SHARED_GL_EXTERNAL:
   case TEXTURE_STREAM_GL:
+  case TEXTURE_YCBCR:
     MOZ_CRASH("Unsupported. this should not be reached");
-  case TEXTURE_YCBCR:
-    if (parentBackend == LayersBackend::LAYERS_D3D9 ||
-        parentBackend == LayersBackend::LAYERS_D3D11 ||
-        parentBackend == LayersBackend::LAYERS_BASIC) {
-      result = new DeprecatedTextureClientShmemYCbCr(GetForwarder(), GetTextureInfo());
-    } else {
-      MOZ_CRASH("Unsupported. this should not be reached");
-    }
     break;
   case TEXTURE_CONTENT:
 #ifdef XP_WIN
     if (parentBackend == LayersBackend::LAYERS_D3D11 && gfxWindowsPlatform::GetPlatform()->GetD2DDevice()) {
       result = new DeprecatedTextureClientD3D11(GetForwarder(), GetTextureInfo());
       break;
     }
     if (parentBackend == LayersBackend::LAYERS_D3D9 &&
--- a/gfx/layers/client/ImageClient.cpp
+++ b/gfx/layers/client/ImageClient.cpp
@@ -46,28 +46,20 @@ namespace layers {
 ImageClient::CreateImageClient(CompositableType aCompositableHostType,
                                CompositableForwarder* aForwarder,
                                TextureFlags aFlags)
 {
   RefPtr<ImageClient> result = nullptr;
   switch (aCompositableHostType) {
   case COMPOSITABLE_IMAGE:
   case BUFFER_IMAGE_SINGLE:
-    if (gfxPlatform::GetPlatform()->UseDeprecatedTextures()) {
-      result = new DeprecatedImageClientSingle(aForwarder, aFlags, BUFFER_IMAGE_SINGLE);
-    } else {
-      result = new ImageClientSingle(aForwarder, aFlags, COMPOSITABLE_IMAGE);
-    }
+    result = new ImageClientSingle(aForwarder, aFlags, COMPOSITABLE_IMAGE);
     break;
   case BUFFER_IMAGE_BUFFERED:
-    if (gfxPlatform::GetPlatform()->UseDeprecatedTextures()) {
-      result = new DeprecatedImageClientSingle(aForwarder, aFlags, BUFFER_IMAGE_BUFFERED);
-    } else {
-      result = new ImageClientBuffered(aForwarder, aFlags, COMPOSITABLE_IMAGE);
-    }
+    result = new ImageClientBuffered(aForwarder, aFlags, COMPOSITABLE_IMAGE);
     break;
   case BUFFER_BRIDGE:
     result = new ImageClientBridge(aForwarder, aFlags);
     break;
   case BUFFER_UNKNOWN:
     result = nullptr;
     break;
   default:
@@ -335,150 +327,16 @@ ImageClient::UpdatePictureRect(nsIntRect
   if (mPictureRect == aRect) {
     return;
   }
   mPictureRect = aRect;
   MOZ_ASSERT(mForwarder);
   GetForwarder()->UpdatePictureRect(this, aRect);
 }
 
-DeprecatedImageClientSingle::DeprecatedImageClientSingle(CompositableForwarder* aFwd,
-                                                         TextureFlags aFlags,
-                                                         CompositableType aType)
-  : ImageClient(aFwd, aFlags, aType)
-  , mTextureInfo(aType)
-{
-  mTextureInfo.mTextureFlags = aFlags;
-}
-
-bool
-DeprecatedImageClientSingle::EnsureDeprecatedTextureClient(DeprecatedTextureClientType aType)
-{
-  // We should not call this method if using ImageBridge or tiled texture
-  // clients since SupportsType always fails
-  if (mDeprecatedTextureClient && mDeprecatedTextureClient->SupportsType(aType)) {
-    return true;
-  }
-  mDeprecatedTextureClient = CreateDeprecatedTextureClient(aType);
-  return !!mDeprecatedTextureClient;
-}
-
-bool
-DeprecatedImageClientSingle::UpdateImage(ImageContainer* aContainer,
-                               uint32_t aContentFlags)
-{
-  AutoLockImage autoLock(aContainer);
-
-  Image *image = autoLock.GetImage();
-  if (!image) {
-    return false;
-  }
-
-  if (mLastPaintedImageSerial == image->GetSerial()) {
-    return true;
-  }
-
-  if (image->GetFormat() == ImageFormat::PLANAR_YCBCR &&
-      EnsureDeprecatedTextureClient(TEXTURE_YCBCR)) {
-    PlanarYCbCrImage* ycbcr = static_cast<PlanarYCbCrImage*>(image);
-
-    if (ycbcr->AsDeprecatedSharedPlanarYCbCrImage()) {
-      AutoLockDeprecatedTextureClient lock(mDeprecatedTextureClient);
-
-      SurfaceDescriptor sd;
-      if (!ycbcr->AsDeprecatedSharedPlanarYCbCrImage()->ToSurfaceDescriptor(sd)) {
-        return false;
-      }
-
-      if (IsSurfaceDescriptorValid(*lock.GetSurfaceDescriptor())) {
-        GetForwarder()->DestroySharedSurface(lock.GetSurfaceDescriptor());
-      }
-
-      *lock.GetSurfaceDescriptor() = sd;
-    } else {
-      AutoLockYCbCrClient clientLock(mDeprecatedTextureClient);
-
-      if (!clientLock.Update(ycbcr)) {
-        NS_WARNING("failed to update DeprecatedTextureClient (YCbCr)");
-        return false;
-      }
-    }
-  } else if (image->GetFormat() == ImageFormat::SHARED_TEXTURE &&
-             EnsureDeprecatedTextureClient(TEXTURE_SHARED_GL_EXTERNAL)) {
-    SharedTextureImage* sharedImage = static_cast<SharedTextureImage*>(image);
-    const SharedTextureImage::Data *data = sharedImage->GetData();
-
-    SharedTextureDescriptor texture(data->mShareType,
-                                    data->mHandle,
-                                    data->mSize,
-                                    data->mInverted);
-    mDeprecatedTextureClient->SetDescriptor(SurfaceDescriptor(texture));
-  } else if (image->GetFormat() == ImageFormat::SHARED_RGB &&
-             EnsureDeprecatedTextureClient(TEXTURE_SHMEM)) {
-    nsIntRect rect(0, 0,
-                   image->GetSize().width,
-                   image->GetSize().height);
-    UpdatePictureRect(rect);
-
-    AutoLockDeprecatedTextureClient lock(mDeprecatedTextureClient);
-
-    SurfaceDescriptor desc;
-    if (!static_cast<DeprecatedSharedRGBImage*>(image)->ToSurfaceDescriptor(desc)) {
-      return false;
-    }
-    mDeprecatedTextureClient->SetDescriptor(desc);
-#ifdef MOZ_WIDGET_GONK
-  } else if (image->GetFormat() == ImageFormat::GRALLOC_PLANAR_YCBCR) {
-    EnsureDeprecatedTextureClient(TEXTURE_SHARED_GL_EXTERNAL);
-
-    nsIntRect rect(0, 0,
-                   image->GetSize().width,
-                   image->GetSize().height);
-    UpdatePictureRect(rect);
-
-    AutoLockDeprecatedTextureClient lock(mDeprecatedTextureClient);
-
-    SurfaceDescriptor desc = static_cast<GrallocImage*>(image)->GetSurfaceDescriptor();
-    if (!IsSurfaceDescriptorValid(desc)) {
-      return false;
-    }
-    mDeprecatedTextureClient->SetDescriptor(desc);
-#endif
-  } else {
-    nsRefPtr<gfxASurface> surface = image->DeprecatedGetAsSurface();
-    MOZ_ASSERT(surface);
-
-    EnsureDeprecatedTextureClient(TEXTURE_SHMEM);
-    MOZ_ASSERT(mDeprecatedTextureClient, "Failed to create texture client");
-
-    AutoLockShmemClient clientLock(mDeprecatedTextureClient);
-    if (!clientLock.Update(image, aContentFlags, surface)) {
-      NS_WARNING("failed to update DeprecatedTextureClient");
-      return false;
-    }
-  }
-
-  Updated();
-
-  if (image->GetFormat() == ImageFormat::PLANAR_YCBCR) {
-    PlanarYCbCrImage* ycbcr = static_cast<PlanarYCbCrImage*>(image);
-    UpdatePictureRect(ycbcr->GetData()->GetPictureRect());
-  }
-
-  mLastPaintedImageSerial = image->GetSerial();
-  aContainer->NotifyPaintedImage(image);
-  return true;
-}
-
-void
-DeprecatedImageClientSingle::Updated()
-{
-  mForwarder->UpdateTexture(this, 1, mDeprecatedTextureClient->LockSurfaceDescriptor());
-}
-
 ImageClientBridge::ImageClientBridge(CompositableForwarder* aFwd,
                                      TextureFlags aFlags)
 : ImageClient(aFwd, aFlags, BUFFER_BRIDGE)
 , mAsyncContainerID(0)
 , mLayer(nullptr)
 {
 }
 
@@ -515,32 +373,10 @@ ImageClientSingle::CreateImage(ImageForm
       img = new GrallocImage();
       return img.forget();
 #endif
     default:
       return nullptr;
   }
 }
 
-already_AddRefed<Image>
-DeprecatedImageClientSingle::CreateImage(ImageFormat aFormat)
-{
-  nsRefPtr<Image> img;
-  switch (aFormat) {
-    case ImageFormat::PLANAR_YCBCR:
-      img = new DeprecatedSharedPlanarYCbCrImage(GetForwarder());
-      return img.forget();
-    case ImageFormat::SHARED_RGB:
-      img = new DeprecatedSharedRGBImage(GetForwarder());
-      return img.forget();
-#ifdef MOZ_WIDGET_GONK
-    case ImageFormat::GRALLOC_PLANAR_YCBCR:
-      img = new GrallocImage();
-      return img.forget();
-#endif
-    default:
-      return nullptr;
-  }
-}
-
-
 }
 }
--- a/gfx/layers/client/ImageClient.h
+++ b/gfx/layers/client/ImageClient.h
@@ -120,60 +120,16 @@ public:
 
   virtual void FlushAllImages(bool aExceptFront) MOZ_OVERRIDE;
 
 protected:
   RefPtr<TextureClient> mBackBuffer;
 };
 
 /**
- * An image client which uses a single texture client, may be single or double
- * buffered. (As opposed to using two texture clients for buffering, as in
- * ContentClientDoubleBuffered, or using multiple clients for YCbCr or tiled
- * images).
- *
- * XXX - this is deprecated, use ImageClientSingle
- */
-class DeprecatedImageClientSingle : public ImageClient
-{
-public:
-  DeprecatedImageClientSingle(CompositableForwarder* aFwd,
-                              TextureFlags aFlags,
-                              CompositableType aType);
-
-  virtual bool UpdateImage(ImageContainer* aContainer, uint32_t aContentFlags);
-
-  /**
-   * Creates a texture client of the requested type.
-   * Returns true if the texture client was created succesfully,
-   * false otherwise.
-   */
-  bool EnsureDeprecatedTextureClient(DeprecatedTextureClientType aType);
-
-  virtual void Updated();
-
-  virtual void SetDescriptorFromReply(TextureIdentifier aTextureId,
-                                      const SurfaceDescriptor& aDescriptor) MOZ_OVERRIDE
-  {
-    mDeprecatedTextureClient->SetDescriptorFromReply(aDescriptor);
-  }
-
-  virtual TextureInfo GetTextureInfo() const MOZ_OVERRIDE
-  {
-    return mTextureInfo;
-  }
-
-  virtual already_AddRefed<Image> CreateImage(ImageFormat aFormat) MOZ_OVERRIDE;
-
-private:
-  RefPtr<DeprecatedTextureClient> mDeprecatedTextureClient;
-  TextureInfo mTextureInfo;
-};
-
-/**
  * Image class to be used for async image uploads using the image bridge
  * protocol.
  * We store the ImageBridge id in the DeprecatedTextureClientIdentifier.
  */
 class ImageClientBridge : public ImageClient
 {
 public:
   ImageClientBridge(CompositableForwarder* aFwd,
--- a/gfx/layers/client/TextureClient.cpp
+++ b/gfx/layers/client/TextureClient.cpp
@@ -1038,56 +1038,16 @@ DeprecatedTextureClientShmem::LockImageS
 DeprecatedTextureClientTile::DeprecatedTextureClientTile(const DeprecatedTextureClientTile& aOther)
   : DeprecatedTextureClient(aOther.mForwarder, aOther.mTextureInfo)
   , mSurface(aOther.mSurface)
 {}
 
 DeprecatedTextureClientTile::~DeprecatedTextureClientTile()
 {}
 
-void
-DeprecatedTextureClientShmemYCbCr::ReleaseResources()
-{
-  GetForwarder()->DestroySharedSurface(&mDescriptor);
-}
-
-void
-DeprecatedTextureClientShmemYCbCr::SetDescriptor(const SurfaceDescriptor& aDescriptor)
-{
-  MOZ_ASSERT(aDescriptor.type() == SurfaceDescriptor::TYCbCrImage ||
-             aDescriptor.type() == SurfaceDescriptor::T__None);
-
-  if (IsSurfaceDescriptorValid(mDescriptor)) {
-    GetForwarder()->DestroySharedSurface(&mDescriptor);
-  }
-  mDescriptor = aDescriptor;
-}
-
-void
-DeprecatedTextureClientShmemYCbCr::SetDescriptorFromReply(const SurfaceDescriptor& aDescriptor)
-{
-  MOZ_ASSERT(aDescriptor.type() == SurfaceDescriptor::TYCbCrImage);
-  DeprecatedSharedPlanarYCbCrImage* shYCbCr = DeprecatedSharedPlanarYCbCrImage::FromSurfaceDescriptor(aDescriptor);
-  if (shYCbCr) {
-    shYCbCr->Release();
-    mDescriptor = SurfaceDescriptor();
-  } else {
-    SetDescriptor(aDescriptor);
-  }
-}
-
-bool
-DeprecatedTextureClientShmemYCbCr::EnsureAllocated(gfx::IntSize aSize,
-                                         gfxContentType aType)
-{
-  NS_RUNTIMEABORT("not enough arguments to do this (need both Y and CbCr sizes)");
-  return false;
-}
-
-
 DeprecatedTextureClientTile::DeprecatedTextureClientTile(CompositableForwarder* aForwarder,
                                                          const TextureInfo& aTextureInfo,
                                                          gfxReusableSurfaceWrapper* aSurface)
   : DeprecatedTextureClient(aForwarder, aTextureInfo)
   , mSurface(aSurface)
 {
   mTextureInfo.mDeprecatedTextureHostFlags = TEXTURE_HOST_TILED;
 }
--- a/gfx/layers/client/TextureClient.h
+++ b/gfx/layers/client/TextureClient.h
@@ -720,33 +720,16 @@ private:
   RefPtr<gfx::DrawTarget> mDrawTarget;
 
   gfxContentType mContentType;
   gfx::IntSize mSize;
 
   friend class CompositingFactory;
 };
 
-// XXX - this class can be removed as soon as we remove DeprecatedImageClientSingle
-class DeprecatedTextureClientShmemYCbCr : public DeprecatedTextureClient
-{
-public:
-  DeprecatedTextureClientShmemYCbCr(CompositableForwarder* aForwarder, const TextureInfo& aTextureInfo)
-    : DeprecatedTextureClient(aForwarder, aTextureInfo)
-  { }
-  ~DeprecatedTextureClientShmemYCbCr() { ReleaseResources(); }
-
-  virtual bool SupportsType(DeprecatedTextureClientType aType) MOZ_OVERRIDE { return aType == TEXTURE_YCBCR; }
-  bool EnsureAllocated(gfx::IntSize aSize, gfxContentType aType) MOZ_OVERRIDE;
-  virtual void SetDescriptorFromReply(const SurfaceDescriptor& aDescriptor) MOZ_OVERRIDE;
-  virtual void SetDescriptor(const SurfaceDescriptor& aDescriptor) MOZ_OVERRIDE;
-  virtual void ReleaseResources();
-  virtual gfxContentType GetContentType() MOZ_OVERRIDE { return gfxContentType::COLOR_ALPHA; }
-};
-
 class DeprecatedTextureClientTile : public DeprecatedTextureClient
 {
 public:
   DeprecatedTextureClientTile(const DeprecatedTextureClientTile& aOther);
   DeprecatedTextureClientTile(CompositableForwarder* aForwarder,
                               const TextureInfo& aTextureInfo,
                               gfxReusableSurfaceWrapper* aSurface = nullptr);
   ~DeprecatedTextureClientTile();
--- a/gfx/layers/composite/CompositableHost.cpp
+++ b/gfx/layers/composite/CompositableHost.cpp
@@ -137,22 +137,16 @@ CompositableHost::RemoveMaskEffect()
 // implemented in TextureHostOGL.cpp
 TemporaryRef<CompositableBackendSpecificData> CreateCompositableBackendSpecificDataOGL();
 
 /* static */ TemporaryRef<CompositableHost>
 CompositableHost::Create(const TextureInfo& aTextureInfo)
 {
   RefPtr<CompositableHost> result;
   switch (aTextureInfo.mCompositableType) {
-  case BUFFER_IMAGE_SINGLE:
-    result = new DeprecatedImageHostSingle(aTextureInfo);
-    break;
-  case BUFFER_IMAGE_BUFFERED:
-    result = new DeprecatedImageHostBuffered(aTextureInfo);
-    break;
   case BUFFER_BRIDGE:
     MOZ_CRASH("Cannot create an image bridge compositable this way");
     break;
   case BUFFER_CONTENT:
     result = new DeprecatedContentHostSingleBuffered(aTextureInfo);
     break;
   case BUFFER_CONTENT_DIRECT:
     result = new DeprecatedContentHostDoubleBuffered(aTextureInfo);
--- a/gfx/layers/composite/ImageHost.cpp
+++ b/gfx/layers/composite/ImageHost.cpp
@@ -217,210 +217,10 @@ ImageHost::GetRenderState()
 #ifdef MOZ_DUMP_PAINTING
 TemporaryRef<gfx::DataSourceSurface>
 ImageHost::GetAsSurface()
 {
   return mFrontBuffer->GetAsSurface();
 }
 #endif
 
-void
-DeprecatedImageHostSingle::SetCompositor(Compositor* aCompositor) {
-  CompositableHost::SetCompositor(aCompositor);
-  if (mDeprecatedTextureHost) {
-    mDeprecatedTextureHost->SetCompositor(aCompositor);
-  }
-}
-
-void
-DeprecatedImageHostSingle::EnsureDeprecatedTextureHost(TextureIdentifier aTextureId,
-                                                       const SurfaceDescriptor& aSurface,
-                                                       ISurfaceAllocator* aAllocator,
-                                                       const TextureInfo& aTextureInfo)
-{
-  if (mDeprecatedTextureHost &&
-      mDeprecatedTextureHost->GetBuffer() &&
-      mDeprecatedTextureHost->GetBuffer()->type() == aSurface.type()) {
-    return;
-  }
-
-  MakeDeprecatedTextureHost(aTextureId,
-                  aSurface,
-                  aAllocator,
-                  aTextureInfo);
-}
-
-void
-DeprecatedImageHostSingle::MakeDeprecatedTextureHost(TextureIdentifier aTextureId,
-                                                     const SurfaceDescriptor& aSurface,
-                                                     ISurfaceAllocator* aAllocator,
-                                                     const TextureInfo& aTextureInfo)
-{
-  mDeprecatedTextureHost = DeprecatedTextureHost::CreateDeprecatedTextureHost(aSurface.type(),
-                                                mTextureInfo.mDeprecatedTextureHostFlags,
-                                                mTextureInfo.mTextureFlags,
-                                                this);
-
-  NS_ASSERTION(mDeprecatedTextureHost, "Failed to create texture host");
-
-  Compositor* compositor = GetCompositor();
-  if (compositor && mDeprecatedTextureHost) {
-    mDeprecatedTextureHost->SetCompositor(compositor);
-  }
-}
-
-LayerRenderState
-DeprecatedImageHostSingle::GetRenderState()
-{
-  if (mDeprecatedTextureHost) {
-    return mDeprecatedTextureHost->GetRenderState();
-  }
-  return LayerRenderState();
-}
-
-void
-DeprecatedImageHostSingle::Composite(EffectChain& aEffectChain,
-                                     float aOpacity,
-                                     const gfx::Matrix4x4& aTransform,
-                                     const gfx::Filter& aFilter,
-                                     const gfx::Rect& aClipRect,
-                                     const nsIntRegion* aVisibleRegion,
-                                     TiledLayerProperties* aLayerProperties)
-{
-  if (!mDeprecatedTextureHost) {
-    NS_WARNING("Can't composite an invalid or null DeprecatedTextureHost");
-    return;
-  }
-
-  if (!mDeprecatedTextureHost->IsValid()) {
-    NS_WARNING("Can't composite an invalid DeprecatedTextureHost");
-    return;
-  }
-
-  if (!GetCompositor()) {
-    // should only happen during tabswitch if async-video is still sending frames.
-    return;
-  }
-
-  if (!mDeprecatedTextureHost->Lock()) {
-    NS_ASSERTION(false, "failed to lock texture host");
-    return;
-  }
-
-  RefPtr<TexturedEffect> effect =
-    CreateTexturedEffect(mDeprecatedTextureHost, aFilter);
-  if (!effect) {
-    return;
-  }
-
-  aEffectChain.mPrimaryEffect = effect;
-
-  TileIterator* it = mDeprecatedTextureHost->AsTileIterator();
-  if (it) {
-    it->BeginTileIteration();
-    do {
-      nsIntRect tileRect = it->GetTileRect();
-      gfx::Rect rect(tileRect.x, tileRect.y, tileRect.width, tileRect.height);
-      GetCompositor()->DrawQuad(rect, aClipRect, aEffectChain,
-                                aOpacity, aTransform);
-      GetCompositor()->DrawDiagnostics(DIAGNOSTIC_IMAGE|DIAGNOSTIC_BIGIMAGE,
-                                       rect, aClipRect, aTransform, mFlashCounter);
-    } while (it->NextTile());
-    it->EndTileIteration();
-  } else {
-    IntSize textureSize = mDeprecatedTextureHost->GetSize();
-    gfx::Rect rect(0, 0,
-                   mPictureRect.width,
-                   mPictureRect.height);
-    if (mHasPictureRect) {
-      effect->mTextureCoords = Rect(Float(mPictureRect.x) / textureSize.width,
-                                    Float(mPictureRect.y) / textureSize.height,
-                                    Float(mPictureRect.width) / textureSize.width,
-                                    Float(mPictureRect.height) / textureSize.height);
-    } else {
-      effect->mTextureCoords = Rect(0, 0, 1, 1);
-      rect = gfx::Rect(0, 0, textureSize.width, textureSize.height);
-    }
-
-    if (mDeprecatedTextureHost->GetFlags() & TEXTURE_NEEDS_Y_FLIP) {
-      effect->mTextureCoords.y = effect->mTextureCoords.YMost();
-      effect->mTextureCoords.height = -effect->mTextureCoords.height;
-    }
-
-    GetCompositor()->DrawQuad(rect, aClipRect, aEffectChain,
-                              aOpacity, aTransform);
-    GetCompositor()->DrawDiagnostics(DIAGNOSTIC_IMAGE,
-                                     rect, aClipRect, aTransform, mFlashCounter);
-  }
-
-  mDeprecatedTextureHost->Unlock();
-}
-
-void
-DeprecatedImageHostSingle::PrintInfo(nsACString& aTo, const char* aPrefix)
-{
-  aTo += aPrefix;
-  aTo += nsPrintfCString("DeprecatedImageHostSingle (0x%p)", this);
-
-  AppendToString(aTo, mPictureRect, " [picture-rect=", "]");
-
-  if (mDeprecatedTextureHost) {
-    nsAutoCString pfx(aPrefix);
-    pfx += "  ";
-    aTo += "\n";
-    mDeprecatedTextureHost->PrintInfo(aTo, pfx.get());
-  }
-}
-
-bool
-DeprecatedImageHostBuffered::Update(const SurfaceDescriptor& aImage,
-                                    SurfaceDescriptor* aResult) {
-  if (!GetDeprecatedTextureHost()) {
-    *aResult = aImage;
-    return false;
-  }
-  GetDeprecatedTextureHost()->SwapTextures(aImage, aResult);
-  return GetDeprecatedTextureHost()->IsValid();
-}
-
-void
-DeprecatedImageHostBuffered::MakeDeprecatedTextureHost(TextureIdentifier aTextureId,
-                                                       const SurfaceDescriptor& aSurface,
-                                                       ISurfaceAllocator* aAllocator,
-                                                       const TextureInfo& aTextureInfo)
-{
-  DeprecatedImageHostSingle::MakeDeprecatedTextureHost(aTextureId,
-                                                       aSurface,
-                                                       aAllocator,
-                                                       aTextureInfo);
-  if (mDeprecatedTextureHost) {
-    mDeprecatedTextureHost->SetBuffer(new SurfaceDescriptor(null_t()), aAllocator);
-  }
-}
-
-#ifdef MOZ_DUMP_PAINTING
-void
-DeprecatedImageHostSingle::Dump(FILE* aFile,
-                                const char* aPrefix,
-                                bool aDumpHtml)
-{
-  if (!aFile) {
-    aFile = stderr;
-  }
-  if (mDeprecatedTextureHost) {
-    fprintf_stderr(aFile, "%s", aPrefix);
-    fprintf_stderr(aFile, aDumpHtml ? "<ul><li>DeprecatedTextureHost: "
-                             : "DeprecatedTextureHost: ");
-    DumpDeprecatedTextureHost(aFile, mDeprecatedTextureHost);
-    fprintf_stderr(aFile, aDumpHtml ? " </li></ul> " : " ");
-  }
-}
-
-TemporaryRef<gfx::DataSourceSurface>
-DeprecatedImageHostSingle::GetAsSurface()
-{
-  return mDeprecatedTextureHost->GetAsSurface();
-}
-#endif
-
-
 }
 }
--- a/gfx/layers/composite/ImageHost.h
+++ b/gfx/layers/composite/ImageHost.h
@@ -81,96 +81,12 @@ public:
 
 protected:
 
   RefPtr<TextureHost> mFrontBuffer;
   nsIntRect mPictureRect;
   bool mHasPictureRect;
 };
 
-// ImageHost with a single DeprecatedTextureHost
-class DeprecatedImageHostSingle : public CompositableHost
-{
-public:
-  DeprecatedImageHostSingle(const TextureInfo& aTextureInfo)
-    : CompositableHost(aTextureInfo)
-    , mDeprecatedTextureHost(nullptr)
-    , mHasPictureRect(false)
-  {}
-
-  virtual CompositableType GetType() { return mTextureInfo.mCompositableType; }
-
-  virtual void EnsureDeprecatedTextureHost(TextureIdentifier aTextureId,
-                                 const SurfaceDescriptor& aSurface,
-                                 ISurfaceAllocator* aAllocator,
-                                 const TextureInfo& aTextureInfo) MOZ_OVERRIDE;
-
-  DeprecatedTextureHost* GetDeprecatedTextureHost() MOZ_OVERRIDE { return mDeprecatedTextureHost; }
-
-  virtual void Composite(EffectChain& aEffectChain,
-                         float aOpacity,
-                         const gfx::Matrix4x4& aTransform,
-                         const gfx::Filter& aFilter,
-                         const gfx::Rect& aClipRect,
-                         const nsIntRegion* aVisibleRegion = nullptr,
-                         TiledLayerProperties* aLayerProperties = nullptr);
-
-  virtual bool Update(const SurfaceDescriptor& aImage,
-                      SurfaceDescriptor* aResult = nullptr) MOZ_OVERRIDE
-  {
-    return CompositableHost::Update(aImage, aResult);
-  }
-
-  virtual void SetPictureRect(const nsIntRect& aPictureRect) MOZ_OVERRIDE
-  {
-    mPictureRect = aPictureRect;
-    mHasPictureRect = true;
-  }
-
-  virtual LayerRenderState GetRenderState() MOZ_OVERRIDE;
-
-  virtual void SetCompositor(Compositor* aCompositor) MOZ_OVERRIDE;
-
-  virtual void PrintInfo(nsACString& aTo, const char* aPrefix);
-
-#ifdef MOZ_DUMP_PAINTING
-  virtual void Dump(FILE* aFile=nullptr,
-                    const char* aPrefix="",
-                    bool aDumpHtml=false) MOZ_OVERRIDE;
-
-  virtual TemporaryRef<gfx::DataSourceSurface> GetAsSurface() MOZ_OVERRIDE;
-#endif
-
-protected:
-  virtual void MakeDeprecatedTextureHost(TextureIdentifier aTextureId,
-                               const SurfaceDescriptor& aSurface,
-                               ISurfaceAllocator* aAllocator,
-                               const TextureInfo& aTextureInfo);
-
-  RefPtr<DeprecatedTextureHost> mDeprecatedTextureHost;
-  nsIntRect mPictureRect;
-  bool mHasPictureRect;
-};
-
-// Double buffered ImageHost. We have a single TextureHost and double buffering
-// is done at the TextureHost/Client level. This is in contrast with buffered
-// ContentHosts which do their own double buffering 
-class DeprecatedImageHostBuffered : public DeprecatedImageHostSingle
-{
-public:
-  DeprecatedImageHostBuffered(const TextureInfo& aTextureInfo)
-    : DeprecatedImageHostSingle(aTextureInfo)
-  {}
-
-  virtual bool Update(const SurfaceDescriptor& aImage,
-                      SurfaceDescriptor* aResult = nullptr) MOZ_OVERRIDE;
-
-protected:
-  virtual void MakeDeprecatedTextureHost(TextureIdentifier aTextureId,
-                               const SurfaceDescriptor& aSurface,
-                               ISurfaceAllocator* aAllocator,
-                               const TextureInfo& aTextureInfo) MOZ_OVERRIDE;
-};
-
 }
 }
 
 #endif
--- a/gfx/layers/ipc/SharedPlanarYCbCrImage.cpp
+++ b/gfx/layers/ipc/SharedPlanarYCbCrImage.cpp
@@ -40,33 +40,16 @@ SharedPlanarYCbCrImage::~SharedPlanarYCb
 
   if (mCompositable->GetAsyncID() != 0 &&
       !InImageBridgeChildThread()) {
     ImageBridgeChild::DispatchReleaseTextureClient(mTextureClient.forget().drop());
     ImageBridgeChild::DispatchReleaseImageClient(mCompositable.forget().drop());
   }
 }
 
-DeprecatedSharedPlanarYCbCrImage::DeprecatedSharedPlanarYCbCrImage(ISurfaceAllocator* aAllocator)
-: PlanarYCbCrImage(nullptr)
-, mSurfaceAllocator(aAllocator), mAllocated(false)
-{
-  MOZ_COUNT_CTOR(DeprecatedSharedPlanarYCbCrImage);
-}
-
-DeprecatedSharedPlanarYCbCrImage::~DeprecatedSharedPlanarYCbCrImage() {
-  MOZ_COUNT_DTOR(DeprecatedSharedPlanarYCbCrImage);
-
-  if (mAllocated) {
-    SurfaceDescriptor desc;
-    DropToSurfaceDescriptor(desc);
-    mSurfaceAllocator->DestroySharedSurface(&desc);
-  }
-}
-
 size_t
 SharedPlanarYCbCrImage::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const
 {
   // NB: Explicitly skipping mTextureClient, the memory is already reported
   //     at time of allocation in GfxMemoryImageReporter.
   // Not owned:
   // - mCompositable
   size_t size = PlanarYCbCrImage::SizeOfExcludingThis(aMallocSizeOf);
@@ -244,169 +227,10 @@ SharedPlanarYCbCrImage::Allocate(PlanarY
   mData.mCbSkip = 0;
   mData.mCrSkip = 0;
   mData.mYStride = mData.mYSize.width;
   mData.mCbCrStride = mData.mCbCrSize.width;
 
   return true;
 }
 
-void
-DeprecatedSharedPlanarYCbCrImage::SetData(const PlanarYCbCrData& aData)
-{
-  // If mShmem has not been allocated (through Allocate(aData)), allocate it.
-  // This code path is slower than the one used when Allocate has been called
-  // since it will trigger a full copy.
-  if (!mAllocated) {
-    Data data = aData;
-    if (!Allocate(data)) {
-      return;
-    }
-  }
-
-  // do not set mBuffer like in PlanarYCbCrImage because the later
-  // will try to manage this memory without knowing it belongs to a
-  // shmem.
-  mBufferSize = YCbCrImageDataSerializer::ComputeMinBufferSize(mData.mYSize,
-                                                               mData.mCbCrSize);
-  mSize = mData.mPicSize;
-
-  YCbCrImageDataSerializer serializer(mShmem.get<uint8_t>(), mShmem.Size<uint8_t>());
-  MOZ_ASSERT(aData.mCbSkip == aData.mCrSkip);
-  if (!serializer.CopyData(aData.mYChannel, aData.mCbChannel, aData.mCrChannel,
-                           aData.mYSize, aData.mYStride,
-                           aData.mCbCrSize, aData.mCbCrStride,
-                           aData.mYSkip, aData.mCbSkip)) {
-    NS_WARNING("Failed to copy image data!");
-  }
-  mData.mYChannel = serializer.GetYData();
-  mData.mCbChannel = serializer.GetCbData();
-  mData.mCrChannel = serializer.GetCrData();
-}
-
-// needs to be overriden because the parent class sets mBuffer which we
-// do not want to happen.
-uint8_t*
-DeprecatedSharedPlanarYCbCrImage::AllocateAndGetNewBuffer(uint32_t aSize)
-{
-  NS_ABORT_IF_FALSE(!mAllocated, "This image already has allocated data");
-  size_t size = YCbCrImageDataSerializer::ComputeMinBufferSize(aSize);
-
-  // get new buffer _without_ setting mBuffer.
-  if (!AllocateBuffer(size)) {
-    return nullptr;
-  }
-
-  // update buffer size
-  mBufferSize = size;
-
-  YCbCrImageDataSerializer serializer(mShmem.get<uint8_t>(), mShmem.Size<uint8_t>());
-  return serializer.GetData();
-}
-
-void
-DeprecatedSharedPlanarYCbCrImage::SetDataNoCopy(const Data &aData)
-{
-  mData = aData;
-  mSize = aData.mPicSize;
-  YCbCrImageDataSerializer serializer(mShmem.get<uint8_t>(), mShmem.Size<uint8_t>());
-  serializer.InitializeBufferInfo(aData.mYSize,
-                                  aData.mCbCrSize,
-                                  aData.mStereoMode);
-}
-
-uint8_t* 
-DeprecatedSharedPlanarYCbCrImage::AllocateBuffer(uint32_t aSize)
-{
-  NS_ABORT_IF_FALSE(!mAllocated, "This image already has allocated data");
-  SharedMemory::SharedMemoryType shmType = OptimalShmemType();
-  if (!mSurfaceAllocator->AllocUnsafeShmem(aSize, shmType, &mShmem)) {
-    return nullptr;
-  }
-  mAllocated = true;
-  return mShmem.get<uint8_t>();
-}
-
-
-bool
-DeprecatedSharedPlanarYCbCrImage::Allocate(PlanarYCbCrData& aData)
-{
-  NS_ABORT_IF_FALSE(!mAllocated, "This image already has allocated data");
-
-  size_t size = YCbCrImageDataSerializer::ComputeMinBufferSize(aData.mYSize,
-                                                               aData.mCbCrSize);
-
-  if (AllocateBuffer(static_cast<uint32_t>(size)) == nullptr) {
-    return false;
-  }
-
-  YCbCrImageDataSerializer serializer(mShmem.get<uint8_t>(), mShmem.Size<uint8_t>());
-  serializer.InitializeBufferInfo(aData.mYSize,
-                                  aData.mCbCrSize,
-                                  aData.mStereoMode);
-  if (!serializer.IsValid() || mShmem.Size<uint8_t>() < size) {
-    mSurfaceAllocator->DeallocShmem(mShmem);
-    return false;
-  }
-
-  aData.mYChannel = serializer.GetYData();
-  aData.mCbChannel = serializer.GetCbData();
-  aData.mCrChannel = serializer.GetCrData();
-
-  // copy some of aData's values in mData (most of them)
-  mData.mYChannel = aData.mYChannel;
-  mData.mCbChannel = aData.mCbChannel;
-  mData.mCrChannel = aData.mCrChannel;
-  mData.mYSize = aData.mYSize;
-  mData.mCbCrSize = aData.mCbCrSize;
-  mData.mPicX = aData.mPicX;
-  mData.mPicY = aData.mPicY;
-  mData.mPicSize = aData.mPicSize;
-  mData.mStereoMode = aData.mStereoMode;
-  // those members are not always equal to aData's, due to potentially different
-  // packing.
-  mData.mYSkip = 0;
-  mData.mCbSkip = 0;
-  mData.mCrSkip = 0;
-  mData.mYStride = mData.mYSize.width;
-  mData.mCbCrStride = mData.mCbCrSize.width;
-
-  mAllocated = true;
-  return true;
-}
-
-bool
-DeprecatedSharedPlanarYCbCrImage::ToSurfaceDescriptor(SurfaceDescriptor& aDesc) {
-  if (!mAllocated) {
-    return false;
-  }
-  aDesc = YCbCrImage(mShmem, reinterpret_cast<uint64_t>(this));
-  this->AddRef();
-  return true;
-}
-
-bool
-DeprecatedSharedPlanarYCbCrImage::DropToSurfaceDescriptor(SurfaceDescriptor& aDesc) {
-  if (!mAllocated) {
-    return false;
-  }
-  aDesc = YCbCrImage(mShmem, 0);
-  mShmem = mozilla::ipc::Shmem();
-  mAllocated = false;
-  return true;
-}
-
-DeprecatedSharedPlanarYCbCrImage*
-DeprecatedSharedPlanarYCbCrImage::FromSurfaceDescriptor(const SurfaceDescriptor& aDescriptor)
-{
-  if (aDescriptor.type() != SurfaceDescriptor::TYCbCrImage) {
-    return nullptr;
-  }
-  const YCbCrImage& ycbcr = aDescriptor.get_YCbCrImage();
-  if (ycbcr.owner() == 0) {
-    return nullptr;
-  }
-  return reinterpret_cast<DeprecatedSharedPlanarYCbCrImage*>(ycbcr.owner());
-}
-
-
 } // namespace
 } // namespace
--- a/gfx/layers/ipc/SharedPlanarYCbCrImage.h
+++ b/gfx/layers/ipc/SharedPlanarYCbCrImage.h
@@ -9,91 +9,28 @@
 #include "mozilla/RefPtr.h"             // for RefPtr
 #include "mozilla/ipc/Shmem.h"          // for Shmem
 #include "nsCOMPtr.h"                   // for already_AddRefed
 #include "nsDebug.h"                    // for NS_WARNING
 #include "nsISupportsImpl.h"            // for MOZ_COUNT_CTOR
 
 class gfxASurface;
 
-#ifndef MOZILLA_LAYERS_DeprecatedSharedPlanarYCbCrImage_H
-#define MOZILLA_LAYERS_DeprecatedSharedPlanarYCbCrImage_H
+#ifndef MOZILLA_LAYERS_SHAREDPLANARYCBCRIMAGE_H
+#define MOZILLA_LAYERS_SHAREDPLANARYCBCRIMAGE_H
 
 namespace mozilla {
 namespace layers {
 
 class BufferTextureClient;
 class ImageClient;
 class ISurfaceAllocator;
 class SurfaceDescriptor;
 class TextureClient;
 
-// XXX - This class will be removed along with DeprecatedImageClient
-class DeprecatedSharedPlanarYCbCrImage : public PlanarYCbCrImage
-{
-public:
-  DeprecatedSharedPlanarYCbCrImage(ISurfaceAllocator* aAllocator);
-
-  ~DeprecatedSharedPlanarYCbCrImage();
-
-  virtual DeprecatedSharedPlanarYCbCrImage* AsDeprecatedSharedPlanarYCbCrImage() MOZ_OVERRIDE
-  {
-    return this;
-  }
-
-  virtual already_AddRefed<gfxASurface> DeprecatedGetAsSurface() MOZ_OVERRIDE
-  {
-    if (!mAllocated) {
-      NS_WARNING("Can't get as surface");
-      return nullptr;
-    }
-    return PlanarYCbCrImage::DeprecatedGetAsSurface();
-  }
-
-  virtual void SetData(const PlanarYCbCrData& aData) MOZ_OVERRIDE;
-  virtual void SetDataNoCopy(const Data &aData) MOZ_OVERRIDE;
-
-  virtual bool Allocate(PlanarYCbCrData& aData);
-  virtual uint8_t* AllocateBuffer(uint32_t aSize) MOZ_OVERRIDE;
-  // needs to be overriden because the parent class sets mBuffer which we
-  // do not want to happen.
-  uint8_t* AllocateAndGetNewBuffer(uint32_t aSize) MOZ_OVERRIDE;
-
-  virtual bool IsValid() MOZ_OVERRIDE {
-    return mAllocated;
-  }
-
-  /**
-   * Setup the Surface descriptor to contain this image's shmem, while keeping
-   * ownership of the shmem.
-   * if the operation succeeds, return true and AddRef this DeprecatedSharedPlanarYCbCrImage.
-   */
-  bool ToSurfaceDescriptor(SurfaceDescriptor& aResult);
-
-  /**
-   * Setup the Surface descriptor to contain this image's shmem, and loose
-   * ownership of the shmem.
-   * if the operation succeeds, return true (and does _not_ AddRef this
-   * DeprecatedSharedPlanarYCbCrImage).
-   */
-  bool DropToSurfaceDescriptor(SurfaceDescriptor& aResult);
-
-  /**
-   * Returns a DeprecatedSharedPlanarYCbCrImage* iff the descriptor was initialized with
-   * ToSurfaceDescriptor.
-   */
-  static DeprecatedSharedPlanarYCbCrImage* FromSurfaceDescriptor(const SurfaceDescriptor& aDesc);
-
-private:
-  ipc::Shmem mShmem;
-  RefPtr<ISurfaceAllocator> mSurfaceAllocator;
-  bool mAllocated;
-};
-
-
 class SharedPlanarYCbCrImage : public PlanarYCbCrImage
                              , public ISharedImage
 {
 public:
   SharedPlanarYCbCrImage(ImageClient* aCompositable);
   ~SharedPlanarYCbCrImage();
 
   virtual ISharedImage* AsSharedImage() MOZ_OVERRIDE { return this; }
--- a/gfx/layers/ipc/SharedRGBImage.cpp
+++ b/gfx/layers/ipc/SharedRGBImage.cpp
@@ -21,172 +21,47 @@
 #include "nsSize.h"                     // for nsIntSize
 
 // Just big enough for a 1080p RGBA32 frame
 #define MAX_FRAME_SIZE (16 * 1024 * 1024)
 
 namespace mozilla {
 namespace layers {
 
-DeprecatedSharedRGBImage::DeprecatedSharedRGBImage(ISurfaceAllocator *aAllocator) :
-  Image(nullptr, ImageFormat::SHARED_RGB),
-  mSize(0, 0),
-  mSurfaceAllocator(aAllocator),
-  mAllocated(false),
-  mShmem(new ipc::Shmem())
-{
-  MOZ_COUNT_CTOR(DeprecatedSharedRGBImage);
-}
-
-DeprecatedSharedRGBImage::~DeprecatedSharedRGBImage()
-{
-  MOZ_COUNT_DTOR(DeprecatedSharedRGBImage);
-
-  if (mAllocated) {
-    SurfaceDescriptor desc;
-    DropToSurfaceDescriptor(desc);
-    mSurfaceAllocator->DestroySharedSurface(&desc);
-  }
-  delete mShmem;
-}
-
 already_AddRefed<Image>
 CreateSharedRGBImage(ImageContainer *aImageContainer,
                      nsIntSize aSize,
                      gfxImageFormat aImageFormat)
 {
   NS_ASSERTION(aImageFormat == gfxImageFormat::ARGB32 ||
                aImageFormat == gfxImageFormat::RGB24 ||
                aImageFormat == gfxImageFormat::RGB16_565,
                "RGB formats supported only");
 
   if (!aImageContainer) {
-    NS_WARNING("No ImageContainer to allocate DeprecatedSharedRGBImage");
+    NS_WARNING("No ImageContainer to allocate SharedRGBImage");
     return nullptr;
   }
 
   nsRefPtr<Image> image = aImageContainer->CreateImage(ImageFormat::SHARED_RGB);
 
   if (!image) {
-    NS_WARNING("Failed to create DeprecatedSharedRGBImage");
+    NS_WARNING("Failed to create SharedRGBImage");
     return nullptr;
   }
 
-  if (gfxPlatform::GetPlatform()->UseDeprecatedTextures()) {
-    nsRefPtr<DeprecatedSharedRGBImage> rgbImageDep = static_cast<DeprecatedSharedRGBImage*>(image.get());
-    rgbImageDep->mSize = aSize.ToIntSize();
-    rgbImageDep->mImageFormat = aImageFormat;
-
-    if (!rgbImageDep->AllocateBuffer(aSize, aImageFormat)) {
-      NS_WARNING("Failed to allocate shared memory for DeprecatedSharedRGBImage");
-      return nullptr;
-    }
-    return rgbImageDep.forget();
-  }
   nsRefPtr<SharedRGBImage> rgbImage = static_cast<SharedRGBImage*>(image.get());
   if (!rgbImage->Allocate(gfx::ToIntSize(aSize),
                           gfx::ImageFormatToSurfaceFormat(aImageFormat))) {
     NS_WARNING("Failed to allocate a shared image");
     return nullptr;
   }
   return image.forget();
 }
 
-uint8_t *
-DeprecatedSharedRGBImage::GetBuffer()
-{
-  return mShmem->get<uint8_t>();
-}
-
-size_t
-DeprecatedSharedRGBImage::GetBufferSize()
-{
-  return mSize.width * mSize.height * gfxASurface::BytesPerPixel(mImageFormat);
-}
-
-gfx::IntSize
-DeprecatedSharedRGBImage::GetSize()
-{
-  return mSize;
-}
-
-bool
-DeprecatedSharedRGBImage::AllocateBuffer(nsIntSize aSize, gfxImageFormat aImageFormat)
-{
-  if (mAllocated) {
-    NS_WARNING("Already allocated shmem");
-    return false;
-  }
-
-  size_t size = GetBufferSize();
-
-  if (size == 0 || size > MAX_FRAME_SIZE) {
-    NS_WARNING("Invalid frame size");
-  }
-  if (mSurfaceAllocator->AllocUnsafeShmem(size, OptimalShmemType(), mShmem)) {
-    mAllocated = true;
-  }
-
-  return mAllocated;
-}
-
-already_AddRefed<gfxASurface>
-DeprecatedSharedRGBImage::DeprecatedGetAsSurface()
-{
-  return nullptr;
-}
-
-TemporaryRef<gfx::SourceSurface>
-DeprecatedSharedRGBImage::GetAsSourceSurface()
-{
-  return nullptr;
-}
-
-bool
-DeprecatedSharedRGBImage::ToSurfaceDescriptor(SurfaceDescriptor& aResult)
-{
-  if (!mAllocated) {
-    return false;
-  }
-  this->AddRef();
-  aResult = RGBImage(*mShmem,
-                     nsIntRect(0, 0, mSize.width, mSize.height),
-                     mImageFormat,
-                     reinterpret_cast<uint64_t>(this));
-  return true;
-}
-
-bool
-DeprecatedSharedRGBImage::DropToSurfaceDescriptor(SurfaceDescriptor& aResult)
-{
-  if (!mAllocated) {
-    return false;
-  }
-  aResult = RGBImage(*mShmem,
-                     nsIntRect(0, 0, mSize.width, mSize.height),
-                     mImageFormat,
-                     0);
-  *mShmem = ipc::Shmem();
-  mAllocated = false;
-  return true;
-}
-
-DeprecatedSharedRGBImage*
-DeprecatedSharedRGBImage::FromSurfaceDescriptor(const SurfaceDescriptor& aDescriptor)
-{
-  if (aDescriptor.type() != SurfaceDescriptor::TRGBImage) {
-    return nullptr;
-  }
-  const RGBImage& rgb = aDescriptor.get_RGBImage();
-  if (rgb.owner() == 0) {
-    return nullptr;
-  }
-  return reinterpret_cast<DeprecatedSharedRGBImage*>(rgb.owner());
-}
-
 SharedRGBImage::SharedRGBImage(ImageClient* aCompositable)
 : Image(nullptr, ImageFormat::SHARED_RGB)
 , mCompositable(aCompositable)
 {
   MOZ_COUNT_CTOR(SharedRGBImage);
 }
 
 SharedRGBImage::~SharedRGBImage()
@@ -245,11 +120,10 @@ SharedRGBImage::DeprecatedGetAsSurface()
 }
 
 TemporaryRef<gfx::SourceSurface>
 SharedRGBImage::GetAsSourceSurface()
 {
   return nullptr;
 }
 
-
 } // namespace layers
 } // namespace mozilla
--- a/gfx/layers/ipc/SharedRGBImage.h
+++ b/gfx/layers/ipc/SharedRGBImage.h
@@ -33,79 +33,16 @@ class SurfaceDescriptor;
 already_AddRefed<Image> CreateSharedRGBImage(ImageContainer* aImageContainer,
                                              nsIntSize aSize,
                                              gfxImageFormat aImageFormat);
 
 /**
  * Stores RGB data in shared memory
  * It is assumed that the image width and stride are equal
  */
-class DeprecatedSharedRGBImage : public Image,
-                                 public ISharedImage
-{
-friend already_AddRefed<Image> CreateSharedRGBImage(ImageContainer* aImageContainer,
-                                                    nsIntSize aSize,
-                                                    gfxImageFormat aImageFormat);
-public:
-  struct Header {
-    gfxImageFormat mImageFormat;
-  };
-
-  DeprecatedSharedRGBImage(ISurfaceAllocator *aAllocator);
-  ~DeprecatedSharedRGBImage();
-
-  virtual ISharedImage* AsSharedImage() MOZ_OVERRIDE { return this; }
-
-  virtual uint8_t *GetBuffer() MOZ_OVERRIDE;
-
-  gfx::IntSize GetSize();
-  size_t GetBufferSize();
-
-  static uint8_t BytesPerPixel(gfxImageFormat aImageFormat);
-  already_AddRefed<gfxASurface> DeprecatedGetAsSurface();
-  virtual TemporaryRef<gfx::SourceSurface> GetAsSourceSurface() MOZ_OVERRIDE;
-
-  /**
-   * Setup the Surface descriptor to contain this image's shmem, while keeping
-   * ownership of the shmem.
-   * if the operation succeeds, return true and AddRef this DeprecatedSharedRGBImage.
-   */
-  bool ToSurfaceDescriptor(SurfaceDescriptor& aResult);
-
-  /**
-   * Setup the Surface descriptor to contain this image's shmem, and loose
-   * ownership of the shmem.
-   * if the operation succeeds, return true (and does _not_ AddRef this
-   * DeprecatedSharedRGBImage).
-   */
-  bool DropToSurfaceDescriptor(SurfaceDescriptor& aResult);
-
-  /**
-   * Returns a DeprecatedSharedRGBImage* iff the descriptor was initialized with
-   * ToSurfaceDescriptor.
-   */
-  static DeprecatedSharedRGBImage* FromSurfaceDescriptor(const SurfaceDescriptor& aDescriptor);
-
-  bool AllocateBuffer(nsIntSize aSize, gfxImageFormat aImageFormat);
-
-  TextureClient* GetTextureClient(CompositableClient* aClient) MOZ_OVERRIDE { return nullptr; }
-
-protected:
-  gfx::IntSize mSize;
-  gfxImageFormat mImageFormat;
-  RefPtr<ISurfaceAllocator> mSurfaceAllocator;
-
-  bool mAllocated;
-  ipc::Shmem *mShmem;
-};
-
-/**
- * Stores RGB data in shared memory
- * It is assumed that the image width and stride are equal
- */
 class SharedRGBImage : public Image
                      , public ISharedImage
 {
 public:
   SharedRGBImage(ImageClient* aCompositable);
   ~SharedRGBImage();
 
   virtual ISharedImage* AsSharedImage() MOZ_OVERRIDE { return this; }