summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2021-09-20 11:26:53 +0200
committerMike Kaganski <mike.kaganski@collabora.com>2021-09-22 17:27:39 +0200
commit288eab2fbb859689d84082810afb15b2a229f12d (patch)
tree599d172211d46d9c46f0ef9a17119d3cbf5b9abe /include
parentdbfb7940e4e6b0a1f136a6d109d0e6926617208f (diff)
tdf#144091 svx: fix unwanted blur of shadow from table cell fill
Initial render support for shadows of table shapes were added in commit a75bf43a8d6c5dec6dcc86908c142ceec541aa8c (tdf#129961 svx: add rendering for table shadow as direct format, 2020-12-02). That already noticed a trick with the shadow of table shapes: the shadow is generate from the cell fill and the border, but not from the text. An additional trick is that when blur is enabled for the table shape's shadow, then only the border should be blurred, not the cell fill. In the bug document's case, the effective cell background was gray, with a semi-transparent red shadow. We used to render cc0000 with blur and cccccc without blur, now we correctly render cca3a3, matching PowerPoint. (cherry picked from commit 37a52d30bbfcf1d073779b50139c4dafa507be4b) Conflicts: drawinglayer/source/primitive2d/shadowprimitive2d.cxx drawinglayer/source/tools/primitive2dxmldump.cxx include/drawinglayer/primitive2d/BufferedDecompositionPrimitive2D.hxx Change-Id: I7326a5f6254cf19b2d05181084c78e734ff7a7b4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122357 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'include')
-rw-r--r--include/drawinglayer/primitive2d/baseprimitive2d.hxx7
-rw-r--r--include/drawinglayer/primitive2d/shadowprimitive2d.hxx8
2 files changed, 15 insertions, 0 deletions
diff --git a/include/drawinglayer/primitive2d/baseprimitive2d.hxx b/include/drawinglayer/primitive2d/baseprimitive2d.hxx
index 7619e04e5279..c4a9b650308f 100644
--- a/include/drawinglayer/primitive2d/baseprimitive2d.hxx
+++ b/include/drawinglayer/primitive2d/baseprimitive2d.hxx
@@ -204,6 +204,9 @@ private:
/// a sequence used for buffering the last create2DDecomposition() result
Primitive2DContainer maBuffered2DDecomposition;
+ /// When blur is invoked on a list of primitives, exclude this primitive from the blur effect.
+ bool mbExcludeFromBlur = false;
+
protected:
/** access methods to maBuffered2DDecomposition. The usage of this methods may allow
later thread-safe stuff to be added if needed. Only to be used by getDecomposition()
@@ -236,6 +239,10 @@ public:
virtual void
get2DDecomposition(Primitive2DDecompositionVisitor& rVisitor,
const geometry::ViewInformation2D& rViewInformation) const override;
+
+ void setExcludeFromBlur(bool bExcludeFromBlur) { mbExcludeFromBlur = bExcludeFromBlur; }
+
+ bool getExcludeFromBlur() const { return mbExcludeFromBlur; }
};
} // end of namespace drawinglayer::primitive2d
diff --git a/include/drawinglayer/primitive2d/shadowprimitive2d.hxx b/include/drawinglayer/primitive2d/shadowprimitive2d.hxx
index 37258d8f34ed..7bd223847f8d 100644
--- a/include/drawinglayer/primitive2d/shadowprimitive2d.hxx
+++ b/include/drawinglayer/primitive2d/shadowprimitive2d.hxx
@@ -76,6 +76,14 @@ namespace drawinglayer::primitive2d
/// create decomposition
virtual void get2DDecomposition(Primitive2DDecompositionVisitor& rVisitor, const geometry::ViewInformation2D& rViewInformation) const override;
+ void get2DDecompositionWithoutBlur(
+ Primitive2DDecompositionVisitor& rVisitor,
+ const geometry::ViewInformation2D& rViewInformation) const;
+
+ void
+ get2DDecompositionWithBlur(Primitive2DDecompositionVisitor& rVisitor,
+ const geometry::ViewInformation2D& rViewInformation) const;
+
/// provide unique ID
virtual sal_uInt32 getPrimitive2DID() const override;
};