diff options
author | Sarper Akdemir <sarper.akdemir.extern@allotropia.de> | 2023-09-04 18:10:22 +0300 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2023-09-06 11:23:26 +0200 |
commit | d9cd1fe49bd4cf32257508adab11f16f7a4a88f1 (patch) | |
tree | 27061c421b33733c5ed4d5540667d7f0433690d4 /svx/qa/unit/table.cxx | |
parent | 1345619e0b3c2825c2ae50ada2c209d4ad8461ad (diff) |
tdf#150557: svx: don't factor in transparence twice for cell shadows
multiplying child transparence with shadow alpha to get the
correct shadow alpha has been incorrect maybe since commits:
7eb4f92ed90e13ce5cbf7286fae623770e71324c,
e735ad1c57cddaf17d6ffc0cf15b5e14fa63c4ad
In ShadowPrimitive2D::create2DDecomposition the
shadow-casting primitive's alpha(mask) itself is already
being taken into account.
Therefore getting cell shadow alpha by multiplying child
transparence with shadow alpha, has the effect of child
transparence being applied twice for the table cell.
Change-Id: I78f9bbfcb0694a86eabc061330677784e887b5dc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156528
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir <sarper.akdemir.extern@allotropia.de>
(cherry picked from commit 98319164284c4a25d6a2313e6b8a35d244d94e91)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156591
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'svx/qa/unit/table.cxx')
-rw-r--r-- | svx/qa/unit/table.cxx | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/svx/qa/unit/table.cxx b/svx/qa/unit/table.cxx index dc3ad1e2bf67..72359dbc7820 100644 --- a/svx/qa/unit/table.cxx +++ b/svx/qa/unit/table.cxx @@ -73,17 +73,15 @@ CPPUNIT_TEST_FIXTURE(Test, testTableShadowBlur) drawinglayer::primitive2d::Primitive2DContainer xPrimitiveSequence = renderPageToPrimitives(xDrawPage); - // Then make sure that the cell fill part of the shadow is excluded from blurring: + // Then make sure that the cell fill part of the shadow has the expected transparency: drawinglayer::Primitive2dXmlDump aDumper; xmlDocUniquePtr pDocument = aDumper.dumpAndParse(xPrimitiveSequence); // Without the accompanying fix in place, this test would have failed with: - // - number of nodes is incorrect - // - Expected: 1 - // - Actual : 0 - // i.e. the shadow itself was not transparent and that resulted in a non-transparent rendering - // as well, while the rendering transparency should be based on the transparency of the shadow - // itself and the transparency of the cell fill. - assertXPath(pDocument, "//objectinfo/unifiedtransparence[1]", "transparence", "80"); + //- Expected: 0 + //- Actual : 2 + //- In <>, XPath contents of child does not match + // i.e. the shadow's transparency was miscalculated. + assertXPathContent(pDocument, "count(//objectinfo/unifiedtransparence)", "0"); } CPPUNIT_TEST_FIXTURE(Test, testSvxTableControllerSetAttrToSelectedShape) |