Bug 1295899 - Implement DRIVER_BUILD_ID_LESS_THAN_OR_EQUAL. r=milan

--HG--
extra : rebase_source : fec2e63ceca2932883c6974ec96a16282c5029d7
This commit is contained in:
Chih-Yi Leu 2016-08-31 19:59:00 +02:00
Родитель 5f85932d39
Коммит 4a0eb17eaa
2 изменённых файлов: 8 добавлений и 0 удалений

Просмотреть файл

@ -66,6 +66,7 @@ enum VersionComparisonOp {
DRIVER_LESS_THAN, // driver < version
DRIVER_BUILD_ID_LESS_THAN, // driver build id < version
DRIVER_LESS_THAN_OR_EQUAL, // driver <= version
DRIVER_BUILD_ID_LESS_THAN_OR_EQUAL, // driver build id <= version
DRIVER_GREATER_THAN, // driver > version
DRIVER_GREATER_THAN_OR_EQUAL, // driver >= version
DRIVER_EQUAL, // driver == version

Просмотреть файл

@ -375,8 +375,12 @@ BlacklistComparatorToComparisonOp(const nsAString& op)
{
if (op.EqualsLiteral("LESS_THAN"))
return DRIVER_LESS_THAN;
else if (op.EqualsLiteral("BUILD_ID_LESS_THAN"))
return DRIVER_BUILD_ID_LESS_THAN;
else if (op.EqualsLiteral("LESS_THAN_OR_EQUAL"))
return DRIVER_LESS_THAN_OR_EQUAL;
else if (op.EqualsLiteral("BUILD_ID_LESS_THAN_OR_EQUAL"))
return DRIVER_BUILD_ID_LESS_THAN_OR_EQUAL;
else if (op.EqualsLiteral("GREATER_THAN"))
return DRIVER_GREATER_THAN;
else if (op.EqualsLiteral("GREATER_THAN_OR_EQUAL"))
@ -740,6 +744,9 @@ GfxInfoBase::FindBlocklistedDeviceInList(const nsTArray<GfxDriverInfo>& info,
case DRIVER_LESS_THAN_OR_EQUAL:
match = driverVersion <= info[i].mDriverVersion;
break;
case DRIVER_BUILD_ID_LESS_THAN_OR_EQUAL:
match = (driverVersion & 0xFFFF) <= info[i].mDriverVersion;
break;
case DRIVER_GREATER_THAN:
match = driverVersion > info[i].mDriverVersion;
break;