sd/qa/unit/tiledrendering/tiledrendering.cxx |   44 +++++++++++++++++++++++----
 1 file changed, 38 insertions(+), 6 deletions(-)

New commits:
commit c8c958293a88891ce86fa6681c746753171792a2
Author:     Caolán McNamara <[email protected]>
AuthorDate: Fri Dec 12 09:54:21 2025 +0000
Commit:     Caolán McNamara <[email protected]>
CommitDate: Fri Dec 12 16:27:35 2025 +0100

    fix test for ENABLE_CAIRO_RGBA
    
    Change-Id: I91f472d0a65527a0cb64c350de91c1f4f625d56a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195540
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <[email protected]>

diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx 
b/sd/qa/unit/tiledrendering/tiledrendering.cxx
index caf90b070016..c0a68aeea3de 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>
@@ -3130,7 +3132,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);
@@ -3155,7 +3162,12 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, 
testSlideshowLayeredRendering)
         Bitmap 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));
@@ -3244,7 +3256,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));
@@ -3279,7 +3296,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);
@@ -3308,7 +3330,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);
@@ -3368,7 +3395,12 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, 
testSlideshowLayeredRendering_WithFie
         Bitmap 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));

Reply via email to