mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-27 01:27:30 +09:00
Issue #2546 - Part 4: Remove mappedDataLength and findOptimalFormat
This commit is contained in:
parent
1bc0eda791
commit
b1e5955ceb
5 changed files with 0 additions and 70 deletions
|
|
@ -1561,43 +1561,5 @@ ImageBitmap::ExtensionsEnabled(JSContext* aCx, JSObject*)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ImageBitmap extensions.
|
|
||||||
ImageBitmapFormat
|
|
||||||
ImageBitmap::FindOptimalFormat(const Optional<Sequence<ImageBitmapFormat>>& 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 dom
|
||||||
} // namespace mozilla
|
} // namespace mozilla
|
||||||
|
|
|
||||||
|
|
@ -153,14 +153,6 @@ public:
|
||||||
return mWriteOnly;
|
return mWriteOnly;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Mozilla Extensions
|
|
||||||
ImageBitmapFormat
|
|
||||||
FindOptimalFormat(const Optional<Sequence<ImageBitmapFormat>>& aPossibleFormats,
|
|
||||||
ErrorResult& aRv);
|
|
||||||
|
|
||||||
int32_t
|
|
||||||
MappedDataLength(ImageBitmapFormat aFormat, ErrorResult& aRv);
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
||||||
|
|
@ -2728,16 +2728,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
|
||||||
|
|
|
||||||
|
|
@ -394,9 +394,3 @@ dictionary ChannelPixelLayout {
|
||||||
|
|
||||||
typedef sequence<ChannelPixelLayout> ImagePixelLayout;
|
typedef sequence<ChannelPixelLayout> ImagePixelLayout;
|
||||||
|
|
||||||
partial interface ImageBitmap {
|
|
||||||
[Throws, Func="mozilla::dom::ImageBitmap::ExtensionsEnabled"]
|
|
||||||
ImageBitmapFormat findOptimalFormat (optional sequence<ImageBitmapFormat> aPossibleFormats);
|
|
||||||
[Throws, Func="mozilla::dom::ImageBitmap::ExtensionsEnabled"]
|
|
||||||
long mappedDataLength (ImageBitmapFormat aFormat);
|
|
||||||
};
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue