[Libreoffice-commits] core.git: vcl/inc vcl/qa vcl/skia vcl/source
LuboÅ¡ LuÅák (via logerrit)
logerrit at kemper.freedesktop.org
Tue Sep 29 07:58:07 UTC 2020
vcl/inc/driverblocklist.hxx | 10 ++++++++--
vcl/qa/cppunit/blocklistparsertest.cxx | 9 +++++++++
vcl/qa/cppunit/test_blocklist_evaluate.xml | 12 ++++++++++--
vcl/skia/skia_denylist_vulkan.xml | 2 +-
vcl/source/helper/driverblocklist.cxx | 18 ++++++++++++++++--
5 files changed, 44 insertions(+), 7 deletions(-)
New commits:
commit cb82e82228b7486844a02ff964c68025558523dc
Author: Luboš Luňák <l.lunak at collabora.com>
AuthorDate: Mon Sep 28 09:59:42 2020 +0200
Commit: Luboš Luňák <l.lunak at collabora.com>
CommitDate: Tue Sep 29 09:57:25 2020 +0200
make it possible to blacklist just "windows"
OpenGL blacklisting is done only on Windows, so there "all" is fine,
but Skia checks blacklisting on Linux too, so add a generic "windows".
Change-Id: Ie331ae275d437061b4d185d766663ff3c09261cd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103532
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak at collabora.com>
diff --git a/vcl/inc/driverblocklist.hxx b/vcl/inc/driverblocklist.hxx
index 2e1367e5db31..fa85dd7dab24 100644
--- a/vcl/inc/driverblocklist.hxx
+++ b/vcl/inc/driverblocklist.hxx
@@ -57,15 +57,21 @@ struct InvalidFileException
enum OperatingSystem
{
DRIVER_OS_UNKNOWN = 0,
- DRIVER_OS_WINDOWS_7,
+ DRIVER_OS_WINDOWS_FIRST,
+ DRIVER_OS_WINDOWS_7 = DRIVER_OS_WINDOWS_FIRST,
DRIVER_OS_WINDOWS_8,
DRIVER_OS_WINDOWS_8_1,
DRIVER_OS_WINDOWS_10,
+ DRIVER_OS_WINDOWS_LAST = DRIVER_OS_WINDOWS_10,
+ DRIVER_OS_WINDOWS_ALL,
DRIVER_OS_LINUX,
- DRIVER_OS_OSX_10_5,
+ DRIVER_OS_OSX_FIRST,
+ DRIVER_OS_OSX_10_5 = DRIVER_OS_OSX_FIRST,
DRIVER_OS_OSX_10_6,
DRIVER_OS_OSX_10_7,
DRIVER_OS_OSX_10_8,
+ DRIVER_OS_OSX_LAST = DRIVER_OS_OSX_10_8,
+ DRIVER_OS_OSX_ALL,
DRIVER_OS_ANDROID,
DRIVER_OS_ALL
};
diff --git a/vcl/qa/cppunit/blocklistparsertest.cxx b/vcl/qa/cppunit/blocklistparsertest.cxx
index e9c6622e36a9..96c93b44326a 100644
--- a/vcl/qa/cppunit/blocklistparsertest.cxx
+++ b/vcl/qa/cppunit/blocklistparsertest.cxx
@@ -115,6 +115,15 @@ void BlocklistParserTest::testEvaluate()
CPPUNIT_ASSERT_EQUAL(false, FindBlocklistedDeviceInList(
aDriveInfos, VersionType::OpenGL, "10.20.30.40", vendorNVIDIA, "all", DRIVER_OS_WINDOWS_10));
+ // Check generic OS
+ CPPUNIT_ASSERT_EQUAL(false, FindBlocklistedDeviceInList(
+ aDriveInfos, VersionType::OpenGL, "10.20.30.50", vendorMicrosoft, "all", DRIVER_OS_WINDOWS_10));
+ CPPUNIT_ASSERT_EQUAL(true, FindBlocklistedDeviceInList(
+ aDriveInfos, VersionType::OpenGL, "10.20.30.50", vendorMicrosoft, "all", DRIVER_OS_LINUX));
+ CPPUNIT_ASSERT_EQUAL(true, FindBlocklistedDeviceInList(
+ aDriveInfos, VersionType::OpenGL, "10.20.30.50", vendorMicrosoft, "all", DRIVER_OS_OSX_10_7));
+ CPPUNIT_ASSERT_EQUAL(true, FindBlocklistedDeviceInList(
+ aDriveInfos, VersionType::OpenGL, "10.20.30.50", vendorMicrosoft, "all", DRIVER_OS_OSX_10_8));
// Check Vendors
CPPUNIT_ASSERT_EQUAL(true, FindBlocklistedDeviceInList(
diff --git a/vcl/qa/cppunit/test_blocklist_evaluate.xml b/vcl/qa/cppunit/test_blocklist_evaluate.xml
index 9184a9c9bd30..bd9985e32718 100644
--- a/vcl/qa/cppunit/test_blocklist_evaluate.xml
+++ b/vcl/qa/cppunit/test_blocklist_evaluate.xml
@@ -9,7 +9,7 @@
<!--
entry attributes:
- os - "all", "7", "8", "8_1", "10"
+ os - "all", "7", "8", "8_1", "10", "windows", "linux", "osx_10_5", "osx_10_6", "osx_10_7", "osx_10_8", "osx"
vendor - "all", "intel", "amd", "nvidia", "microsoft"
compare - "less", "less_equal", "greater", "greater_equal", "equal", "not_equal", "between_exclusive", "between_inclusive", "between_inclusive_start"
version
@@ -26,7 +26,7 @@
<device id="all"/>
</entry>
- <entry os="all" vendor="microsoft">
+ <entry os="all" vendor="microsoft" compare="equal" version="10.20.30.40">
<device id="all"/>
</entry>
@@ -34,5 +34,13 @@
<device id="all"/>
</entry>
+ <entry os="osx" vendor="microsoft" compare="equal" version="10.20.30.50">
+ <device id="all"/>
+ </entry>
+
+ <entry os="linux" vendor="microsoft" compare="equal" version="10.20.30.50">
+ <device id="all"/>
+ </entry>
+
</denylist>
</root>
diff --git a/vcl/skia/skia_denylist_vulkan.xml b/vcl/skia/skia_denylist_vulkan.xml
index 2e7dd22a0fe0..f7d82bc8bfeb 100644
--- a/vcl/skia/skia_denylist_vulkan.xml
+++ b/vcl/skia/skia_denylist_vulkan.xml
@@ -9,7 +9,7 @@
<!--
entry attributes:
- os - "all", "7", "8", "8_1", "10", "linux"
+ os - "all", "7", "8", "8_1", "10", "windows", "linux", "osx_10_5", "osx_10_6", "osx_10_7", "osx_10_8", "osx"
vendor - "all", "intel", "amd", "nvidia", "microsoft"
compare - "less", "less_equal", "greater", "greater_equal", "equal", "not_equal", "between_exclusive", "between_inclusive", "between_inclusive_start"
version
diff --git a/vcl/source/helper/driverblocklist.cxx b/vcl/source/helper/driverblocklist.cxx
index ea153eb1fc8c..0fb1edd73f75 100644
--- a/vcl/source/helper/driverblocklist.cxx
+++ b/vcl/source/helper/driverblocklist.cxx
@@ -34,6 +34,8 @@ static OperatingSystem getOperatingSystem(const OString& rString)
return DRIVER_OS_WINDOWS_8_1;
else if (rString == "10")
return DRIVER_OS_WINDOWS_10;
+ else if (rString == "windows")
+ return DRIVER_OS_WINDOWS_ALL;
else if (rString == "linux")
return DRIVER_OS_LINUX;
else if (rString == "osx_10_5")
@@ -44,6 +46,8 @@ static OperatingSystem getOperatingSystem(const OString& rString)
return DRIVER_OS_OSX_10_7;
else if (rString == "osx_10_8")
return DRIVER_OS_OSX_10_8;
+ else if (rString == "osx")
+ return DRIVER_OS_OSX_ALL;
else if (rString == "android")
return DRIVER_OS_ANDROID;
return DRIVER_OS_UNKNOWN;
@@ -602,8 +606,18 @@ bool FindBlocklistedDeviceInList(std::vector<DriverInfo>& aDeviceInfos, VersionT
bool match = false;
for (std::vector<DriverInfo>::size_type i = 0; i < aDeviceInfos.size(); i++)
{
- if (aDeviceInfos[i].meOperatingSystem != DRIVER_OS_ALL
- && aDeviceInfos[i].meOperatingSystem != system)
+ bool osMatch = false;
+ if (aDeviceInfos[i].meOperatingSystem == DRIVER_OS_ALL)
+ osMatch = true;
+ else if (aDeviceInfos[i].meOperatingSystem == system)
+ osMatch = true;
+ else if (aDeviceInfos[i].meOperatingSystem == DRIVER_OS_WINDOWS_ALL
+ && system >= DRIVER_OS_WINDOWS_FIRST && system <= DRIVER_OS_WINDOWS_LAST)
+ osMatch = true;
+ else if (aDeviceInfos[i].meOperatingSystem == DRIVER_OS_OSX_ALL
+ && system >= DRIVER_OS_OSX_FIRST && system <= DRIVER_OS_OSX_LAST)
+ osMatch = true;
+ if (!osMatch)
{
continue;
}
More information about the Libreoffice-commits
mailing list