Bug 858914 - Mark some Image related classes deprecated. r=jrmuizel DONTBUILD

This commit is contained in:
Nicolas Silva 2013-07-24 18:08:35 +02:00
parent 9f9eaddba9
commit 5d2089d328
15 changed files with 117 additions and 114 deletions

View File

@ -360,10 +360,10 @@ MediaPluginReader::ImageBufferCallback::operator()(size_t aWidth, size_t aHeight
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;

View File

@ -34,6 +34,7 @@ namespace layers {
class ImageClient;
class SharedPlanarYCbCrImage;
class DeprecatedSharedPlanarYCbCrImage;
struct ImageBackendData
{
@ -720,6 +721,7 @@ public:
PlanarYCbCrImage(BufferRecycleBin *aRecycleBin);
virtual SharedPlanarYCbCrImage *AsSharedPlanarYCbCrImage() { return nullptr; }
virtual DeprecatedSharedPlanarYCbCrImage *AsDeprecatedSharedPlanarYCbCrImage() { return nullptr; }
protected:
/**

View File

@ -24,7 +24,7 @@ enum ImageFormat {
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.
*/

View File

@ -28,10 +28,10 @@ ImageClient::CreateImageClient(CompositableType aCompositableHostType,
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);
@ -66,9 +66,9 @@ ImageClient::UpdatePictureRect(nsIntRect aRect)
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)
{
@ -76,7 +76,7 @@ ImageClientSingle::ImageClientSingle(CompositableForwarder* aFwd,
}
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
@ -88,7 +88,7 @@ ImageClientSingle::EnsureDeprecatedTextureClient(DeprecatedTextureClientType aTy
}
bool
ImageClientSingle::UpdateImage(ImageContainer* aContainer,
DeprecatedImageClientSingle::UpdateImage(ImageContainer* aContainer,
uint32_t aContentFlags)
{
AutoLockImage autoLock(aContainer);
@ -106,11 +106,11 @@ ImageClientSingle::UpdateImage(ImageContainer* aContainer,
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;
}
@ -147,7 +147,7 @@ ImageClientSingle::UpdateImage(ImageContainer* aContainer,
AutoLockDeprecatedTextureClient lock(mDeprecatedTextureClient);
SurfaceDescriptor desc;
if (!static_cast<SharedRGBImage*>(image)->ToSurfaceDescriptor(desc)) {
if (!static_cast<DeprecatedSharedRGBImage*>(image)->ToSurfaceDescriptor(desc)) {
return false;
}
mDeprecatedTextureClient->SetDescriptor(desc);
@ -209,7 +209,7 @@ ImageClientSingle::UpdateImage(ImageContainer* aContainer,
}
void
ImageClientSingle::Updated()
DeprecatedImageClientSingle::Updated()
{
mForwarder->UpdateTexture(this, 1, mDeprecatedTextureClient->GetDescriptor());
}
@ -247,10 +247,10 @@ ImageClient::CreateImage(const uint32_t *aFormats,
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:

View File

@ -72,12 +72,12 @@ protected:
* 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);

View File

@ -161,7 +161,7 @@ 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();

View File

@ -54,10 +54,10 @@ 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);

View File

@ -17,7 +17,7 @@ using namespace gfx;
namespace layers {
void
ImageHostSingle::SetCompositor(Compositor* aCompositor) {
DeprecatedImageHostSingle::SetCompositor(Compositor* aCompositor) {
CompositableHost::SetCompositor(aCompositor);
if (mDeprecatedTextureHost) {
mDeprecatedTextureHost->SetCompositor(aCompositor);
@ -25,10 +25,10 @@ ImageHostSingle::SetCompositor(Compositor* 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() &&
@ -43,10 +43,10 @@ ImageHostSingle::EnsureDeprecatedTextureHost(TextureIdentifier aTextureId,
}
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,
@ -61,14 +61,14 @@ ImageHostSingle::MakeDeprecatedTextureHost(TextureIdentifier aTextureId,
}
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");
@ -138,10 +138,10 @@ ImageHostSingle::Composite(EffectChain& aEffectChain,
#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=", "]");
@ -155,8 +155,8 @@ ImageHostSingle::PrintInfo(nsACString& aTo, const char* aPrefix)
#endif
bool
ImageHostBuffered::Update(const SurfaceDescriptor& aImage,
SurfaceDescriptor* aResult) {
DeprecatedImageHostBuffered::Update(const SurfaceDescriptor& aImage,
SurfaceDescriptor* aResult) {
if (!GetDeprecatedTextureHost()) {
*aResult = aImage;
return false;
@ -166,24 +166,24 @@ ImageHostBuffered::Update(const SurfaceDescriptor& aImage,
}
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;

View File

@ -37,10 +37,10 @@ protected:
};
// 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)
@ -115,11 +115,11 @@ protected:
// 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,

View File

@ -169,12 +169,13 @@ bool IsSurfaceDescriptorOwned(const SurfaceDescriptor& aDescriptor)
}
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;

View File

@ -13,8 +13,8 @@ namespace layers {
using namespace mozilla::ipc;
SharedPlanarYCbCrImage::~SharedPlanarYCbCrImage() {
MOZ_COUNT_DTOR(SharedPlanarYCbCrImage);
DeprecatedSharedPlanarYCbCrImage::~DeprecatedSharedPlanarYCbCrImage() {
MOZ_COUNT_DTOR(DeprecatedSharedPlanarYCbCrImage);
if (mAllocated) {
SurfaceDescriptor desc;
@ -25,7 +25,7 @@ SharedPlanarYCbCrImage::~SharedPlanarYCbCrImage() {
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
@ -60,7 +60,7 @@ SharedPlanarYCbCrImage::SetData(const PlanarYCbCrImage::Data& aData)
// 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);
@ -76,7 +76,7 @@ SharedPlanarYCbCrImage::AllocateAndGetNewBuffer(uint32_t aSize)
void
SharedPlanarYCbCrImage::SetDataNoCopy(const Data &aData)
DeprecatedSharedPlanarYCbCrImage::SetDataNoCopy(const Data &aData)
{
mData = aData;
mSize = aData.mPicSize;
@ -86,7 +86,7 @@ SharedPlanarYCbCrImage::SetDataNoCopy(const Data &aData)
}
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();
@ -99,7 +99,7 @@ SharedPlanarYCbCrImage::AllocateBuffer(uint32_t aSize)
bool
SharedPlanarYCbCrImage::Allocate(PlanarYCbCrImage::Data& aData)
DeprecatedSharedPlanarYCbCrImage::Allocate(PlanarYCbCrImage::Data& aData)
{
NS_ABORT_IF_FALSE(!mAllocated, "This image already has allocated data");
@ -145,7 +145,7 @@ SharedPlanarYCbCrImage::Allocate(PlanarYCbCrImage::Data& aData)
}
bool
SharedPlanarYCbCrImage::ToSurfaceDescriptor(SurfaceDescriptor& aDesc) {
DeprecatedSharedPlanarYCbCrImage::ToSurfaceDescriptor(SurfaceDescriptor& aDesc) {
if (!mAllocated) {
return false;
}
@ -155,7 +155,7 @@ SharedPlanarYCbCrImage::ToSurfaceDescriptor(SurfaceDescriptor& aDesc) {
}
bool
SharedPlanarYCbCrImage::DropToSurfaceDescriptor(SurfaceDescriptor& aDesc) {
DeprecatedSharedPlanarYCbCrImage::DropToSurfaceDescriptor(SurfaceDescriptor& aDesc) {
if (!mAllocated) {
return false;
}
@ -165,8 +165,8 @@ SharedPlanarYCbCrImage::DropToSurfaceDescriptor(SurfaceDescriptor& aDesc) {
return true;
}
SharedPlanarYCbCrImage*
SharedPlanarYCbCrImage::FromSurfaceDescriptor(const SurfaceDescriptor& aDescriptor)
DeprecatedSharedPlanarYCbCrImage*
DeprecatedSharedPlanarYCbCrImage::FromSurfaceDescriptor(const SurfaceDescriptor& aDescriptor)
{
if (aDescriptor.type() != SurfaceDescriptor::TYCbCrImage) {
return nullptr;
@ -175,7 +175,7 @@ SharedPlanarYCbCrImage::FromSurfaceDescriptor(const SurfaceDescriptor& aDescript
if (ycbcr.owner() == 0) {
return nullptr;
}
return reinterpret_cast<SharedPlanarYCbCrImage*>(ycbcr.owner());
return reinterpret_cast<DeprecatedSharedPlanarYCbCrImage*>(ycbcr.owner());
}

View File

@ -8,27 +8,27 @@
#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;
}
@ -58,7 +58,7 @@ public:
/**
* 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);
@ -66,15 +66,15 @@ public:
* 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;

View File

@ -14,19 +14,19 @@
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;
@ -36,8 +36,8 @@ SharedRGBImage::~SharedRGBImage()
delete mShmem;
}
already_AddRefed<SharedRGBImage>
SharedRGBImage::Create(ImageContainer *aImageContainer,
already_AddRefed<DeprecatedSharedRGBImage>
DeprecatedSharedRGBImage::Create(ImageContainer *aImageContainer,
nsIntSize aSize,
gfxImageFormat aImageFormat)
{
@ -47,7 +47,7 @@ SharedRGBImage::Create(ImageContainer *aImageContainer,
"RGB formats supported only");
if (!aImageContainer) {
NS_WARNING("No ImageContainer to allocate SharedRGBImage");
NS_WARNING("No ImageContainer to allocate DeprecatedSharedRGBImage");
return nullptr;
}
@ -55,16 +55,16 @@ SharedRGBImage::Create(ImageContainer *aImageContainer,
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;
}
@ -72,25 +72,25 @@ SharedRGBImage::Create(ImageContainer *aImageContainer,
}
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");
@ -110,13 +110,13 @@ SharedRGBImage::AllocateBuffer(nsIntSize aSize, gfxImageFormat aImageFormat)
}
already_AddRefed<gfxASurface>
SharedRGBImage::GetAsSurface()
DeprecatedSharedRGBImage::GetAsSurface()
{
return nullptr;
}
bool
SharedRGBImage::ToSurfaceDescriptor(SurfaceDescriptor& aResult)
DeprecatedSharedRGBImage::ToSurfaceDescriptor(SurfaceDescriptor& aResult)
{
if (!mAllocated) {
return false;
@ -130,7 +130,7 @@ SharedRGBImage::ToSurfaceDescriptor(SurfaceDescriptor& aResult)
}
bool
SharedRGBImage::DropToSurfaceDescriptor(SurfaceDescriptor& aResult)
DeprecatedSharedRGBImage::DropToSurfaceDescriptor(SurfaceDescriptor& aResult)
{
if (!mAllocated) {
return false;
@ -144,8 +144,8 @@ SharedRGBImage::DropToSurfaceDescriptor(SurfaceDescriptor& aResult)
return true;
}
SharedRGBImage*
SharedRGBImage::FromSurfaceDescriptor(const SurfaceDescriptor& aDescriptor)
DeprecatedSharedRGBImage*
DeprecatedSharedRGBImage::FromSurfaceDescriptor(const SurfaceDescriptor& aDescriptor)
{
if (aDescriptor.type() != SurfaceDescriptor::TRGBImage) {
return nullptr;
@ -154,7 +154,7 @@ SharedRGBImage::FromSurfaceDescriptor(const SurfaceDescriptor& aDescriptor)
if (rgb.owner() == 0) {
return nullptr;
}
return reinterpret_cast<SharedRGBImage*>(rgb.owner());
return reinterpret_cast<DeprecatedSharedRGBImage*>(rgb.owner());
}

View File

@ -18,7 +18,7 @@ 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:
@ -26,10 +26,10 @@ public:
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();
@ -43,7 +43,7 @@ public:
/**
* 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);
@ -51,15 +51,15 @@ public:
* 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);

View File

@ -780,7 +780,7 @@ GrallocDeprecatedTextureHostOGL::SwapTexturesImpl(const SurfaceDescriptor& aImag
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);
}