Bug 1138967 - Part 1: Remove ISharedImage. r=nical

This commit is contained in:
Matt Woodrow 2015-03-19 10:15:38 +13:00
parent 65b585e91e
commit e3d30c7898
8 changed files with 13 additions and 40 deletions

View File

@ -369,7 +369,7 @@ AndroidMediaReader::ImageBufferCallback::operator()(size_t aWidth, size_t aHeigh
}
mImage = image;
return image->AsSharedImage()->GetBuffer();
return image->GetBuffer();
case MPAPI::I420:
return CreateI420Image(aWidth, aHeight);
default:

View File

@ -18,8 +18,7 @@ namespace layers {
// passed into SetData(), so that it can be accessed from other D3D devices.
// This class also manages the synchronization of the copy, to ensure the
// resource is ready to use.
class D3D9SurfaceImage : public Image
, public ISharedImage {
class D3D9SurfaceImage : public Image {
public:
struct Data {
@ -32,8 +31,6 @@ public:
D3D9SurfaceImage();
virtual ~D3D9SurfaceImage();
virtual ISharedImage* AsSharedImage() MOZ_OVERRIDE { return this; }
// Copies the surface into a sharable texture's surface, and initializes
// the image.
HRESULT SetData(const Data& aData);
@ -46,7 +43,6 @@ public:
virtual TemporaryRef<gfx::SourceSurface> GetAsSourceSurface() MOZ_OVERRIDE;
virtual TextureClient* GetTextureClient(CompositableClient* aClient) MOZ_OVERRIDE;
virtual uint8_t* GetBuffer() MOZ_OVERRIDE { return nullptr; }
virtual bool IsValid() MOZ_OVERRIDE;

View File

@ -44,7 +44,6 @@ class GrallocTextureClientOGL;
* mPicSize, not mYSize or mCbCrSize.
*/
class GrallocImage : public PlanarYCbCrImage
, public ISharedImage
{
typedef PlanarYCbCrData Data;
static int32_t sColorIdMap[];
@ -93,8 +92,6 @@ public:
virtual bool IsValid() { return !!mTextureClient; }
virtual ISharedImage* AsSharedImage() MOZ_OVERRIDE { return this; }
virtual TextureClient* GetTextureClient(CompositableClient* aClient) MOZ_OVERRIDE;
virtual GrallocImage* AsGrallocImage() MOZ_OVERRIDE

View File

@ -115,18 +115,6 @@ protected:
ImageBackendData() {}
};
// sadly we'll need this until we get rid of Deprected image classes
class ISharedImage {
public:
virtual uint8_t* GetBuffer() = 0;
/**
* For use with the CompositableClient only (so that the later can
* synchronize the TextureClient with the TextureHost).
*/
virtual TextureClient* GetTextureClient(CompositableClient* aClient) = 0;
};
/**
* A class representing a buffer of pixel data. The data can be in one
* of various formats including YCbCr.
@ -145,8 +133,6 @@ class Image {
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(Image)
public:
virtual ISharedImage* AsSharedImage() { return nullptr; }
ImageFormat GetFormat() { return mFormat; }
void* GetImplData() { return mImplData; }
@ -175,6 +161,14 @@ public:
virtual bool IsValid() { return true; }
virtual uint8_t* GetBuffer() { return nullptr; }
/**
* For use with the CompositableClient only (so that the later can
* synchronize the TextureClient with the TextureHost).
*/
virtual TextureClient* GetTextureClient(CompositableClient* aClient) { return nullptr; }
protected:
Image(void* aImplData, ImageFormat aFormat) :
mImplData(aImplData),
@ -793,8 +787,7 @@ protected:
* device output color space. This class is very simple as all backends
* have to know about how to deal with drawing a cairo image.
*/
class CairoImage MOZ_FINAL : public Image,
public ISharedImage {
class CairoImage MOZ_FINAL : public Image {
public:
struct Data {
gfx::IntSize mSize;
@ -817,8 +810,6 @@ public:
return mSourceSurface.get();
}
virtual ISharedImage* AsSharedImage() MOZ_OVERRIDE { return this; }
virtual uint8_t* GetBuffer() MOZ_OVERRIDE { return nullptr; }
virtual TextureClient* GetTextureClient(CompositableClient* aClient) MOZ_OVERRIDE;
virtual gfx::IntSize GetSize() MOZ_OVERRIDE { return mSize; }

View File

@ -15,8 +15,7 @@ namespace mozilla {
namespace layers {
class MacIOSurfaceImage : public Image,
public ISharedImage {
class MacIOSurfaceImage : public Image {
public:
void SetSurface(MacIOSurface* aSurface) { mSurface = aSurface; }
MacIOSurface* GetSurface() { return mSurface; }
@ -25,12 +24,9 @@ public:
return gfx::IntSize(mSurface->GetDevicePixelWidth(), mSurface->GetDevicePixelHeight());
}
virtual ISharedImage* AsSharedImage() MOZ_OVERRIDE { return this; }
virtual TemporaryRef<gfx::SourceSurface> GetAsSourceSurface() MOZ_OVERRIDE;
virtual TextureClient* GetTextureClient(CompositableClient* aClient) MOZ_OVERRIDE;
virtual uint8_t* GetBuffer() MOZ_OVERRIDE { return nullptr; }
MacIOSurfaceImage() : Image(nullptr, ImageFormat::MAC_IOSURFACE) {}

View File

@ -158,9 +158,7 @@ ImageClientSingle::UpdateImage(ImageContainer* aContainer, uint32_t aContentFlag
return true;
}
RefPtr<TextureClient> texture = image->AsSharedImage()
? image->AsSharedImage()->GetTextureClient(this)
: nullptr;
RefPtr<TextureClient> texture = image->GetTextureClient(this);
AutoRemoveTexture autoRemoveTexture(this);
if (texture != mFrontBuffer) {

View File

@ -25,7 +25,6 @@ class SurfaceDescriptor;
class TextureClient;
class SharedPlanarYCbCrImage : public PlanarYCbCrImage
, public ISharedImage
{
public:
explicit SharedPlanarYCbCrImage(ImageClient* aCompositable);
@ -34,7 +33,6 @@ protected:
~SharedPlanarYCbCrImage();
public:
virtual ISharedImage* AsSharedImage() MOZ_OVERRIDE { return this; }
virtual TextureClient* GetTextureClient(CompositableClient* aClient) MOZ_OVERRIDE;
virtual uint8_t* GetBuffer() MOZ_OVERRIDE;

View File

@ -37,7 +37,6 @@ already_AddRefed<Image> CreateSharedRGBImage(ImageContainer* aImageContainer,
* It is assumed that the image width and stride are equal
*/
class SharedRGBImage : public Image
, public ISharedImage
{
public:
explicit SharedRGBImage(ImageClient* aCompositable);
@ -46,8 +45,6 @@ protected:
~SharedRGBImage();
public:
virtual ISharedImage* AsSharedImage() MOZ_OVERRIDE { return this; }
virtual TextureClient* GetTextureClient(CompositableClient* aClient) MOZ_OVERRIDE;
virtual uint8_t* GetBuffer() MOZ_OVERRIDE;