[Libreoffice-commits] core.git: drawinglayer/source include/drawinglayer svx/source sw/source

Luboš Luňák (via logerrit) logerrit at kemper.freedesktop.org
Tue Dec 1 15:29:38 UTC 2020


 drawinglayer/source/primitive3d/textureprimitive3d.cxx   |    2 +-
 include/drawinglayer/attribute/fillgradientattribute.hxx |    2 +-
 svx/source/sdr/primitive2d/sdrattributecreator.cxx       |    3 +--
 svx/source/xoutdev/xtabgrdt.cxx                          |    4 +---
 sw/source/uibase/docvw/HeaderFooterWin.cxx               |    2 +-
 sw/source/uibase/docvw/ShadowOverlayObject.cxx           |    9 +++------
 6 files changed, 8 insertions(+), 14 deletions(-)

New commits:
commit 8601eca3c8573b433933ab59180624d798c6189e
Author:     Luboš Luňák <l.lunak at collabora.com>
AuthorDate: Tue Dec 1 12:39:39 2020 +0100
Commit:     Luboš Luňák <l.lunak at collabora.com>
CommitDate: Tue Dec 1 16:28:59 2020 +0100

    do not unnecessarily explicitly force gradient step count (tdf#138581)
    
    Toolkits usually do not provide the ability to specify gradient steps,
    which means VCL falls back to its algorithm, which at least with Skia
    sometimes causes poor results.
    
    Change-Id: I35dbf87e77d5ed36d8f257db877135a2a0be2ffe
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106971
    Tested-by: Jenkins
    Reviewed-by: Luboš Luňák <l.lunak at collabora.com>

diff --git a/drawinglayer/source/primitive3d/textureprimitive3d.cxx b/drawinglayer/source/primitive3d/textureprimitive3d.cxx
index a053a7c214d0..7c9226bf40de 100644
--- a/drawinglayer/source/primitive3d/textureprimitive3d.cxx
+++ b/drawinglayer/source/primitive3d/textureprimitive3d.cxx
@@ -91,7 +91,7 @@ namespace drawinglayer::primitive3d
             {
                 // create TransparenceTexturePrimitive3D with fixed transparence as replacement
                 const basegfx::BColor aGray(getTransparence(), getTransparence(), getTransparence());
-                const attribute::FillGradientAttribute aFillGradient(attribute::GradientStyle::Linear, 0.0, 0.0, 0.0, 0.0, aGray, aGray, 1);
+                const attribute::FillGradientAttribute aFillGradient(attribute::GradientStyle::Linear, 0.0, 0.0, 0.0, 0.0, aGray, aGray);
                 const Primitive3DReference xRef(new TransparenceTexturePrimitive3D(aFillGradient, getChildren(), getTextureSize()));
                 return { xRef };
             }
diff --git a/include/drawinglayer/attribute/fillgradientattribute.hxx b/include/drawinglayer/attribute/fillgradientattribute.hxx
index f9d9e2245d9a..50a87a685f1a 100644
--- a/include/drawinglayer/attribute/fillgradientattribute.hxx
+++ b/include/drawinglayer/attribute/fillgradientattribute.hxx
@@ -53,7 +53,7 @@ public:
     /// constructors/assignmentoperator/destructor
     FillGradientAttribute(GradientStyle eStyle, double fBorder, double fOffsetX, double fOffsetY,
                           double fAngle, const basegfx::BColor& rStartColor,
-                          const basegfx::BColor& rEndColor, sal_uInt16 nSteps);
+                          const basegfx::BColor& rEndColor, sal_uInt16 nSteps = 0);
     FillGradientAttribute();
     FillGradientAttribute(const FillGradientAttribute&);
     FillGradientAttribute(FillGradientAttribute&&);
diff --git a/svx/source/sdr/primitive2d/sdrattributecreator.cxx b/svx/source/sdr/primitive2d/sdrattributecreator.cxx
index d5baa905e0a8..5ee93efef85f 100644
--- a/svx/source/sdr/primitive2d/sdrattributecreator.cxx
+++ b/svx/source/sdr/primitive2d/sdrattributecreator.cxx
@@ -644,8 +644,7 @@ namespace drawinglayer::primitive2d
                         static_cast<double>(rGradient.GetYOffset()) * 0.01,
                         static_cast<double>(rGradient.GetAngle().get()) * F_PI1800,
                         basegfx::BColor(fStartLum, fStartLum, fStartLum),
-                        basegfx::BColor(fEndLum, fEndLum, fEndLum),
-                        0);
+                        basegfx::BColor(fEndLum, fEndLum, fEndLum));
                 }
             }
 
