[Libreoffice-commits] core.git: vcl/osx vcl/qa

Chris Sherlock (via logerrit) logerrit at kemper.freedesktop.org
Sun Nov 17 14:55:17 UTC 2019


 vcl/osx/saldata.cxx                              |    4 ++--
 vcl/qa/cppunit/bitmaprender/BitmapRenderTest.cxx |   22 ++++------------------
 vcl/qa/cppunit/outdev.cxx                        |    4 ++--
 3 files changed, 8 insertions(+), 22 deletions(-)

New commits:
commit 3a8d16ba8ca7ef7349e893f2bf1c7e12d9a8d7ae
Author:     Chris Sherlock <chris.sherlock79 at gmail.com>
AuthorDate: Sat Nov 16 03:19:48 2019 +1100
Commit:     Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Sun Nov 17 15:54:29 2019 +0100

    tdf#128847 - vcl: fix colorspace names for MacOS
    
    kCGColorSpaceGenericGray is deprecated and should be
    kCGColorSpaceGenericGrayGamma2_2, and kCGColorSpaceGenericRGB is
    similary deprecated and now should be kCGColorSpaceSRGB.
    
    This fixes the "color skew" issue found in a variety of tests.
    
    Change-Id: I8088b2377e03cde3f8e03e9d3778a40fc3081c4a
    Reviewed-on: https://gerrit.libreoffice.org/82809
    Tested-by: Julien Nabet <serval2412 at yahoo.fr>
    Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>

diff --git a/vcl/osx/saldata.cxx b/vcl/osx/saldata.cxx
index ef46d6f4aa60..5235f657f8ca 100644
--- a/vcl/osx/saldata.cxx
+++ b/vcl/osx/saldata.cxx
@@ -51,8 +51,8 @@ SalData::SalData()
     mpFirstPrinter( nullptr ),
     mpFontList( nullptr ),
     mpStatusItem( nil ),
-    mxRGBSpace( CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB) ),
-    mxGraySpace( CGColorSpaceCreateWithName(kCGColorSpaceGenericGray) ),
+    mxRGBSpace( CGColorSpaceCreateWithName(kCGColorSpaceSRGB) ),
+    mxGraySpace( CGColorSpaceCreateWithName(kCGColorSpaceGenericGrayGamma2_2) ),
     maCursors(),
     mbIsScrollbarDoubleMax( false ),
 #if !HAVE_FEATURE_MACOSX_SANDBOX
diff --git a/vcl/qa/cppunit/bitmaprender/BitmapRenderTest.cxx b/vcl/qa/cppunit/bitmaprender/BitmapRenderTest.cxx
index bc8bdc6c06a1..71bfc40265b5 100644
--- a/vcl/qa/cppunit/bitmaprender/BitmapRenderTest.cxx
+++ b/vcl/qa/cppunit/bitmaprender/BitmapRenderTest.cxx
@@ -71,11 +71,9 @@ void BitmapRenderTest::testTdf104141()
 
     // Check drawing results: ensure that it contains transparent
     // (greenish) pixels
-#if !defined MACOSX //TODO: on Mac colors are drifted, so exact compare fails
     const Color aColor = pVDev->GetPixel(Point(21, 21));
     CPPUNIT_ASSERT(aColor.GetGreen() > 10 * aColor.GetRed()
                    && aColor.GetGreen() > 10 * aColor.GetBlue());
-#endif
 }
 
 void BitmapRenderTest::testTdf113918()
@@ -188,10 +186,7 @@ void BitmapRenderTest::testAlphaVirtualDevice()
 
     aColor = pAlphaVirtualDevice->GetPixel(Point(1, 1));
     // Read back the opaque pixel
-#ifdef MACOSX
-    // Oh no... what we input is not the same as what we get out!
-    CPPUNIT_ASSERT_EQUAL(Color(0x002Cff44), aColor);
-#elif defined _WIN32
+#if defined _WIN32
     CPPUNIT_ASSERT_LESS(6, deltaColor(Color(0x0022ff55), aColor));
 #else
     CPPUNIT_ASSERT_EQUAL(Color(0x0022ff55), aColor);
