diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2021-09-20 11:26:53 +0200 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2021-09-24 14:39:28 +0200 |
commit | 20883c42370e014a085533010c219aecf167bfda (patch) | |
tree | d65130426a8d4a71d7d4a379a834395a245b2cc7 /include/drawinglayer | |
parent | Revert "tdf#99492 sw layout: always paint merged cell grids" (diff) | |
download | core-20883c42370e014a085533010c219aecf167bfda.tar.gz core-20883c42370e014a085533010c219aecf167bfda.zip |
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/+/122383
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'include/drawinglayer')
-rw-r--r-- | include/drawinglayer/primitive2d/baseprimitive2d.hxx | 7 | ||||
-rw-r--r-- | include/drawinglayer/primitive2d/shadowprimitive2d.hxx | 8 |
2 files changed, 15 insertions, 0 deletions
diff --git a/include/drawinglayer/primitive2d/baseprimitive2d.hxx b/include/drawinglayer/primitive2d/baseprimitive2d.hxx index 45d0e3519c40..b94218b07111 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() @@ -237,6 +240,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; }; |