summaryrefslogtreecommitdiff
path: root/include/drawinglayer
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2021-09-20 11:26:53 +0200
committerMiklos Vajna <vmiklos@collabora.com>2021-09-20 12:57:23 +0200
commit37a52d30bbfcf1d073779b50139c4dafa507be4b (patch)
tree62a54ad5e163bffdde1517b5b242a33246a570a7 /include/drawinglayer
parent1a6401578ec32510342e232699889527cca914b8 (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. Change-Id: I7326a5f6254cf19b2d05181084c78e734ff7a7b4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122349 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'include/drawinglayer')
-rw-r--r--include/drawinglayer/primitive2d/BufferedDecompositionPrimitive2D.hxx7
-rw-r--r--include/drawinglayer/primitive2d/shadowprimitive2d.hxx8
2 files changed, 15 insertions, 0 deletions
diff --git a/include/drawinglayer/primitive2d/BufferedDecompositionPrimitive2D.hxx b/include/drawinglayer/primitive2d/BufferedDecompositionPrimitive2D.hxx
index fe3c477752a4..66bb9f29af24 100644
--- a/include/drawinglayer/primitive2d/BufferedDecompositionPrimitive2D.hxx
+++ b/include/drawinglayer/primitive2d/BufferedDecompositionPrimitive2D.hxx
@@ -67,6 +67,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()
@@ -99,6 +102,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 7df83a395f19..d388eaf1b90d 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;
};