@@ -203,10 +198,7 @@ void BitmapRenderTest::testAlphaVirtualDevice()
     CPPUNIT_ASSERT_EQUAL(long(4), aBitmap.GetSizePixel().Height());
 
     aColor = aBitmap.GetPixelColor(1, 1);
-#ifdef MACOSX
-    // Oh no... what we input is not the same as what we get out!
-    CPPUNIT_ASSERT_EQUAL(Color(0x002Cff44), aColor);
-#elif defined _WIN32
+#if defined _WIN32
     CPPUNIT_ASSERT_LESS(6, deltaColor(Color(0x0022ff55), aColor));
 #else
     CPPUNIT_ASSERT_EQUAL(Color(0x0022ff55), aColor);
@@ -217,10 +209,7 @@ void BitmapRenderTest::testAlphaVirtualDevice()
 
     aColor = pAlphaVirtualDevice->GetPixel(Point(0, 0));
     // Read back the semi-transparent pixel
-#ifdef MACOSX
-    // Oh no... what we input is not the same as what we get out!
-    CPPUNIT_ASSERT_EQUAL(Color(0x342CFF44), aColor);
-#elif defined _WIN32
+#if defined _WIN32
     CPPUNIT_ASSERT_LESS(6, deltaColor(Color(0x4422FF55), aColor));
 #else
     CPPUNIT_ASSERT_EQUAL(Color(0x4422FF55), aColor);
@@ -232,10 +221,7 @@ void BitmapRenderTest::testAlphaVirtualDevice()
     CPPUNIT_ASSERT_EQUAL(long(4), aBitmap.GetSizePixel().Height());
 
     aColor = aBitmap.GetPixelColor(0, 0);
-#ifdef MACOSX
-    // Oh no... what we input is not the same as what we get out!
-    CPPUNIT_ASSERT_EQUAL(Color(0x342CFF44), aColor);
-#elif defined _WIN32
+#if defined _WIN32
     CPPUNIT_ASSERT_LESS(6, deltaColor(Color(0x4422FF55), aColor));
 #else
     CPPUNIT_ASSERT_EQUAL(Color(0x4422FF55), aColor);
diff --git a/vcl/qa/cppunit/outdev.cxx b/vcl/qa/cppunit/outdev.cxx
index e6a6b8f1c5f6..f4a27b0b0558 100644
--- a/vcl/qa/cppunit/outdev.cxx
+++ b/vcl/qa/cppunit/outdev.cxx
@@ -100,7 +100,7 @@ void VclOutdevTest::testVirtualDevice()
 #endif
 
     CPPUNIT_ASSERT_EQUAL(COL_WHITE, pVDev->GetPixel(Point(0,0)));
-#if defined LINUX //TODO: various failures on Mac and Windows tinderboxes
+#if !defined _WIN32 //TODO: various failures on Windows tinderboxes
     CPPUNIT_ASSERT_EQUAL(COL_BLUE, pVDev->GetPixel(Point(1,2)));
     CPPUNIT_ASSERT_EQUAL(COL_RED, pVDev->GetPixel(Point(31,30)));
 #endif
@@ -109,7 +109,7 @@ void VclOutdevTest::testVirtualDevice()
     // Gotcha: y and x swap for BitmapReadAccess: deep joy.
     Bitmap::ScopedReadAccess pAcc(aBmp);
     CPPUNIT_ASSERT_EQUAL(COL_WHITE, static_cast<Color>(pAcc->GetPixel(0,0)));
-#if defined LINUX //TODO: various failures on Mac and Windows tinderboxes
+#if !defined _WIN32 //TODO: various failures on Windows tinderboxes
     CPPUNIT_ASSERT_EQUAL(COL_BLUE, static_cast<Color>(pAcc->GetPixel(2,1)));
     CPPUNIT_ASSERT_EQUAL(COL_RED, static_cast<Color>(pAcc->GetPixel(30,31)));
 #endif


More information about the Libreoffice-commits mailing list