diff --git a/dom/canvas/ImageBitmap.cpp b/dom/canvas/ImageBitmap.cpp index f0c55a23fedc..74a7bae447f0 100644 --- a/dom/canvas/ImageBitmap.cpp +++ b/dom/canvas/ImageBitmap.cpp @@ -1549,21 +1549,6 @@ ImageBitmap::FindOptimalFormat(const Optional>& 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 { diff --git a/dom/canvas/ImageBitmap.h b/dom/canvas/ImageBitmap.h index e5ea0d3b7341..389fb10fa7d1 100644 --- a/dom/canvas/ImageBitmap.h +++ b/dom/canvas/ImageBitmap.h @@ -153,9 +153,6 @@ public: FindOptimalFormat(const Optional>& aPossibleFormats, ErrorResult& aRv); - int32_t - MappedDataLength(ImageBitmapFormat aFormat, ErrorResult& aRv); - size_t GetAllocatedSize() const; void OnShutdown(); diff --git a/dom/canvas/ImageBitmapUtils.cpp b/dom/canvas/ImageBitmapUtils.cpp index 28e76bedc30b..9c827382e32e 100644 --- a/dom/canvas/ImageBitmapUtils.cpp +++ b/dom/canvas/ImageBitmapUtils.cpp @@ -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 CopyAndConvertImageData(ImageBitmapFormat aSrcFormat, const uint8_t* aSrcBuffer, diff --git a/dom/canvas/ImageBitmapUtils.h b/dom/canvas/ImageBitmapUtils.h index 39be43d8ae54..9e86fadf6af2 100644 --- a/dom/canvas/ImageBitmapUtils.h +++ b/dom/canvas/ImageBitmapUtils.h @@ -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 diff --git a/dom/webidl/ImageBitmap.webidl b/dom/webidl/ImageBitmap.webidl index 5d91a64686b1..edc07c2a50d5 100644 --- a/dom/webidl/ImageBitmap.webidl +++ b/dom/webidl/ImageBitmap.webidl @@ -397,6 +397,4 @@ typedef sequence ImagePixelLayout; partial interface ImageBitmap { [Throws, Func="mozilla::dom::DOMPrefs::canvas_imagebitmap_extensions_enabled"] ImageBitmapFormat findOptimalFormat (optional sequence aPossibleFormats); - [Throws, Func="mozilla::dom::DOMPrefs::canvas_imagebitmap_extensions_enabled"] - long mappedDataLength (ImageBitmapFormat aFormat); };