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@yahoo.fr>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
(cherry picked from commit 3a8d16ba8ca7ef7349e893f2bf1c7e12d9a8d7ae)
Reviewed-on: https://gerrit.libreoffice.org/83081
Tested-by: Jenkins
Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
diff --git a/vcl/osx/saldata.cxx b/vcl/osx/saldata.cxx
index ef46d6f..5235f65 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 bc8bdc6..71bfc40 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 e6a6b8f..f4a27b0 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