sd/qa/unit/tiledrendering/tiledrendering.cxx | 44 +++++++++++++++++++++++---- 1 file changed, 38 insertions(+), 6 deletions(-)
New commits: commit 5f51c0f87961daf868cdea3fd70ccb1ca33e31f9 Author: Caolán McNamara <[email protected]> AuthorDate: Fri Dec 12 09:54:21 2025 +0000 Commit: Caolán McNamara <[email protected]> CommitDate: Mon Dec 15 10:05:34 2025 +0100 fix test for ENABLE_CAIRO_RGBA Change-Id: I91f472d0a65527a0cb64c350de91c1f4f625d56a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195538 Tested-by: Caolán McNamara <[email protected]> Reviewed-by: Miklos Vajna <[email protected]> diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx b/sd/qa/unit/tiledrendering/tiledrendering.cxx index 2bbf4aee1865..85c62eae34bd 100644 --- a/sd/qa/unit/tiledrendering/tiledrendering.cxx +++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx @@ -60,6 +60,8 @@ #include <vcl/filter/PngImageWriter.hxx> #include <sfx2/lokhelper.hxx> +#include <config_cairo_rgba.h> + #include <chrono> #include <cstdlib> #include <string_view> @@ -3135,7 +3137,12 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSlideshowLayeredRendering) CPPUNIT_ASSERT_EQUAL(aTransparentColor, aBitmapEx.GetPixelColor(nLeft, nBottom)); // bottom-right corner - CPPUNIT_ASSERT_EQUAL(Color(0xff, 0xd0, 0x40), aBitmapEx.GetPixelColor(nRight, nBottom)); + ::Color nColor = aBitmapEx.GetPixelColor(nRight, nBottom); +#if !ENABLE_CAIRO_RGBA + CPPUNIT_ASSERT_EQUAL(Color(0xff, 0xd0, 0x40), nColor); +#else + CPPUNIT_ASSERT_EQUAL(Color(0x40, 0xd0, 0xff), nColor); +#endif boost::property_tree::ptree aTree; readJSON(aTree, aJson); @@ -3160,7 +3167,12 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSlideshowLayeredRendering) BitmapEx aBitmapEx = vcl::bitmap::CreateFromData(pBuffer.data(), nViewWidth, nViewHeight, nViewWidth * 4, /*nBitsPerPixel*/32, true, true); // top-left corner - CPPUNIT_ASSERT_EQUAL(Color(0x00, 0x50, 0x90), aBitmapEx.GetPixelColor(nLeft, nTop)); + ::Color nColor = aBitmapEx.GetPixelColor(nLeft, nTop); +#if !ENABLE_CAIRO_RGBA + CPPUNIT_ASSERT_EQUAL(Color(0x00, 0x50, 0x90), nColor); +#else + CPPUNIT_ASSERT_EQUAL(Color(0x90, 0x50, 0x00), nColor); +#endif // bottom-left corner CPPUNIT_ASSERT_EQUAL(aTransparentColor, aBitmapEx.GetPixelColor(nLeft, nBottom)); @@ -3249,7 +3261,12 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSlideshowLayeredRendering_WithFie CPPUNIT_ASSERT_EQUAL(aTransparentColor, aBitmapEx.GetPixelColor(nLeft, nTop)); // bottom-left corner - CPPUNIT_ASSERT_EQUAL(Color(0x90, 0x80, 0xff), aBitmapEx.GetPixelColor(nLeft, nBottom)); + ::Color nColor = aBitmapEx.GetPixelColor(nLeft, nBottom); +#if !ENABLE_CAIRO_RGBA + CPPUNIT_ASSERT_EQUAL(Color(0x90, 0x80, 0xff), nColor); +#else + CPPUNIT_ASSERT_EQUAL(Color(0xff, 0x80, 0x90), nColor); +#endif // bottom-right corner CPPUNIT_ASSERT_EQUAL(aTransparentColor, aBitmapEx.GetPixelColor(nRight, nBottom)); @@ -3284,7 +3301,12 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSlideshowLayeredRendering_WithFie CPPUNIT_ASSERT_EQUAL(aTransparentColor, aBitmapEx.GetPixelColor(nRight, nBottom)); // bottom-center - CPPUNIT_ASSERT_EQUAL(Color(0x20, 0xaa, 0x00), aBitmapEx.GetPixelColor(nCenterX, nBottom)); + ::Color nColor = aBitmapEx.GetPixelColor(nCenterX, nBottom); +#if !ENABLE_CAIRO_RGBA + CPPUNIT_ASSERT_EQUAL(Color(0x20, 0xaa, 0x00), nColor); +#else + CPPUNIT_ASSERT_EQUAL(Color(0x00, 0xaa, 0x20), nColor); +#endif boost::property_tree::ptree aTree; readJSON(aTree, aJson); @@ -3313,7 +3335,12 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSlideshowLayeredRendering_WithFie CPPUNIT_ASSERT_EQUAL(aTransparentColor, aBitmapEx.GetPixelColor(nLeft, nBottom)); // bottom-right corner - CPPUNIT_ASSERT_EQUAL(Color(0xff, 0xd0, 0x40), aBitmapEx.GetPixelColor(nRight, nBottom)); + ::Color nColor = aBitmapEx.GetPixelColor(nRight, nBottom); +#if !ENABLE_CAIRO_RGBA + CPPUNIT_ASSERT_EQUAL(Color(0xff, 0xd0, 0x40), nColor); +#else + CPPUNIT_ASSERT_EQUAL(Color(0x40, 0xd0, 0xff), nColor); +#endif boost::property_tree::ptree aTree; readJSON(aTree, aJson); @@ -3373,7 +3400,12 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSlideshowLayeredRendering_WithFie BitmapEx aBitmapEx = vcl::bitmap::CreateFromData(pBuffer.data(), nViewWidth, nViewHeight, nViewWidth * 4, /*nBitsPerPixel*/32, true, true); // top-left corner - CPPUNIT_ASSERT_EQUAL(Color(0x00, 0x50, 0x90), aBitmapEx.GetPixelColor(nLeft, nTop)); + ::Color nColor = aBitmapEx.GetPixelColor(nLeft, nTop); +#if !ENABLE_CAIRO_RGBA + CPPUNIT_ASSERT_EQUAL(Color(0x00, 0x50, 0x90), nColor); +#else + CPPUNIT_ASSERT_EQUAL(Color(0x90, 0x50, 0x00), nColor); +#endif // bottom-left corner CPPUNIT_ASSERT_EQUAL(aTransparentColor, aBitmapEx.GetPixelColor(nLeft, nBottom));
