зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1500733 - Remove ImageBitmap.findOptimalFormat, r=aosmond
This commit is contained in:
Родитель
be09783aca
Коммит
b8f3de6ba0
|
@ -1520,35 +1520,6 @@ ImageBitmap::WriteStructuredClone(JSStructuredCloneWriter* aWriter,
|
|||
return true;
|
||||
}
|
||||
|
||||
// ImageBitmap extensions.
|
||||
ImageBitmapFormat
|
||||
ImageBitmap::FindOptimalFormat(const Optional<Sequence<ImageBitmapFormat>>& aPossibleFormats,
|
||||
ErrorResult& aRv)
|
||||
{
|
||||
if (!mDataWrapper) {
|
||||
aRv.Throw(NS_ERROR_NOT_AVAILABLE);
|
||||
return ImageBitmapFormat::EndGuard_;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
size_t
|
||||
ImageBitmap::GetAllocatedSize() const
|
||||
{
|
||||
|
|
|
@ -148,11 +148,6 @@ public:
|
|||
friend CreateImageBitmapFromBlobTask;
|
||||
friend CreateImageBitmapFromBlobWorkerTask;
|
||||
|
||||
// Mozilla Extensions
|
||||
ImageBitmapFormat
|
||||
FindOptimalFormat(const Optional<Sequence<ImageBitmapFormat>>& aPossibleFormats,
|
||||
ErrorResult& aRv);
|
||||
|
||||
size_t GetAllocatedSize() const;
|
||||
|
||||
void OnShutdown();
|
||||
|
|
|
@ -393,8 +393,3 @@ dictionary ChannelPixelLayout {
|
|||
};
|
||||
|
||||
typedef sequence<ChannelPixelLayout> ImagePixelLayout;
|
||||
|
||||
partial interface ImageBitmap {
|
||||
[Throws, Func="mozilla::dom::DOMPrefs::canvas_imagebitmap_extensions_enabled"]
|
||||
ImageBitmapFormat findOptimalFormat (optional sequence<ImageBitmapFormat> aPossibleFormats);
|
||||
};
|
||||
|
|
Загрузка…
Ссылка в новой задаче