diff --git a/svx/source/xoutdev/xtabgrdt.cxx b/svx/source/xoutdev/xtabgrdt.cxx
index fbb69a0ddd77..23bfc8313cb9 100644
--- a/svx/source/xoutdev/xtabgrdt.cxx
+++ b/svx/source/xoutdev/xtabgrdt.cxx
@@ -153,7 +153,6 @@ BitmapEx XGradientList::CreateBitmap( tools::Long nIndex, const Size& rSize ) co
             }
         }
 
-        const sal_uInt16 nSteps((rSize.Width() + rSize.Height()) / 3);
         const drawinglayer::attribute::FillGradientAttribute aFillGradient(
             aGradientStyle,
             static_cast<double>(rGradient.GetBorder()) * 0.01,
@@ -161,8 +160,7 @@ BitmapEx XGradientList::CreateBitmap( tools::Long nIndex, const Size& rSize ) co
             static_cast<double>(rGradient.GetYOffset()) * 0.01,
             static_cast<double>(rGradient.GetAngle().get()) * F_PI1800,
             aStart,
-            aEnd,
-            nSteps);
+            aEnd);
 
         const drawinglayer::primitive2d::Primitive2DReference aGradientPrimitive(
             new drawinglayer::primitive2d::PolyPolygonGradientPrimitive2D(
diff --git a/sw/source/uibase/docvw/HeaderFooterWin.cxx b/sw/source/uibase/docvw/HeaderFooterWin.cxx
index 2f08f0a5a7c3..7305a440d29a 100644
--- a/sw/source/uibase/docvw/HeaderFooterWin.cxx
+++ b/sw/source/uibase/docvw/HeaderFooterWin.cxx
@@ -151,7 +151,7 @@ void SwFrameButtonPainter::PaintButton(drawinglayer::primitive2d::Primitive2DCon
         double nAngle = M_PI;
         if (bOnTop)
             nAngle = 0;
-        FillGradientAttribute aFillAttrs(drawinglayer::attribute::GradientStyle::Linear, 0.0, 0.0, 0.0, nAngle, aLighterColor, aFillColor, 10);
+        FillGradientAttribute aFillAttrs(drawinglayer::attribute::GradientStyle::Linear, 0.0, 0.0, 0.0, nAngle, aLighterColor, aFillColor);
         rSeq.push_back(drawinglayer::primitive2d::Primitive2DReference(
                             new drawinglayer::primitive2d::FillGradientPrimitive2D(aGradientRect, aFillAttrs)));
     }
diff --git a/sw/source/uibase/docvw/ShadowOverlayObject.cxx b/sw/source/uibase/docvw/ShadowOverlayObject.cxx
index 65ccda75936a..ed247eb4b7ea 100644
--- a/sw/source/uibase/docvw/ShadowOverlayObject.cxx
+++ b/sw/source/uibase/docvw/ShadowOverlayObject.cxx
@@ -90,8 +90,7 @@ void ShadowPrimitive::create2DDecomposition(
                 0.5,
                 F_PI,
                 basegfx::BColor(230.0/255.0,230.0/255.0,230.0/255.0),
-                basegfx::BColor(180.0/255.0,180.0/255.0,180.0/255.0),
-                2);
+                basegfx::BColor(180.0/255.0,180.0/255.0,180.0/255.0));
 
             rContainer.push_back(
                 new drawinglayer::primitive2d::FillGradientPrimitive2D(
@@ -109,8 +108,7 @@ void ShadowPrimitive::create2DDecomposition(
                 0.5,
                 F_PI,
                 basegfx::BColor(230.0/255.0,230.0/255.0,230.0/255.0),
-                basegfx::BColor(180.0/255.0,180.0/255.0,180.0/255.0),
-                4);
+                basegfx::BColor(180.0/255.0,180.0/255.0,180.0/255.0));
 
             rContainer.push_back(
                 new drawinglayer::primitive2d::FillGradientPrimitive2D(
@@ -128,8 +126,7 @@ void ShadowPrimitive::create2DDecomposition(
                 0.5,
                 F_PI,
                 basegfx::BColor(230.0/255.0,230.0/255.0,230.0/255.0),
-                basegfx::BColor(83.0/255.0,83.0/255.0,83.0/255.0),
-                4);
+                basegfx::BColor(83.0/255.0,83.0/255.0,83.0/255.0));
 
             rContainer.push_back(
                 new drawinglayer::primitive2d::FillGradientPrimitive2D(


More information about the Libreoffice-commits mailing list