Issue #2657 - Remove -moz-samplesize resize-decoding for low-vram mobiles

Resolves #2657
This commit is contained in:
Moonchild 2024-11-20 14:10:10 +01:00 committed by roytam1
commit ef5f052d97
18 changed files with 13 additions and 193 deletions

View file

@ -334,19 +334,6 @@ bool nsMediaFragmentURIParser::ParseXYWH(nsDependentSubstring aString)
return false;
}
bool nsMediaFragmentURIParser::ParseMozSampleSize(nsDependentSubstring aString)
{
int32_t sampleSize;
// Read and validate coordinates.
if (ParseInteger(aString, sampleSize) && sampleSize > 0) {
mSampleSize.emplace(sampleSize);
return true;
}
return false;
}
void nsMediaFragmentURIParser::Parse(nsACString& aRef)
{
// Create an array of possibly-invalid media fragments.
@ -367,9 +354,9 @@ void nsMediaFragmentURIParser::Parse(nsACString& aRef)
}
// Parse the media fragment values.
bool gotTemporal = false, gotSpatial = false, gotSampleSize = false;
bool gotTemporal = false, gotSpatial = false;
for (int i = fragments.Length() - 1 ; i >= 0 ; --i) {
if (gotTemporal && gotSpatial && gotSampleSize) {
if (gotTemporal && gotSpatial) {
// We've got one of each possible type. No need to look at the rest.
break;
} else if (!gotTemporal && fragments[i].first.EqualsLiteral("t")) {
@ -378,9 +365,6 @@ void nsMediaFragmentURIParser::Parse(nsACString& aRef)
} else if (!gotSpatial && fragments[i].first.EqualsLiteral("xywh")) {
nsAutoString value = NS_ConvertUTF8toUTF16(fragments[i].second);
gotSpatial = ParseXYWH(nsDependentSubstring(value, 0));
} else if (!gotSampleSize && fragments[i].first.EqualsLiteral("-moz-samplesize")) {
nsAutoString value = NS_ConvertUTF8toUTF16(fragments[i].second);
gotSampleSize = ParseMozSampleSize(nsDependentSubstring(value, 0));
}
}
}