diff options
author | Chris Sherlock <chris.sherlock79@gmail.com> | 2021-08-25 22:40:32 +1000 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2021-08-26 02:16:11 +0200 |
commit | 9ea129b49259231565d18f965a57c5fefb4ccc7a (patch) | |
tree | 1fa31853f9f8b2bba6c4cb401b83e14bcbe8fd54 /vcl/qa/cppunit/drawmode.cxx | |
parent | e73c3942de474004b04c1d538c89354183d44ae9 (diff) |
vcl: partial revert of drawmode
Partial revert of commit 0901297902c29c041ae944973b369e8247716893:
vcl: create drawmode functions
The GetBitmap() function will not work, as it doesn't add metafile
actions.
I have added a unit test to prevent this from occuring in future.
Change-Id: I8c895e813f378f85ee47f85c3f867e20925bae2f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121039
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'vcl/qa/cppunit/drawmode.cxx')
-rw-r--r-- | vcl/qa/cppunit/drawmode.cxx | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/vcl/qa/cppunit/drawmode.cxx b/vcl/qa/cppunit/drawmode.cxx index f3ea1af773f7..a9079af29227 100644 --- a/vcl/qa/cppunit/drawmode.cxx +++ b/vcl/qa/cppunit/drawmode.cxx @@ -32,7 +32,6 @@ public: void testDrawModeHatchColor(); void testDrawModeTextColor(); void testDrawModeFontColor(); - void testDrawModeBitmap(); void testDrawModeBitmapEx(); CPPUNIT_TEST_SUITE(VclDrawModeTest); @@ -42,7 +41,6 @@ public: CPPUNIT_TEST(testDrawModeHatchColor); CPPUNIT_TEST(testDrawModeTextColor); CPPUNIT_TEST(testDrawModeFontColor); - CPPUNIT_TEST(testDrawModeBitmap); CPPUNIT_TEST(testDrawModeBitmapEx); CPPUNIT_TEST_SUITE_END(); @@ -330,36 +328,6 @@ void VclDrawModeTest::testDrawModeFontColor() CPPUNIT_ASSERT_EQUAL(COL_RED, aTestFont.GetFillColor()); } -void VclDrawModeTest::testDrawModeBitmap() -{ - const StyleSettings aStyleSettings; - - Bitmap aBmp(Size(1, 1), vcl::PixelFormat::N24_BPP); - BitmapWriteAccess aBmpAccess(aBmp); - aBmpAccess.SetPixel(0, 0, BitmapColor(COL_RED)); - - { - Bitmap aResultBitmap(vcl::drawmode::GetBitmap(aBmp, DrawModeFlags::GrayBitmap)); - Bitmap::ScopedReadAccess pReadAccess(aResultBitmap); - - const BitmapColor& rColor = pReadAccess->GetColor(0, 0); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0x26), sal_Int32(rColor.GetRed())); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0x26), sal_Int32(rColor.GetGreen())); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0x26), sal_Int32(rColor.GetBlue())); - } - - // any other operation other than DrawModeFlags::GrayBitmap is a noop - { - Bitmap aResultBitmap(vcl::drawmode::GetBitmap(aBmp, DrawModeFlags::NoFill)); - Bitmap::ScopedReadAccess pReadAccess(aResultBitmap); - - const BitmapColor& rColor = pReadAccess->GetColor(0, 0); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0x80), sal_Int32(rColor.GetRed())); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0x00), sal_Int32(rColor.GetGreen())); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0x00), sal_Int32(rColor.GetBlue())); - } -} - void VclDrawModeTest::testDrawModeBitmapEx() { const StyleSettings aStyleSettings; |