Bug 858914 - Mark some Image related classes deprecated. r=jrmuizel DONTBUILD
authorNicolas Silva <nical@mozilla.com>
Wed, 24 Jul 2013 18:08:35 +0200
changeset 139856 8c6b16333028cb0e62fecea31160b9a565ab4a13
parent 139855 223bace8e4316344be58766a6094a703232d1155
child 139857 89a4ff6bdc937068222da3f0cc1a0cb3a8a8c797
push idunknown
push userunknown
push dateunknown
reviewersjrmuizel
bugs858914
milestone25.0a1
Bug 858914 - Mark some Image related classes deprecated. r=jrmuizel DONTBUILD
content/media/plugins/MediaPluginReader.cpp
gfx/layers/ImageContainer.h
gfx/layers/ImageTypes.h
gfx/layers/client/ImageClient.cpp
gfx/layers/client/ImageClient.h
gfx/layers/client/TextureClient.cpp
gfx/layers/composite/CompositableHost.cpp
gfx/layers/composite/ImageHost.cpp
gfx/layers/composite/ImageHost.h
gfx/layers/ipc/ISurfaceAllocator.cpp
gfx/layers/ipc/SharedPlanarYCbCrImage.cpp
gfx/layers/ipc/SharedPlanarYCbCrImage.h
gfx/layers/ipc/SharedRGBImage.cpp
gfx/layers/ipc/SharedRGBImage.h
gfx/layers/opengl/TextureHostOGL.cpp
--- a/content/media/plugins/MediaPluginReader.cpp
+++ b/content/media/plugins/MediaPluginReader.cpp
@@ -355,20 +355,20 @@ void *
 MediaPluginReader::ImageBufferCallback::operator()(size_t aWidth, size_t aHeight,
                                                      MPAPI::ColorFormat aColorFormat)
 {
   if (!mImageContainer) {
     NS_WARNING("No image container to construct an image");
     return nullptr;
   }
 
-  nsRefPtr<mozilla::layers::SharedRGBImage> rgbImage;
+  nsRefPtr<mozilla::layers::DeprecatedSharedRGBImage> rgbImage;
   switch(aColorFormat) {
     case MPAPI::RGB565:
-      rgbImage = mozilla::layers::SharedRGBImage::Create(mImageContainer,
+      rgbImage = mozilla::layers::DeprecatedSharedRGBImage::Create(mImageContainer,
                                                          nsIntSize(aWidth, aHeight),
                                                          gfxASurface::ImageFormatRGB16_565);
       mImage = rgbImage;
       return rgbImage->GetBuffer();
     case MPAPI::YCbCr:
     default:
       NS_NOTREACHED("Color format not supported");
       return nullptr;
--- a/gfx/layers/ImageContainer.h
+++ b/gfx/layers/ImageContainer.h
@@ -29,16 +29,17 @@ class CrossProcessMutex;
 namespace ipc {
 class Shmem;
 }
 
 namespace layers {
 
 class ImageClient;
 class SharedPlanarYCbCrImage;
+class DeprecatedSharedPlanarYCbCrImage;
 
 struct ImageBackendData
 {
   virtual ~ImageBackendData() {}
 
 protected:
   ImageBackendData() {}
 };
@@ -715,16 +716,17 @@ public:
 
   virtual bool IsValid() { return !!mBufferSize; }
 
   virtual gfxIntSize GetSize() { return mSize; }
 
   PlanarYCbCrImage(BufferRecycleBin *aRecycleBin);
 
   virtual SharedPlanarYCbCrImage *AsSharedPlanarYCbCrImage() { return nullptr; }
+  virtual DeprecatedSharedPlanarYCbCrImage *AsDeprecatedSharedPlanarYCbCrImage() { return nullptr; }
 
 protected:
   /**
    * Make a copy of the YCbCr data into local storage.
    *
    * @param aData           Input image data.
    */
   void CopyData(const Data& aData);
--- a/gfx/layers/ImageTypes.h
+++ b/gfx/layers/ImageTypes.h
@@ -19,17 +19,17 @@ enum ImageFormat {
   /**
    * The GRALLOC_PLANAR_YCBCR format creates a GrallocPlanarYCbCrImage, a
    * subtype of PlanarYCbCrImage. It takes a PlanarYCbCrImage data and can be
    * used as a texture by Gonk backend directly.
    */
   GRALLOC_PLANAR_YCBCR,
 
   /**
-   * The SHARED_RGB format creates a SharedRGBImage, which stores RGB data in
+   * The SHARED_RGB format creates a DeprecatedSharedRGBImage, 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/ImageClient.cpp
+++ b/gfx/layers/client/ImageClient.cpp
@@ -23,20 +23,20 @@ namespace layers {
 /* static */ TemporaryRef<ImageClient>
 ImageClient::CreateImageClient(CompositableType aCompositableHostType,
                                CompositableForwarder* aForwarder,
                                TextureFlags aFlags)
 {
   RefPtr<ImageClient> result = nullptr;
   switch (aCompositableHostType) {
   case BUFFER_IMAGE_SINGLE:
-    result = new ImageClientSingle(aForwarder, aFlags, BUFFER_IMAGE_SINGLE);
+    result = new DeprecatedImageClientSingle(aForwarder, aFlags, BUFFER_IMAGE_SINGLE);
     break;
   case BUFFER_IMAGE_BUFFERED:
-    result = new ImageClientSingle(aForwarder, aFlags, BUFFER_IMAGE_BUFFERED);
+    result = new DeprecatedImageClientSingle(aForwarder, aFlags, BUFFER_IMAGE_BUFFERED);
     break;
   case BUFFER_BRIDGE:
     result = new ImageClientBridge(aForwarder, aFlags);
     break;
   case BUFFER_UNKNOWN:
     result = nullptr;
     break;
   default:
@@ -61,39 +61,39 @@ ImageClient::UpdatePictureRect(nsIntRect
   if (mPictureRect == aRect) {
     return;
   }
   mPictureRect = aRect;
   MOZ_ASSERT(mForwarder);
   GetForwarder()->UpdatePictureRect(this, aRect);
 }
 
-ImageClientSingle::ImageClientSingle(CompositableForwarder* aFwd,
-                                     TextureFlags aFlags,
-                                     CompositableType aType)
+DeprecatedImageClientSingle::DeprecatedImageClientSingle(CompositableForwarder* aFwd,
+                                                         TextureFlags aFlags,
+                                                         CompositableType aType)
   : ImageClient(aFwd, aType)
   , mTextureInfo(aType)
 {
   mTextureInfo.mTextureFlags = aFlags;
 }
 
 bool
-ImageClientSingle::EnsureDeprecatedTextureClient(DeprecatedTextureClientType aType)
+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
-ImageClientSingle::UpdateImage(ImageContainer* aContainer,
+DeprecatedImageClientSingle::UpdateImage(ImageContainer* aContainer,
                                uint32_t aContentFlags)
 {
   AutoLockImage autoLock(aContainer);
 
   Image *image = autoLock.GetImage();
   if (!image) {
     return false;
   }
@@ -101,21 +101,21 @@ ImageClientSingle::UpdateImage(ImageCont
   if (mLastPaintedImageSerial == image->GetSerial()) {
     return true;
   }
 
   if (image->GetFormat() == PLANAR_YCBCR &&
       EnsureDeprecatedTextureClient(TEXTURE_YCBCR)) {
     PlanarYCbCrImage* ycbcr = static_cast<PlanarYCbCrImage*>(image);
 
-    if (ycbcr->AsSharedPlanarYCbCrImage()) {
+    if (ycbcr->AsDeprecatedSharedPlanarYCbCrImage()) {
       AutoLockDeprecatedTextureClient lock(mDeprecatedTextureClient);
 
       SurfaceDescriptor sd;
-      if (!ycbcr->AsSharedPlanarYCbCrImage()->ToSurfaceDescriptor(sd)) {
+      if (!ycbcr->AsDeprecatedSharedPlanarYCbCrImage()->ToSurfaceDescriptor(sd)) {
         return false;
       }
 
       if (IsSurfaceDescriptorValid(*lock.GetSurfaceDescriptor())) {
         GetForwarder()->DestroySharedSurface(lock.GetSurfaceDescriptor());
       }
 
       *lock.GetSurfaceDescriptor() = sd;
@@ -142,17 +142,17 @@ ImageClientSingle::UpdateImage(ImageCont
     nsIntRect rect(0, 0,
                    image->GetSize().width,
                    image->GetSize().height);
     UpdatePictureRect(rect);
 
     AutoLockDeprecatedTextureClient lock(mDeprecatedTextureClient);
 
     SurfaceDescriptor desc;
-    if (!static_cast<SharedRGBImage*>(image)->ToSurfaceDescriptor(desc)) {
+    if (!static_cast<DeprecatedSharedRGBImage*>(image)->ToSurfaceDescriptor(desc)) {
       return false;
     }
     mDeprecatedTextureClient->SetDescriptor(desc);
 #ifdef MOZ_WIDGET_GONK
   } else if (image->GetFormat() == GONK_IO_SURFACE &&
              EnsureDeprecatedTextureClient(TEXTURE_SHARED_GL_EXTERNAL)) {
     nsIntRect rect(0, 0,
                    image->GetSize().width,
@@ -204,17 +204,17 @@ ImageClientSingle::UpdateImage(ImageCont
   }
 
   mLastPaintedImageSerial = image->GetSerial();
   aContainer->NotifyPaintedImage(image);
   return true;
 }
 
 void
-ImageClientSingle::Updated()
+DeprecatedImageClientSingle::Updated()
 {
   mForwarder->UpdateTexture(this, 1, mDeprecatedTextureClient->GetDescriptor());
 }
 
 ImageClientBridge::ImageClientBridge(CompositableForwarder* aFwd,
                                      TextureFlags aFlags)
 : ImageClient(aFwd, BUFFER_BRIDGE)
 , mAsyncContainerID(0)
@@ -242,20 +242,20 @@ ImageClientBridge::UpdateImage(ImageCont
 already_AddRefed<Image>
 ImageClient::CreateImage(const uint32_t *aFormats,
                          uint32_t aNumFormats)
 {
   nsRefPtr<Image> img;
   for (uint32_t i = 0; i < aNumFormats; i++) {
     switch (aFormats[i]) {
       case PLANAR_YCBCR:
-        img = new SharedPlanarYCbCrImage(GetForwarder());
+        img = new DeprecatedSharedPlanarYCbCrImage(GetForwarder());
         return img.forget();
       case SHARED_RGB:
-        img = new SharedRGBImage(GetForwarder());
+        img = new DeprecatedSharedRGBImage(GetForwarder());
         return img.forget();
 #ifdef MOZ_WIDGET_GONK
       case GONK_IO_SURFACE:
         img = new GonkIOSurfaceImage();
         return img.forget();
       case GRALLOC_PLANAR_YCBCR:
         img = new GrallocPlanarYCbCrImage();
         return img.forget();
--- a/gfx/layers/client/ImageClient.h
+++ b/gfx/layers/client/ImageClient.h
@@ -67,22 +67,22 @@ protected:
 };
 
 /**
  * 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).
  */
-class ImageClientSingle : public ImageClient
+class DeprecatedImageClientSingle : public ImageClient
 {
 public:
-  ImageClientSingle(CompositableForwarder* aFwd,
-                     TextureFlags aFlags,
-                     CompositableType aType);
+  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.
    */
--- a/gfx/layers/client/TextureClient.cpp
+++ b/gfx/layers/client/TextureClient.cpp
@@ -156,17 +156,17 @@ DeprecatedTextureClientShmemYCbCr::SetDe
   mDescriptor = aDescriptor;
   MOZ_ASSERT(IsSurfaceDescriptorValid(mDescriptor));
 }
 
 void
 DeprecatedTextureClientShmemYCbCr::SetDescriptorFromReply(const SurfaceDescriptor& aDescriptor)
 {
   MOZ_ASSERT(aDescriptor.type() == SurfaceDescriptor::TYCbCrImage);
-  SharedPlanarYCbCrImage* shYCbCr = SharedPlanarYCbCrImage::FromSurfaceDescriptor(aDescriptor);
+  DeprecatedSharedPlanarYCbCrImage* shYCbCr = DeprecatedSharedPlanarYCbCrImage::FromSurfaceDescriptor(aDescriptor);
   if (shYCbCr) {
     shYCbCr->Release();
     mDescriptor = SurfaceDescriptor();
   } else {
     SetDescriptor(aDescriptor);
   }
 }
 
--- a/gfx/layers/composite/CompositableHost.cpp
+++ b/gfx/layers/composite/CompositableHost.cpp
@@ -49,20 +49,20 @@ CompositableHost::AddMaskEffect(EffectCh
 }
 
 /* static */ TemporaryRef<CompositableHost>
 CompositableHost::Create(const TextureInfo& aTextureInfo)
 {
   RefPtr<CompositableHost> result;
   switch (aTextureInfo.mCompositableType) {
   case BUFFER_IMAGE_BUFFERED:
-    result = new ImageHostBuffered(aTextureInfo);
+    result = new DeprecatedImageHostBuffered(aTextureInfo);
     return result;
   case BUFFER_IMAGE_SINGLE:
-    result = new ImageHostSingle(aTextureInfo);
+    result = new DeprecatedImageHostSingle(aTextureInfo);
     return result;
   case BUFFER_TILED:
     result = new TiledContentHost(aTextureInfo);
     return result;
   case BUFFER_CONTENT:
     result = new ContentHostSingleBuffered(aTextureInfo);
     return result;
   case BUFFER_CONTENT_DIRECT:
--- a/gfx/layers/composite/ImageHost.cpp
+++ b/gfx/layers/composite/ImageHost.cpp
@@ -12,68 +12,68 @@
 
 namespace mozilla {
 
 using namespace gfx;
 
 namespace layers {
 
 void
-ImageHostSingle::SetCompositor(Compositor* aCompositor) {
+DeprecatedImageHostSingle::SetCompositor(Compositor* aCompositor) {
   CompositableHost::SetCompositor(aCompositor);
   if (mDeprecatedTextureHost) {
     mDeprecatedTextureHost->SetCompositor(aCompositor);
   }
 }
 
 void
-ImageHostSingle::EnsureDeprecatedTextureHost(TextureIdentifier aTextureId,
-                                   const SurfaceDescriptor& aSurface,
-                                   ISurfaceAllocator* aAllocator,
-                                   const TextureInfo& aTextureInfo)
+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
-ImageHostSingle::MakeDeprecatedTextureHost(TextureIdentifier aTextureId,
-                                 const SurfaceDescriptor& aSurface,
-                                 ISurfaceAllocator* aAllocator,
-                                 const TextureInfo& aTextureInfo)
+DeprecatedImageHostSingle::MakeDeprecatedTextureHost(TextureIdentifier aTextureId,
+                                                     const SurfaceDescriptor& aSurface,
+                                                     ISurfaceAllocator* aAllocator,
+                                                     const TextureInfo& aTextureInfo)
 {
   mDeprecatedTextureHost = DeprecatedTextureHost::CreateDeprecatedTextureHost(aSurface.type(),
                                                 mTextureInfo.mDeprecatedTextureHostFlags,
                                                 mTextureInfo.mTextureFlags);
 
   NS_ASSERTION(mDeprecatedTextureHost, "Failed to create texture host");
 
   Compositor* compositor = GetCompositor();
   if (compositor && mDeprecatedTextureHost) {
     mDeprecatedTextureHost->SetCompositor(compositor);
   }
 }
 
 void
-ImageHostSingle::Composite(EffectChain& aEffectChain,
-                           float aOpacity,
-                           const gfx::Matrix4x4& aTransform,
-                           const gfx::Point& aOffset,
-                           const gfx::Filter& aFilter,
-                           const gfx::Rect& aClipRect,
-                           const nsIntRegion* aVisibleRegion,
-                           TiledLayerProperties* aLayerProperties)
+DeprecatedImageHostSingle::Composite(EffectChain& aEffectChain,
+                                     float aOpacity,
+                                     const gfx::Matrix4x4& aTransform,
+                                     const gfx::Point& aOffset,
+                                     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");
@@ -133,62 +133,62 @@ ImageHostSingle::Composite(EffectChain& 
                                      rect, aClipRect, aTransform, aOffset);
   }
 
   mDeprecatedTextureHost->Unlock();
 }
 
 #ifdef MOZ_LAYERS_HAVE_LOG
 void
-ImageHostSingle::PrintInfo(nsACString& aTo, const char* aPrefix)
+DeprecatedImageHostSingle::PrintInfo(nsACString& aTo, const char* aPrefix)
 {
   aTo += aPrefix;
-  aTo += nsPrintfCString("ImageHostSingle (0x%p)", this);
+  aTo += nsPrintfCString("DeprecatedImageHostSingle (0x%p)", this);
 
   AppendToString(aTo, mPictureRect, " [picture-rect=", "]");
 
   if (mDeprecatedTextureHost) {
     nsAutoCString pfx(aPrefix);
     pfx += "  ";
     aTo += "\n";
     mDeprecatedTextureHost->PrintInfo(aTo, pfx.get());
   }
 }
 #endif
 
 bool
-ImageHostBuffered::Update(const SurfaceDescriptor& aImage,
-                          SurfaceDescriptor* aResult) {
+DeprecatedImageHostBuffered::Update(const SurfaceDescriptor& aImage,
+                                    SurfaceDescriptor* aResult) {
   if (!GetDeprecatedTextureHost()) {
     *aResult = aImage;
     return false;
   }
   GetDeprecatedTextureHost()->SwapTextures(aImage, aResult);
   return GetDeprecatedTextureHost()->IsValid();
 }
 
 void
-ImageHostBuffered::MakeDeprecatedTextureHost(TextureIdentifier aTextureId,
-                                   const SurfaceDescriptor& aSurface,
-                                   ISurfaceAllocator* aAllocator,
-                                   const TextureInfo& aTextureInfo)
+DeprecatedImageHostBuffered::MakeDeprecatedTextureHost(TextureIdentifier aTextureId,
+                                                       const SurfaceDescriptor& aSurface,
+                                                       ISurfaceAllocator* aAllocator,
+                                                       const TextureInfo& aTextureInfo)
 {
-  ImageHostSingle::MakeDeprecatedTextureHost(aTextureId,
-                                   aSurface,
-                                   aAllocator,
-                                   aTextureInfo);
+  DeprecatedImageHostSingle::MakeDeprecatedTextureHost(aTextureId,
+                                                       aSurface,
+                                                       aAllocator,
+                                                       aTextureInfo);
   if (mDeprecatedTextureHost) {
     mDeprecatedTextureHost->SetBuffer(new SurfaceDescriptor(null_t()), aAllocator);
   }
 }
 
 void
-ImageHostSingle::Dump(FILE* aFile,
-                      const char* aPrefix,
-                      bool aDumpHtml)
+DeprecatedImageHostSingle::Dump(FILE* aFile,
+                                const char* aPrefix,
+                                bool aDumpHtml)
 {
   if (!aFile) {
     aFile = stderr;
   }
   if (mDeprecatedTextureHost) {
     fprintf(aFile, "%s", aPrefix);
     fprintf(aFile, aDumpHtml ? "<ul><li>DeprecatedTextureHost: "
                              : "DeprecatedTextureHost: ");
--- a/gfx/layers/composite/ImageHost.h
+++ b/gfx/layers/composite/ImageHost.h
@@ -32,20 +32,20 @@ protected:
 
   ~ImageHost()
   {
     MOZ_COUNT_DTOR(ImageHost);
   }
 };
 
 // ImageHost with a single DeprecatedTextureHost
-class ImageHostSingle : public ImageHost
+class DeprecatedImageHostSingle : public ImageHost
 {
 public:
-  ImageHostSingle(const TextureInfo& aTextureInfo)
+  DeprecatedImageHostSingle(const TextureInfo& aTextureInfo)
     : ImageHost(aTextureInfo)
     , mDeprecatedTextureHost(nullptr)
     , mHasPictureRect(false)
   {}
 
   virtual CompositableType GetType() { return mTextureInfo.mCompositableType; }
 
   virtual void EnsureDeprecatedTextureHost(TextureIdentifier aTextureId,
@@ -110,21 +110,21 @@ protected:
   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 ImageHostBuffered : public ImageHostSingle
+class DeprecatedImageHostBuffered : public DeprecatedImageHostSingle
 {
 public:
-  ImageHostBuffered(const TextureInfo& aTextureInfo)
-    : ImageHostSingle(aTextureInfo)
+  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,
--- a/gfx/layers/ipc/ISurfaceAllocator.cpp
+++ b/gfx/layers/ipc/ISurfaceAllocator.cpp
@@ -164,22 +164,23 @@ bool IsSurfaceDescriptorOwned(const Surf
     }
     default:
       return false;
   }
   return false;
 }
 bool ReleaseOwnedSurfaceDescriptor(const SurfaceDescriptor& aDescriptor)
 {
-  SharedPlanarYCbCrImage* sharedYCbCr = SharedPlanarYCbCrImage::FromSurfaceDescriptor(aDescriptor);
+  DeprecatedSharedPlanarYCbCrImage* sharedYCbCr =
+    DeprecatedSharedPlanarYCbCrImage::FromSurfaceDescriptor(aDescriptor);
   if (sharedYCbCr) {
     sharedYCbCr->Release();
     return true;
   }
-  SharedRGBImage* sharedRGB = SharedRGBImage::FromSurfaceDescriptor(aDescriptor);
+  DeprecatedSharedRGBImage* sharedRGB = DeprecatedSharedRGBImage::FromSurfaceDescriptor(aDescriptor);
   if (sharedRGB) {
     sharedRGB->Release();
     return true;
   }
   return false;
 }
 
 #if !defined(MOZ_HAVE_PLATFORM_SPECIFIC_LAYER_BUFFERS)
--- a/gfx/layers/ipc/SharedPlanarYCbCrImage.cpp
+++ b/gfx/layers/ipc/SharedPlanarYCbCrImage.cpp
@@ -8,29 +8,29 @@
 #include "ISurfaceAllocator.h"
 #include "mozilla/layers/LayersSurfaces.h"
 
 namespace mozilla {
 namespace layers {
 
 using namespace mozilla::ipc;
 
-SharedPlanarYCbCrImage::~SharedPlanarYCbCrImage() {
-  MOZ_COUNT_DTOR(SharedPlanarYCbCrImage);
+DeprecatedSharedPlanarYCbCrImage::~DeprecatedSharedPlanarYCbCrImage() {
+  MOZ_COUNT_DTOR(DeprecatedSharedPlanarYCbCrImage);
 
   if (mAllocated) {
     SurfaceDescriptor desc;
     DropToSurfaceDescriptor(desc);
     mSurfaceAllocator->DestroySharedSurface(&desc);
   }
 }
 
 
 void
-SharedPlanarYCbCrImage::SetData(const PlanarYCbCrImage::Data& aData)
+DeprecatedSharedPlanarYCbCrImage::SetData(const PlanarYCbCrImage::Data& 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;
@@ -55,56 +55,56 @@ SharedPlanarYCbCrImage::SetData(const Pl
   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*
-SharedPlanarYCbCrImage::AllocateAndGetNewBuffer(uint32_t aSize)
+DeprecatedSharedPlanarYCbCrImage::AllocateAndGetNewBuffer(uint32_t aSize)
 {
   NS_ABORT_IF_FALSE(!mAllocated, "This image already has allocated data");
   size_t size = YCbCrImageDataSerializer::ComputeMinBufferSize(aSize);
   // update buffer size
   mBufferSize = size;
 
   // get new buffer _without_ setting mBuffer.
   AllocateBuffer(mBufferSize);
   YCbCrImageDataSerializer serializer(mShmem.get<uint8_t>());
 
   return serializer.GetData();
 }
 
 
 void
-SharedPlanarYCbCrImage::SetDataNoCopy(const Data &aData)
+DeprecatedSharedPlanarYCbCrImage::SetDataNoCopy(const Data &aData)
 {
   mData = aData;
   mSize = aData.mPicSize;
   YCbCrImageDataSerializer serializer(mShmem.get<uint8_t>());
   serializer.InitializeBufferInfo(aData.mYSize,
                                   aData.mCbCrSize);
 }
 
 uint8_t* 
-SharedPlanarYCbCrImage::AllocateBuffer(uint32_t aSize)
+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
-SharedPlanarYCbCrImage::Allocate(PlanarYCbCrImage::Data& aData)
+DeprecatedSharedPlanarYCbCrImage::Allocate(PlanarYCbCrImage::Data& 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;
@@ -140,44 +140,44 @@ SharedPlanarYCbCrImage::Allocate(PlanarY
   mData.mYStride = mData.mYSize.width;
   mData.mCbCrStride = mData.mCbCrSize.width;
 
   mAllocated = true;
   return true;
 }
 
 bool
-SharedPlanarYCbCrImage::ToSurfaceDescriptor(SurfaceDescriptor& aDesc) {
+DeprecatedSharedPlanarYCbCrImage::ToSurfaceDescriptor(SurfaceDescriptor& aDesc) {
   if (!mAllocated) {
     return false;
   }
   aDesc = YCbCrImage(mShmem, reinterpret_cast<uint64_t>(this));
   this->AddRef();
   return true;
 }
 
 bool
-SharedPlanarYCbCrImage::DropToSurfaceDescriptor(SurfaceDescriptor& aDesc) {
+DeprecatedSharedPlanarYCbCrImage::DropToSurfaceDescriptor(SurfaceDescriptor& aDesc) {
   if (!mAllocated) {
     return false;
   }
   aDesc = YCbCrImage(mShmem, 0);
   mShmem = Shmem();
   mAllocated = false;
   return true;
 }
 
-SharedPlanarYCbCrImage*
-SharedPlanarYCbCrImage::FromSurfaceDescriptor(const SurfaceDescriptor& aDescriptor)
+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<SharedPlanarYCbCrImage*>(ycbcr.owner());
+  return reinterpret_cast<DeprecatedSharedPlanarYCbCrImage*>(ycbcr.owner());
 }
 
 
 } // namespace
 } // namespace
--- a/gfx/layers/ipc/SharedPlanarYCbCrImage.h
+++ b/gfx/layers/ipc/SharedPlanarYCbCrImage.h
@@ -3,37 +3,37 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "ImageContainer.h"
 #include "mozilla/ipc/Shmem.h"
 #include "mozilla/ipc/SharedMemory.h"
 #include "mozilla/layers/ISurfaceAllocator.h"
 
-#ifndef MOZILLA_LAYERS_SHAREDPLANARYCBCRIMAGE_H
-#define MOZILLA_LAYERS_SHAREDPLANARYCBCRIMAGE_H
+#ifndef MOZILLA_LAYERS_DeprecatedSharedPlanarYCbCrImage_H
+#define MOZILLA_LAYERS_DeprecatedSharedPlanarYCbCrImage_H
 
 namespace mozilla {
 namespace layers {
 
 class ImageClient;
 
-class SharedPlanarYCbCrImage : public PlanarYCbCrImage
+class DeprecatedSharedPlanarYCbCrImage : public PlanarYCbCrImage
 {
 public:
-  SharedPlanarYCbCrImage(ISurfaceAllocator* aAllocator)
+  DeprecatedSharedPlanarYCbCrImage(ISurfaceAllocator* aAllocator)
   : PlanarYCbCrImage(nullptr)
   , mSurfaceAllocator(aAllocator), mAllocated(false)
   {
-    MOZ_COUNT_CTOR(SharedPlanarYCbCrImage);
+    MOZ_COUNT_CTOR(DeprecatedSharedPlanarYCbCrImage);
   }
 
-  ~SharedPlanarYCbCrImage();
+  ~DeprecatedSharedPlanarYCbCrImage();
 
-  virtual SharedPlanarYCbCrImage* AsSharedPlanarYCbCrImage() MOZ_OVERRIDE
+  virtual DeprecatedSharedPlanarYCbCrImage* AsDeprecatedSharedPlanarYCbCrImage() MOZ_OVERRIDE
   {
     return this;
   }
 
   virtual already_AddRefed<gfxASurface> GetAsSurface() MOZ_OVERRIDE
   {
     if (!mAllocated) {
       NS_WARNING("Can't get as surface");
@@ -53,33 +53,33 @@ public:
 
   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 SharedPlanarYCbCrImage.
+   * 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
-   * SharedPlanarYCbCrImage).
+   * DeprecatedSharedPlanarYCbCrImage).
    */
   bool DropToSurfaceDescriptor(SurfaceDescriptor& aResult);
 
   /**
-   * Returns a SharedPlanarYCbCrImage* iff the descriptor was initialized with
+   * Returns a DeprecatedSharedPlanarYCbCrImage* iff the descriptor was initialized with
    * ToSurfaceDescriptor.
    */
-  static SharedPlanarYCbCrImage* FromSurfaceDescriptor(const SurfaceDescriptor& aDesc);
+  static DeprecatedSharedPlanarYCbCrImage* FromSurfaceDescriptor(const SurfaceDescriptor& aDesc);
 
 private:
   ipc::Shmem mShmem;
   ISurfaceAllocator* mSurfaceAllocator;
   bool mAllocated;
 };
 
 } // namespace
--- a/gfx/layers/ipc/SharedRGBImage.cpp
+++ b/gfx/layers/ipc/SharedRGBImage.cpp
@@ -9,93 +9,93 @@
 #include "mozilla/layers/ISurfaceAllocator.h"
 
 // Just big enough for a 1080p RGBA32 frame
 #define MAX_FRAME_SIZE (16 * 1024 * 1024)
 
 namespace mozilla {
 namespace layers {
 
-SharedRGBImage::SharedRGBImage(ISurfaceAllocator *aAllocator) :
+DeprecatedSharedRGBImage::DeprecatedSharedRGBImage(ISurfaceAllocator *aAllocator) :
   Image(nullptr, SHARED_RGB),
   mSize(0, 0),
   mSurfaceAllocator(aAllocator),
   mAllocated(false),
   mShmem(new ipc::Shmem())
 {
-  MOZ_COUNT_CTOR(SharedRGBImage);
+  MOZ_COUNT_CTOR(DeprecatedSharedRGBImage);
 }
 
-SharedRGBImage::~SharedRGBImage()
+DeprecatedSharedRGBImage::~DeprecatedSharedRGBImage()
 {
-  MOZ_COUNT_DTOR(SharedRGBImage);
+  MOZ_COUNT_DTOR(DeprecatedSharedRGBImage);
 
   if (mAllocated) {
     SurfaceDescriptor desc;
     DropToSurfaceDescriptor(desc);
     mSurfaceAllocator->DestroySharedSurface(&desc);
   }
   delete mShmem;
 }
 
-already_AddRefed<SharedRGBImage>
-SharedRGBImage::Create(ImageContainer *aImageContainer,
+already_AddRefed<DeprecatedSharedRGBImage>
+DeprecatedSharedRGBImage::Create(ImageContainer *aImageContainer,
                        nsIntSize aSize,
                        gfxImageFormat aImageFormat)
 {
   NS_ASSERTION(aImageFormat == gfxASurface::ImageFormatARGB32 ||
                aImageFormat == gfxASurface::ImageFormatRGB24 ||
                aImageFormat == gfxASurface::ImageFormatRGB16_565,
                "RGB formats supported only");
 
   if (!aImageContainer) {
-    NS_WARNING("No ImageContainer to allocate SharedRGBImage");
+    NS_WARNING("No ImageContainer to allocate DeprecatedSharedRGBImage");
     return nullptr;
   }
 
   ImageFormat format = SHARED_RGB;
   nsRefPtr<Image> image = aImageContainer->CreateImage(&format, 1);
 
   if (!image) {
-    NS_WARNING("Failed to create SharedRGBImage");
+    NS_WARNING("Failed to create DeprecatedSharedRGBImage");
     return nullptr;
   }
 
-  nsRefPtr<SharedRGBImage> rgbImage = static_cast<SharedRGBImage*>(image.get());
+  nsRefPtr<DeprecatedSharedRGBImage> rgbImage = static_cast<DeprecatedSharedRGBImage*>(image.get());
   rgbImage->mSize = gfxIntSize(aSize.width, aSize.height);
   rgbImage->mImageFormat = aImageFormat;
 
   if (!rgbImage->AllocateBuffer(aSize, aImageFormat)) {
-    NS_WARNING("Failed to allocate shared memory for SharedRGBImage");
+    NS_WARNING("Failed to allocate shared memory for DeprecatedSharedRGBImage");
     return nullptr;
   }
 
   return rgbImage.forget();
 }
 
 uint8_t *
-SharedRGBImage::GetBuffer()
+DeprecatedSharedRGBImage::GetBuffer()
 {
   return mShmem->get<uint8_t>();
 }
 
 size_t
-SharedRGBImage::GetBufferSize()
+DeprecatedSharedRGBImage::GetBufferSize()
 {
   return mSize.width * mSize.height * gfxASurface::BytesPerPixel(mImageFormat);
 }
 
 gfxIntSize
-SharedRGBImage::GetSize()
+DeprecatedSharedRGBImage::GetSize()
 {
   return mSize;
 }
 
 bool
-SharedRGBImage::AllocateBuffer(nsIntSize aSize, gfxImageFormat aImageFormat)
+DeprecatedSharedRGBImage::AllocateBuffer(nsIntSize aSize, gfxImageFormat aImageFormat)
 {
   if (mAllocated) {
     NS_WARNING("Already allocated shmem");
     return false;
   }
 
   size_t size = GetBufferSize();
 
@@ -105,58 +105,58 @@ SharedRGBImage::AllocateBuffer(nsIntSize
   if (mSurfaceAllocator->AllocUnsafeShmem(size, OptimalShmemType(), mShmem)) {
     mAllocated = true;
   }
 
   return mAllocated;
 }
 
 already_AddRefed<gfxASurface>
-SharedRGBImage::GetAsSurface()
+DeprecatedSharedRGBImage::GetAsSurface()
 {
   return nullptr;
 }
 
 bool
-SharedRGBImage::ToSurfaceDescriptor(SurfaceDescriptor& aResult)
+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
-SharedRGBImage::DropToSurfaceDescriptor(SurfaceDescriptor& aResult)
+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;
 }
 
-SharedRGBImage*
-SharedRGBImage::FromSurfaceDescriptor(const SurfaceDescriptor& aDescriptor)
+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<SharedRGBImage*>(rgb.owner());
+  return reinterpret_cast<DeprecatedSharedRGBImage*>(rgb.owner());
 }
 
 
 } // namespace layers
 } // namespace mozilla
--- a/gfx/layers/ipc/SharedRGBImage.h
+++ b/gfx/layers/ipc/SharedRGBImage.h
@@ -13,58 +13,58 @@ namespace ipc {
 class Shmem;
 }
 namespace layers {
 
 /**
  * Stores RGB data in shared memory
  * It is assumed that the image width and stride are equal
  */
-class SharedRGBImage : public Image
+class DeprecatedSharedRGBImage : public Image
 {
   typedef gfxASurface::gfxImageFormat gfxImageFormat;
 public:
   struct Header {
     gfxImageFormat mImageFormat;
   };
 
-  SharedRGBImage(ISurfaceAllocator *aAllocator);
-  ~SharedRGBImage();
+  DeprecatedSharedRGBImage(ISurfaceAllocator *aAllocator);
+  ~DeprecatedSharedRGBImage();
 
-  static already_AddRefed<SharedRGBImage> Create(ImageContainer* aImageContainer,
+  static already_AddRefed<DeprecatedSharedRGBImage> Create(ImageContainer* aImageContainer,
                                                  nsIntSize aSize,
                                                  gfxImageFormat aImageFormat);
   uint8_t *GetBuffer();
 
   gfxIntSize GetSize();
   size_t GetBufferSize();
 
   static uint8_t BytesPerPixel(gfxImageFormat aImageFormat);
   already_AddRefed<gfxASurface> GetAsSurface();
 
   /**
    * 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 SharedRGBImage.
+   * 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
-   * SharedRGBImage).
+   * DeprecatedSharedRGBImage).
    */
   bool DropToSurfaceDescriptor(SurfaceDescriptor& aResult);
 
   /**
-   * Returns a SharedRGBImage* iff the descriptor was initialized with
+   * Returns a DeprecatedSharedRGBImage* iff the descriptor was initialized with
    * ToSurfaceDescriptor.
    */
-  static SharedRGBImage* FromSurfaceDescriptor(const SurfaceDescriptor& aDescriptor);
+  static DeprecatedSharedRGBImage* FromSurfaceDescriptor(const SurfaceDescriptor& aDescriptor);
 
 private:
   bool AllocateBuffer(nsIntSize aSize, gfxImageFormat aImageFormat);
 
   gfxIntSize mSize;
   gfxImageFormat mImageFormat;
   ISurfaceAllocator* mSurfaceAllocator;
 
--- a/gfx/layers/opengl/TextureHostOGL.cpp
+++ b/gfx/layers/opengl/TextureHostOGL.cpp
@@ -775,17 +775,17 @@ GrallocDeprecatedTextureHostOGL::SwapTex
   mFormat = SurfaceFormatForAndroidPixelFormat(mGraphicBuffer->getPixelFormat(),
                                                mIsRBSwapped);
 
   mTextureTarget = TextureTargetForAndroidPixelFormat(mGraphicBuffer->getPixelFormat());
 
   DeleteTextures();
 
   // only done for hacky fix in gecko 23 for bug 862324.
-  // Doing this in SetBuffer is not enough, as ImageHostBuffered::SwapTextures can
+  // Doing this in SetBuffer is not enough, as DeprecatedImageHostBuffered::SwapTextures can
   // change the value of *mBuffer without calling SetBuffer again.
   RegisterDeprecatedTextureHostAtGrallocBufferActor(this, aImage);
 }
 
 gl::GLContext*
 GrallocDeprecatedTextureHostOGL::gl() const
 {
   return mCompositor ? mCompositor->gl() : nullptr;