зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1500733 - Remove ImageBitmap.mappedDataLength, r=aosmond
This commit is contained in:
Родитель
39a76c5462
Коммит
be09783aca
|
@ -1549,21 +1549,6 @@ ImageBitmap::FindOptimalFormat(const Optional<Sequence<ImageBitmapFormat>>& aPos
|
|||
}
|
||||
}
|
||||
|
||||
int32_t
|
||||
ImageBitmap::MappedDataLength(ImageBitmapFormat aFormat, ErrorResult& aRv)
|
||||
{
|
||||
if (!mDataWrapper) {
|
||||
aRv.Throw(NS_ERROR_NOT_AVAILABLE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (aFormat == mDataWrapper->GetFormat()) {
|
||||
return mDataWrapper->GetBufferLength();
|
||||
} else {
|
||||
return CalculateImageBufferSize(aFormat, Width(), Height());
|
||||
}
|
||||
}
|
||||
|
||||
size_t
|
||||
ImageBitmap::GetAllocatedSize() const
|
||||
{
|
||||
|
|
|
@ -153,9 +153,6 @@ public:
|
|||
FindOptimalFormat(const Optional<Sequence<ImageBitmapFormat>>& aPossibleFormats,
|
||||
ErrorResult& aRv);
|
||||
|
||||
int32_t
|
||||
MappedDataLength(ImageBitmapFormat aFormat, ErrorResult& aRv);
|
||||
|
||||
size_t GetAllocatedSize() const;
|
||||
|
||||
void OnShutdown();
|
||||
|
|
|
@ -2730,16 +2730,6 @@ GetChannelCountOfImageFormat(ImageBitmapFormat aFormat)
|
|||
return format->GetChannelCount();
|
||||
}
|
||||
|
||||
uint32_t
|
||||
CalculateImageBufferSize(ImageBitmapFormat aFormat,
|
||||
uint32_t aWidth, uint32_t aHeight)
|
||||
{
|
||||
UtilsUniquePtr format = Utils::GetUtils(aFormat);
|
||||
MOZ_ASSERT(format, "Cannot get a valid ImageBitmapFormatUtils instance.");
|
||||
|
||||
return format->NeededBufferSize(aWidth, aHeight);
|
||||
}
|
||||
|
||||
UniquePtr<ImagePixelLayout>
|
||||
CopyAndConvertImageData(ImageBitmapFormat aSrcFormat,
|
||||
const uint8_t* aSrcBuffer,
|
||||
|
|
|
@ -48,14 +48,6 @@ CreatePixelLayoutFromPlanarYCbCrData(const layers::PlanarYCbCrData* aData);
|
|||
uint8_t
|
||||
GetChannelCountOfImageFormat(ImageBitmapFormat aFormat);
|
||||
|
||||
/*
|
||||
* Get the needed buffer size to store the image data in the given
|
||||
* ImageBitmapFormat with the given width and height.
|
||||
*/
|
||||
uint32_t
|
||||
CalculateImageBufferSize(ImageBitmapFormat aFormat,
|
||||
uint32_t aWidth, uint32_t aHeight);
|
||||
|
||||
/*
|
||||
* This function always copies the image data in _aSrcBuffer_ into _aDstBuffer_
|
||||
* and it also performs color conversion if the _aSrcFormat_ and the
|
||||
|
|
|
@ -397,6 +397,4 @@ typedef sequence<ChannelPixelLayout> ImagePixelLayout;
|
|||
partial interface ImageBitmap {
|
||||
[Throws, Func="mozilla::dom::DOMPrefs::canvas_imagebitmap_extensions_enabled"]
|
||||
ImageBitmapFormat findOptimalFormat (optional sequence<ImageBitmapFormat> aPossibleFormats);
|
||||
[Throws, Func="mozilla::dom::DOMPrefs::canvas_imagebitmap_extensions_enabled"]
|
||||
long mappedDataLength (ImageBitmapFormat aFormat);
|
||||
};
|
||||
|
|
Загрузка…
Ссылка в новой задаче