diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2021-04-14 14:58:32 +0200 |
---|---|---|
committer | Luboš Luňák <l.lunak@collabora.com> | 2021-04-14 18:54:54 +0200 |
commit | aa03f1a564abf967a60a284f5656fb2f2efb977f (patch) | |
tree | 7311abd0d70c4e5b06fb9f751d28aa023bee2fab | |
parent | 302fb4c1ec4a24112f9a2028be4d424891f10b4c (diff) |
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@collabora.com>
-rw-r--r-- | vcl/skia/gdiimpl.cxx | 13 |
1 files changed, 10 insertions, 3 deletions
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 { |