diff options
author | Chris Sherlock <chris.sherlock79@gmail.com> | 2019-11-16 03:19:48 +1100 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2019-11-17 15:54:29 +0100 |
commit | 3a8d16ba8ca7ef7349e893f2bf1c7e12d9a8d7ae (patch) | |
tree | 139066a20d02330a1730929ce84e27936734eff0 | |
parent | 26103123f3464613f1266f268cb23c05ab81426c (diff) |
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>
-rw-r--r-- | vcl/osx/saldata.cxx | 4 | ||||
-rw-r--r-- | vcl/qa/cppunit/bitmaprender/BitmapRenderTest.cxx | 22 | ||||
-rw-r--r-- | vcl/qa/cppunit/outdev.cxx | 4 |
3 files changed, 8 insertions, 22 deletions
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 |