diff options
author | Noel <noel.grandin@collabora.co.uk> | 2021-01-08 13:45:05 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-01-08 17:20:48 +0100 |
commit | 6911375ab66df6fd4cb2b922ea1c9e57b4fcd3b2 (patch) | |
tree | ebe9d2610d30eda9d18b94370792e67cde6111ab /vcl/qa | |
parent | 9cc41b9ad52e3da734ce72223946bd00bfc92d14 (diff) |
Remove BitmapColor::GetAlpha
since its implementation is completely wrong - alpha and transparency
are not the same thing, they are inverses of each other.
Change-Id: Id9e00b8296391befd471345b6c86e0493a9e3f3c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108964
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/qa')
-rw-r--r-- | vcl/qa/cppunit/BitmapScaleTest.cxx | 2 | ||||
-rw-r--r-- | vcl/qa/cppunit/BitmapTest.cxx | 2 | ||||
-rw-r--r-- | vcl/qa/cppunit/bitmapcolor.cxx | 31 |
3 files changed, 18 insertions, 17 deletions
diff --git a/vcl/qa/cppunit/BitmapScaleTest.cxx b/vcl/qa/cppunit/BitmapScaleTest.cxx index 09ec8f9a3728..285799e2da52 100644 --- a/vcl/qa/cppunit/BitmapScaleTest.cxx +++ b/vcl/qa/cppunit/BitmapScaleTest.cxx @@ -64,7 +64,7 @@ void assertColorsAreSimilar(int maxDifference, const std::string& message, if (abs(expected.GetRed() - actual.GetRed()) <= maxDifference && abs(expected.GetGreen() - actual.GetGreen()) <= maxDifference && abs(expected.GetBlue() - actual.GetBlue()) <= maxDifference - && abs(expected.GetAlpha() - actual.GetAlpha()) <= maxDifference) + && abs(expected.GetTransparency() - actual.GetTransparency()) <= maxDifference) { return; } diff --git a/vcl/qa/cppunit/BitmapTest.cxx b/vcl/qa/cppunit/BitmapTest.cxx index 56395358863b..c2f2b592309f 100644 --- a/vcl/qa/cppunit/BitmapTest.cxx +++ b/vcl/qa/cppunit/BitmapTest.cxx @@ -73,7 +73,7 @@ void assertColorsAreSimilar(int maxDifference, const std::string& message, if (abs(expected.GetRed() - actual.GetRed()) <= maxDifference && abs(expected.GetGreen() - actual.GetGreen()) <= maxDifference && abs(expected.GetBlue() - actual.GetBlue()) <= maxDifference - && abs(expected.GetAlpha() - actual.GetAlpha()) <= maxDifference) + && abs(expected.GetTransparency() - actual.GetTransparency()) <= maxDifference) { return; } diff --git a/vcl/qa/cppunit/bitmapcolor.cxx b/vcl/qa/cppunit/bitmapcolor.cxx index eafa4d13805c..58d889a3d8a5 100644 --- a/vcl/qa/cppunit/bitmapcolor.cxx +++ b/vcl/qa/cppunit/bitmapcolor.cxx @@ -56,7 +56,8 @@ void BitmapColorTest::defaultConstructor() CPPUNIT_ASSERT_EQUAL_MESSAGE("Red wrong", static_cast<sal_uInt8>(0), aBmpColor.GetRed()); CPPUNIT_ASSERT_EQUAL_MESSAGE("Green wrong", static_cast<sal_uInt8>(0), aBmpColor.GetGreen()); CPPUNIT_ASSERT_EQUAL_MESSAGE("Blue wrong", static_cast<sal_uInt8>(0), aBmpColor.GetBlue()); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Alpha wrong", static_cast<sal_uInt8>(0), aBmpColor.GetAlpha()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Transparency wrong", static_cast<sal_uInt8>(0), + aBmpColor.GetTransparency()); } void BitmapColorTest::colorValueConstructor() @@ -68,8 +69,8 @@ void BitmapColorTest::colorValueConstructor() CPPUNIT_ASSERT_EQUAL_MESSAGE("Green wrong", static_cast<sal_uInt8>(0), aBmpColor.GetGreen()); CPPUNIT_ASSERT_EQUAL_MESSAGE("Blue wrong", static_cast<sal_uInt8>(0), aBmpColor.GetBlue()); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Alpha wrong", static_cast<sal_uInt8>(0), - aBmpColor.GetAlpha()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Transparency wrong", static_cast<sal_uInt8>(0), + aBmpColor.GetTransparency()); } { @@ -80,8 +81,8 @@ void BitmapColorTest::colorValueConstructor() aBmpColor.GetGreen()); CPPUNIT_ASSERT_EQUAL_MESSAGE("Blue wrong", static_cast<sal_uInt8>(128), aBmpColor.GetBlue()); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Alpha wrong", static_cast<sal_uInt8>(0), - aBmpColor.GetAlpha()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Transparency wrong", static_cast<sal_uInt8>(0), + aBmpColor.GetTransparency()); } { @@ -92,8 +93,8 @@ void BitmapColorTest::colorValueConstructor() aBmpColor.GetGreen()); CPPUNIT_ASSERT_EQUAL_MESSAGE("Blue wrong", static_cast<sal_uInt8>(255), aBmpColor.GetBlue()); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Alpha wrong", static_cast<sal_uInt8>(0), - aBmpColor.GetAlpha()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Transparency wrong", static_cast<sal_uInt8>(0), + aBmpColor.GetTransparency()); } } @@ -106,8 +107,8 @@ void BitmapColorTest::colorClassConstructor() CPPUNIT_ASSERT_EQUAL_MESSAGE("Green wrong", static_cast<sal_uInt8>(0), aBmpColor.GetGreen()); CPPUNIT_ASSERT_EQUAL_MESSAGE("Blue wrong", static_cast<sal_uInt8>(0), aBmpColor.GetBlue()); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Alpha wrong", static_cast<sal_uInt8>(0), - aBmpColor.GetAlpha()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Transparency wrong", static_cast<sal_uInt8>(0), + aBmpColor.GetTransparency()); } { @@ -118,8 +119,8 @@ void BitmapColorTest::colorClassConstructor() aBmpColor.GetGreen()); CPPUNIT_ASSERT_EQUAL_MESSAGE("Blue wrong", static_cast<sal_uInt8>(127), aBmpColor.GetBlue()); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Alpha wrong", static_cast<sal_uInt8>(0), - aBmpColor.GetAlpha()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Transparency wrong", static_cast<sal_uInt8>(0), + aBmpColor.GetTransparency()); } { @@ -130,8 +131,8 @@ void BitmapColorTest::colorClassConstructor() aBmpColor.GetGreen()); CPPUNIT_ASSERT_EQUAL_MESSAGE("Blue wrong", static_cast<sal_uInt8>(255), aBmpColor.GetBlue()); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Alpha wrong", static_cast<sal_uInt8>(0), - aBmpColor.GetAlpha()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Transparency wrong", static_cast<sal_uInt8>(0), + aBmpColor.GetTransparency()); } // Transparency / Alpha @@ -142,8 +143,8 @@ void BitmapColorTest::colorClassConstructor() CPPUNIT_ASSERT_EQUAL_MESSAGE("Green wrong", static_cast<sal_uInt8>(64), aBmpColor.GetGreen()); CPPUNIT_ASSERT_EQUAL_MESSAGE("Blue wrong", static_cast<sal_uInt8>(0), aBmpColor.GetBlue()); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Alpha wrong", static_cast<sal_uInt8>(255), - aBmpColor.GetAlpha()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Transparency wrong", static_cast<sal_uInt8>(255), + aBmpColor.GetTransparency()); } } |