зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1215089 - P6: Remove dead code. r=mattwoodrow
The method isn't called and the comments referring to it are no longer applicable. MozReview-Commit-ID: 2FFWhj7wzht --HG-- extra : rebase_source : 5987c52a2a220185a61a45d18a6229aa7e5d8ea3
This commit is contained in:
Родитель
0fc33ae81a
Коммит
3828ad5fbe
|
@ -607,7 +607,7 @@ PlanarYCbCrImage::GetOffscreenFormat()
|
|||
}
|
||||
|
||||
bool
|
||||
PlanarYCbCrImage::AdoptData(const Data &aData)
|
||||
PlanarYCbCrImage::AdoptData(const Data& aData)
|
||||
{
|
||||
mData = aData;
|
||||
mSize = aData.mPicSize;
|
||||
|
@ -615,18 +615,6 @@ PlanarYCbCrImage::AdoptData(const Data &aData)
|
|||
return true;
|
||||
}
|
||||
|
||||
uint8_t*
|
||||
RecyclingPlanarYCbCrImage::AllocateAndGetNewBuffer(uint32_t aSize)
|
||||
{
|
||||
// get new buffer
|
||||
mBuffer = AllocateBuffer(aSize);
|
||||
if (mBuffer) {
|
||||
// update buffer size
|
||||
mBufferSize = aSize;
|
||||
}
|
||||
return mBuffer.get();
|
||||
}
|
||||
|
||||
already_AddRefed<gfx::SourceSurface>
|
||||
PlanarYCbCrImage::GetAsSourceSurface()
|
||||
{
|
||||
|
|
|
@ -815,18 +815,9 @@ public:
|
|||
virtual bool CopyData(const Data& aData) = 0;
|
||||
|
||||
/**
|
||||
* This doesn't make a copy of the data buffers. Can be used when mBuffer is
|
||||
* pre allocated with AllocateAndGetNewBuffer(size) and then AdoptData is
|
||||
* called to only update the picture size, planes etc. fields in mData.
|
||||
* The GStreamer media backend uses this to decode into PlanarYCbCrImage(s)
|
||||
* directly.
|
||||
* This doesn't make a copy of the data buffers.
|
||||
*/
|
||||
virtual bool AdoptData(const Data &aData);
|
||||
|
||||
/**
|
||||
* This allocates and returns a new buffer
|
||||
*/
|
||||
virtual uint8_t* AllocateAndGetNewBuffer(uint32_t aSize) = 0;
|
||||
virtual bool AdoptData(const Data& aData);
|
||||
|
||||
/**
|
||||
* Ask this Image to not convert YUV to RGB during SetData, and make
|
||||
|
@ -882,7 +873,6 @@ public:
|
|||
explicit RecyclingPlanarYCbCrImage(BufferRecycleBin *aRecycleBin) : mRecycleBin(aRecycleBin) {}
|
||||
virtual ~RecyclingPlanarYCbCrImage() override;
|
||||
virtual bool CopyData(const Data& aData) override;
|
||||
virtual uint8_t* AllocateAndGetNewBuffer(uint32_t aSize) override;
|
||||
virtual size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override;
|
||||
protected:
|
||||
|
||||
|
|
|
@ -96,47 +96,9 @@ SharedPlanarYCbCrImage::CopyData(const PlanarYCbCrData& aData)
|
|||
return true;
|
||||
}
|
||||
|
||||
// needs to be overriden because the parent class sets mBuffer which we
|
||||
// do not want to happen.
|
||||
uint8_t*
|
||||
SharedPlanarYCbCrImage::AllocateAndGetNewBuffer(uint32_t aSize)
|
||||
{
|
||||
MOZ_ASSERT(!mTextureClient, "This image already has allocated data");
|
||||
size_t size = ImageDataSerializer::ComputeYCbCrBufferSize(aSize);
|
||||
if (!size) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// XXX Add YUVColorSpace handling. Use YUVColorSpace::BT601 for now.
|
||||
mTextureClient = TextureClient::CreateForYCbCrWithBufferSize(mCompositable->GetForwarder(),
|
||||
size,
|
||||
YUVColorSpace::BT601,
|
||||
mCompositable->GetTextureFlags());
|
||||
|
||||
// get new buffer _without_ setting mBuffer.
|
||||
if (!mTextureClient) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// update buffer size
|
||||
mBufferSize = size;
|
||||
|
||||
MappedYCbCrTextureData mapped;
|
||||
if (mTextureClient->BorrowMappedYCbCrData(mapped)) {
|
||||
// The caller expects a pointer to the beginning of the writable part of the
|
||||
// buffer which is where the y channel starts by default.
|
||||
return mapped.y.data;
|
||||
} else {
|
||||
MOZ_CRASH("GFX: Cannot borrow mapped YCbCr data");
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
SharedPlanarYCbCrImage::AdoptData(const Data &aData)
|
||||
SharedPlanarYCbCrImage::AdoptData(const Data& aData)
|
||||
{
|
||||
// AdoptData is used to update YUV plane offsets without (re)allocating
|
||||
// memory previously allocated with AllocateAndGetNewBuffer().
|
||||
|
||||
MOZ_ASSERT(mTextureClient, "This Image should have already allocated data");
|
||||
if (!mTextureClient) {
|
||||
return false;
|
||||
|
|
|
@ -35,10 +35,9 @@ public:
|
|||
|
||||
virtual already_AddRefed<gfx::SourceSurface> GetAsSourceSurface() override;
|
||||
virtual bool CopyData(const PlanarYCbCrData& aData) override;
|
||||
virtual bool AdoptData(const Data &aData) override;
|
||||
virtual bool AdoptData(const Data& aData) override;
|
||||
|
||||
virtual bool Allocate(PlanarYCbCrData& aData);
|
||||
virtual uint8_t* AllocateAndGetNewBuffer(uint32_t aSize) override;
|
||||
|
||||
virtual bool IsValid() override;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче