summaryrefslogtreecommitdiff
path: root/vcl/skia/SkiaHelper.cxx
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2020-02-18 15:55:46 +0100
committerLuboš Luňák <l.lunak@collabora.com>2020-02-19 12:43:42 +0100
commit1127a8dea95488c7c9add42244a79bb20e7c6d95 (patch)
tree75f4be1286e50327aaa60222f0b11e2756118f8d /vcl/skia/SkiaHelper.cxx
parentd8fe52d759ba033bd661893f12d17576d24276db (diff)
work around a driver/card(?) problem with Skia and AA-ed polygons
See description in SkiaSalGraphicsImpl::drawPolyPolygon(). Change-Id: I4b2626e26cac6d145b417426fc2575845386db57 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88941 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'vcl/skia/SkiaHelper.cxx')
-rw-r--r--vcl/skia/SkiaHelper.cxx18
1 files changed, 12 insertions, 6 deletions
diff --git a/vcl/skia/SkiaHelper.cxx b/vcl/skia/SkiaHelper.cxx
index c0972ab2e0a0..50402cccf47c 100644
--- a/vcl/skia/SkiaHelper.cxx
+++ b/vcl/skia/SkiaHelper.cxx
@@ -38,6 +38,8 @@ bool isVCLSkiaEnabled() { return false; }
namespace SkiaHelper
{
+uint32_t vendorId = 0;
+
static OUString getBlacklistFile()
{
OUString url("$BRAND_BASE_DIR/" LIBO_SHARE_FOLDER);
@@ -53,19 +55,21 @@ static bool isVulkanBlacklisted(const VkPhysicalDeviceProperties& props)
OUString driverVersion = OUString::number(props.driverVersion >> 22) + "."
+ OUString::number((props.driverVersion >> 12) & 0x3ff) + "."
+ OUString::number(props.driverVersion & 0xfff);
- OUString vendorId = "0x" + OUString::number(props.vendorID, 16);
- OUString deviceId = "0x" + OUString::number(props.deviceID, 16);
+ vendorId = props.vendorID;
+ OUString vendorIdStr = "0x" + OUString::number(props.vendorID, 16);
+ OUString deviceIdStr = "0x" + OUString::number(props.deviceID, 16);
SAL_INFO("vcl.skia",
"Vulkan API version: "
<< (props.apiVersion >> 22) << "." << ((props.apiVersion >> 12) & 0x3ff) << "."
<< (props.apiVersion & 0xfff) << ", driver version: " << driverVersion
- << ", vendor: " << vendorId << ", device: " << deviceId << ", type: "
+ << ", vendor: " << vendorIdStr << ", device: " << deviceIdStr << ", type: "
<< types[std::min<unsigned>(props.deviceType, SAL_N_ELEMENTS(types) - 1)]
<< ", name: " << props.deviceName);
- return DriverBlocklist::IsDeviceBlocked(getBlacklistFile(), driverVersion, vendorId, deviceId);
+ return DriverBlocklist::IsDeviceBlocked(getBlacklistFile(), driverVersion, vendorIdStr,
+ deviceIdStr);
}
-static void checkDeviceBlacklisted()
+static void checkDeviceBlacklisted(bool blockDisable = false)
{
static bool done = false;
if (!done)
@@ -86,7 +90,7 @@ static void checkDeviceBlacklisted()
}
else
SAL_INFO("vcl.skia", "Vulkan could not be initialized");
- if (blacklisted)
+ if (blacklisted && !blockDisable)
disableRenderMethod(RenderVulkan);
break;
}
@@ -135,6 +139,8 @@ bool isVCLSkiaEnabled()
if (bForceSkia)
{
bRet = true;
+ // don't actually block if blacklisted, but log it if enabled, and also get the vendor id
+ checkDeviceBlacklisted(true);
}
else if (getenv("SAL_FORCEGL"))
{