diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2020-07-17 15:09:49 +0200 |
---|---|---|
committer | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2021-07-30 23:27:40 +0900 |
commit | fe368c43be0a1cab0a6f026bc5dd1f11e573de4e (patch) | |
tree | 8182bfa13147e138e0e0ca500b2ebaa9460e7296 | |
parent | 14d22b29cf2da99268127e90fdf48a7ba5e2fb96 (diff) |
Revert "hack for gradients split into adjacent polygons (tdf#133016)"
This reverts commit 777ac5456a1f24fea29931ede983b5b8ad9a063d.
-rw-r--r-- | drawinglayer/source/primitive2d/svggradientprimitive2d.cxx | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/drawinglayer/source/primitive2d/svggradientprimitive2d.cxx b/drawinglayer/source/primitive2d/svggradientprimitive2d.cxx index 80f6a475b106..7aeb1395714f 100644 --- a/drawinglayer/source/primitive2d/svggradientprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/svggradientprimitive2d.cxx @@ -30,7 +30,7 @@ #include <drawinglayer/geometry/viewinformation2d.hxx> #include <sal/log.hxx> #include <cmath> -#include <vcl/skia/SkiaHelper.hxx> + using namespace com::sun::star; @@ -874,12 +874,6 @@ namespace drawinglayer::primitive2d // use color distance and discrete lengths to calculate step count const sal_uInt32 nSteps(calculateStepsForSvgGradient(getColorA(), getColorB(), fDelta, fDiscreteUnit)); - // HACK: Splitting a gradient into adjacent polygons with gradually changing color is silly. - // If antialiasing is used to draw them, the AA-ed adjacent edges won't line up perfectly - // because of the AA (see SkiaSalGraphicsImpl::mergePolyPolygonToPrevious()). - // Make the polygons a bit wider, so they the partial overlap "fixes" this. - const double fixup = SkiaHelper::isVCLSkiaEnabled() ? fDiscreteUnit / 2 : 0; - // tdf#117949 Use a small amount of discrete overlap at the edges. Usually this // should be exactly 0.0 and 1.0, but there were cases when this gets clipped // against the mask polygon which got numerically problematic. @@ -893,7 +887,7 @@ namespace drawinglayer::primitive2d basegfx::B2DRange( getOffsetA() - fDiscreteUnit, -0.0001, // TTTT -> should be 0.0, see comment above - getOffsetA() + (fDelta / nSteps) + fDiscreteUnit + fixup, + getOffsetA() + (fDelta / nSteps) + fDiscreteUnit, 1.0001))); // TTTT -> should be 1.0, see comment above // prepare loop (inside to outside, [0.0 .. 1.0[) |