diff --git a/dom/canvas/ImageBitmap.cpp b/dom/canvas/ImageBitmap.cpp index d7df938aaa..2db97dd6b2 100644 --- a/dom/canvas/ImageBitmap.cpp +++ b/dom/canvas/ImageBitmap.cpp @@ -1561,43 +1561,5 @@ ImageBitmap::ExtensionsEnabled(JSContext* aCx, JSObject*) } } -// ImageBitmap extensions. -ImageBitmapFormat -ImageBitmap::FindOptimalFormat(const Optional>& aPossibleFormats, - ErrorResult& aRv) -{ - MOZ_ASSERT(mDataWrapper, "No ImageBitmapFormatUtils functionalities."); - - ImageBitmapFormat platformFormat = mDataWrapper->GetFormat(); - - if (!aPossibleFormats.WasPassed() || - aPossibleFormats.Value().Contains(platformFormat)) { - return platformFormat; - } else { - // If no matching is found, FindBestMatchingFromat() returns - // ImageBitmapFormat::EndGuard_ and we throw an exception. - ImageBitmapFormat optimalFormat = - FindBestMatchingFromat(platformFormat, aPossibleFormats.Value()); - - if (optimalFormat == ImageBitmapFormat::EndGuard_) { - aRv.Throw(NS_ERROR_NOT_IMPLEMENTED); - } - - return optimalFormat; - } -} - -int32_t -ImageBitmap::MappedDataLength(ImageBitmapFormat aFormat, ErrorResult& aRv) -{ - MOZ_ASSERT(mDataWrapper, "No ImageBitmapFormatUtils functionalities."); - - if (aFormat == mDataWrapper->GetFormat()) { - return mDataWrapper->GetBufferLength(); - } else { - return CalculateImageBufferSize(aFormat, Width(), Height()); - } -} - } // namespace dom } // namespace mozilla diff --git a/dom/canvas/ImageBitmap.h b/dom/canvas/ImageBitmap.h index efd339f112..77fc9e1aa8 100644 --- a/dom/canvas/ImageBitmap.h +++ b/dom/canvas/ImageBitmap.h @@ -153,14 +153,6 @@ public: return mWriteOnly; } - // Mozilla Extensions - ImageBitmapFormat - FindOptimalFormat(const Optional>& aPossibleFormats, - ErrorResult& aRv); - - int32_t - MappedDataLength(ImageBitmapFormat aFormat, ErrorResult& aRv); - protected: /* diff --git a/dom/canvas/ImageBitmapUtils.cpp b/dom/canvas/ImageBitmapUtils.cpp index d6f249468f..72b73729cd 100644 --- a/dom/canvas/ImageBitmapUtils.cpp +++ b/dom/canvas/ImageBitmapUtils.cpp @@ -2728,16 +2728,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 dfde52e07b..24fb201804 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 14e0c1165b..73f61f59ed 100644 --- a/dom/webidl/ImageBitmap.webidl +++ b/dom/webidl/ImageBitmap.webidl @@ -394,9 +394,3 @@ dictionary ChannelPixelLayout { typedef sequence ImagePixelLayout; -partial interface ImageBitmap { - [Throws, Func="mozilla::dom::ImageBitmap::ExtensionsEnabled"] - ImageBitmapFormat findOptimalFormat (optional sequence aPossibleFormats); - [Throws, Func="mozilla::dom::ImageBitmap::ExtensionsEnabled"] - long mappedDataLength (ImageBitmapFormat aFormat); -};