[Libreoffice-commits] core.git: vcl/skia
LuboÅ¡ LuÅák (via logerrit)
logerrit at kemper.freedesktop.org
Wed Apr 14 16:55:34 UTC 2021
vcl/skia/gdiimpl.cxx | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
New commits:
commit aa03f1a564abf967a60a284f5656fb2f2efb977f
Author: Luboš Luňák <l.lunak at collabora.com>
AuthorDate: Wed Apr 14 14:58:32 2021 +0200
Commit: Luboš Luňák <l.lunak at collabora.com>
CommitDate: Wed Apr 14 18:54:54 2021 +0200
SkBlendMode::kDifference causes AMD/Linux driver instability
Change-Id: I70de779c20185ac6efe8da7ad197c5e4c68a8d23
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114091
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak at collabora.com>
diff --git a/vcl/skia/gdiimpl.cxx b/vcl/skia/gdiimpl.cxx
index e2d4ff9a3800..145bbf19cc4c 100644
--- a/vcl/skia/gdiimpl.cxx
+++ b/vcl/skia/gdiimpl.cxx
@@ -1434,7 +1434,14 @@ void SkiaSalGraphicsImpl::invert(basegfx::B2DPolygon const& rPoly, SalInvert eFl
// with SkBlendMode::kDifference(?) and surfaces wider than 1024 pixels, resulting
// in drawing errors. Work that around by fetching the relevant part of the surface
// and drawing using CPU.
- bool intelHack = (isGPU() && getVendor() == DriverBlocklist::VendorIntel && !mXorMode);
+ bool rasterHack = (isGPU() && getVendor() == DriverBlocklist::VendorIntel && !mXorMode);
+#if defined LINUX
+ // BackendTest::testDrawInvertTrackFrameWithRectangle() also has a problem
+ // with SkBlendMode::kDifference on AMD/Linux, leading to crashes or even
+ // driver instability. Also work around by drawing using CPU.
+ if (isGPU() && getVendor() == DriverBlocklist::VendorAMD && !mXorMode)
+ rasterHack = true;
+#endif
SkPath aPath;
addPolygonToPath(rPoly, aPath);
aPath.setFillType(SkPathFillType::kEvenOdd);
@@ -1454,7 +1461,7 @@ void SkiaSalGraphicsImpl::invert(basegfx::B2DPolygon const& rPoly, SalInvert eFl
aPaint.setPathEffect(SkDashPathEffect::Make(intervals, SK_ARRAY_COUNT(intervals), 0));
aPaint.setColor(SkColorSetARGB(255, 255, 255, 255));
aPaint.setBlendMode(SkBlendMode::kDifference);
- if (!intelHack)
+ if (!rasterHack)
getDrawCanvas()->drawPath(aPath, aPaint);
else
{
@@ -1505,7 +1512,7 @@ void SkiaSalGraphicsImpl::invert(basegfx::B2DPolygon const& rPoly, SalInvert eFl
aPaint.setShader(
aBitmap.makeShader(SkTileMode::kRepeat, SkTileMode::kRepeat, SkSamplingOptions()));
}
- if (!intelHack)
+ if (!rasterHack)
getDrawCanvas()->drawPath(aPath, aPaint);
else
{
More information about the Libreoffice-commits
mailing list