summaryrefslogtreecommitdiff
path: root/vcl/qa/cppunit/skia
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2021-04-16 20:33:10 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2023-07-25 08:38:12 +0200
commit81994cb2b8b32453a92bcb011830fcb884f22ff3 (patch)
treeae1750e92421ad2e0ec3f50351c3be6581841598 /vcl/qa/cppunit/skia
parentdabedcaf27b0af1e38a611b8d8e48444f848e01d (diff)
Convert internal vcl bitmap formats transparency->alpha (II)
(Second attempt at landing this) Image formats and graphics APIs use alpha, not transparency, so change our internal formats and data structures to work directly with alpha, so we don't need to modify data before we push it to graphics APIs. Add a couple of new Color constants to make the intention of the vcl code clearer. Notes (*) On macOS, tweaking the logic in CreateWithSalBitmapAndMask to more accurately reflect the requirements of the CGImageCreateWithMask function seems to fix some tests. (*) The vcl code does not properly support gradients with transparency. So the previous code was wrong, and this change is going to result in slightly different wrongness. Change-Id: I9e21c2e98d88ecfdc5f75db13bd1ffff7c38db98 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114168 Tested-by: Jenkins Reviewed-by: Patrick Luby <plubius@neooffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/qa/cppunit/skia')
-rw-r--r--vcl/qa/cppunit/skia/skia.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/vcl/qa/cppunit/skia/skia.cxx b/vcl/qa/cppunit/skia/skia.cxx
index 5d81e39f587a..b90b915e17ea 100644
--- a/vcl/qa/cppunit/skia/skia.cxx
+++ b/vcl/qa/cppunit/skia/skia.cxx
@@ -244,7 +244,7 @@ void SkiaTest::testAlphaBlendWith()
skiaAlpha = dynamic_cast<SkiaSalBitmap*>(alpha.ImplGetSalBitmap().get());
CPPUNIT_ASSERT(skiaAlpha->unittestHasEraseColor());
CPPUNIT_ASSERT_EQUAL(vcl::PixelFormat::N8_BPP, alpha.getPixelFormat());
- CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt8>(112),
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt8>(208),
AlphaMask::ScopedReadAccess(alpha)->GetPixelIndex(0, 0));
// Test with images set.
@@ -264,7 +264,7 @@ void SkiaTest::testAlphaBlendWith()
skiaAlpha = dynamic_cast<SkiaSalBitmap*>(alpha.ImplGetSalBitmap().get());
CPPUNIT_ASSERT(skiaAlpha->unittestHasImage());
CPPUNIT_ASSERT_EQUAL(vcl::PixelFormat::N8_BPP, alpha.getPixelFormat());
- CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt8>(112),
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt8>(207),
AlphaMask::ScopedReadAccess(alpha)->GetPixelIndex(0, 0));
// Test with erase color for alpha and image for other bitmap.
@@ -281,7 +281,7 @@ void SkiaTest::testAlphaBlendWith()
skiaAlpha = dynamic_cast<SkiaSalBitmap*>(alpha.ImplGetSalBitmap().get());
CPPUNIT_ASSERT(skiaAlpha->unittestHasImage());
CPPUNIT_ASSERT_EQUAL(vcl::PixelFormat::N8_BPP, alpha.getPixelFormat());
- CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt8>(112),
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt8>(207),
AlphaMask::ScopedReadAccess(alpha)->GetPixelIndex(0, 0));
}