Bug 1500733 - Remove ImageBitmap.mappedDataLength, r=aosmond

This commit is contained in:
Andrea Marchesini 2018-10-23 23:35:44 +02:00
Родитель 39a76c5462
Коммит be09783aca
5 изменённых файлов: 0 добавлений и 38 удалений

Просмотреть файл

@ -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 size_t
ImageBitmap::GetAllocatedSize() const ImageBitmap::GetAllocatedSize() const
{ {

Просмотреть файл

@ -153,9 +153,6 @@ public:
FindOptimalFormat(const Optional<Sequence<ImageBitmapFormat>>& aPossibleFormats, FindOptimalFormat(const Optional<Sequence<ImageBitmapFormat>>& aPossibleFormats,
ErrorResult& aRv); ErrorResult& aRv);
int32_t
MappedDataLength(ImageBitmapFormat aFormat, ErrorResult& aRv);
size_t GetAllocatedSize() const; size_t GetAllocatedSize() const;
void OnShutdown(); void OnShutdown();

Просмотреть файл

@ -2730,16 +2730,6 @@ GetChannelCountOfImageFormat(ImageBitmapFormat aFormat)
return format->GetChannelCount(); 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> UniquePtr<ImagePixelLayout>
CopyAndConvertImageData(ImageBitmapFormat aSrcFormat, CopyAndConvertImageData(ImageBitmapFormat aSrcFormat,
const uint8_t* aSrcBuffer, const uint8_t* aSrcBuffer,

Просмотреть файл

@ -48,14 +48,6 @@ CreatePixelLayoutFromPlanarYCbCrData(const layers::PlanarYCbCrData* aData);
uint8_t uint8_t
GetChannelCountOfImageFormat(ImageBitmapFormat aFormat); 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_ * This function always copies the image data in _aSrcBuffer_ into _aDstBuffer_
* and it also performs color conversion if the _aSrcFormat_ and the * and it also performs color conversion if the _aSrcFormat_ and the

Просмотреть файл

@ -397,6 +397,4 @@ typedef sequence<ChannelPixelLayout> ImagePixelLayout;
partial interface ImageBitmap { partial interface ImageBitmap {
[Throws, Func="mozilla::dom::DOMPrefs::canvas_imagebitmap_extensions_enabled"] [Throws, Func="mozilla::dom::DOMPrefs::canvas_imagebitmap_extensions_enabled"]
ImageBitmapFormat findOptimalFormat (optional sequence<ImageBitmapFormat> aPossibleFormats); ImageBitmapFormat findOptimalFormat (optional sequence<ImageBitmapFormat> aPossibleFormats);
[Throws, Func="mozilla::dom::DOMPrefs::canvas_imagebitmap_extensions_enabled"]
long mappedDataLength (ImageBitmapFormat aFormat);
}; };