diff options
author | Thorsten Behrens <thb@openoffice.org> | 2006-07-13 11:03:26 +0000 |
---|---|---|
committer | Thorsten Behrens <thb@openoffice.org> | 2006-07-13 11:03:26 +0000 |
commit | 0177db3f91a28995ca151b63d054cd539cd27212 (patch) | |
tree | 9df894e22693545534b5941067f821610eb40de2 /basebmp/test | |
parent | 3583a216e8101fe4d0f17f913c2efcab58f9b518 (diff) |
#i65904# Swapped mask polarity - now, a zero in the mask denotes opacity; minor code tidying; made drawMaskedBitmap() handle a few more generic cases; switched 24bpp to BGR; adapted tests to modified mask polarity
Diffstat (limited to 'basebmp/test')
-rw-r--r-- | basebmp/test/basictest.cxx | 11 | ||||
-rw-r--r-- | basebmp/test/bmpmasktest.cxx | 14 | ||||
-rw-r--r-- | basebmp/test/cliptest.cxx | 8 |
3 files changed, 20 insertions, 13 deletions
diff --git a/basebmp/test/basictest.cxx b/basebmp/test/basictest.cxx index 20a3e09df063..ac0a94c98d9e 100644 --- a/basebmp/test/basictest.cxx +++ b/basebmp/test/basictest.cxx @@ -4,9 +4,9 @@ * * $RCSfile: basictest.cxx,v $ * - * $Revision: 1.10 $ + * $Revision: 1.11 $ * - * last change: $Author: thb $ $Date: 2006-07-12 22:47:21 $ + * last change: $Author: thb $ $Date: 2006-07-13 12:03:26 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -248,7 +248,7 @@ public: CPPUNIT_ASSERT_MESSAGE("get/setPixel roundtrip #10", pDevice->getPixel(aPt) == aCol4); - const Color aCol5(0x0F0F0F0F); + const Color aCol5(0x0F3F2F1F); pDevice->setPixel( aPt2, aCol5, DrawMode_PAINT ); CPPUNIT_ASSERT_MESSAGE("get/setPixel roundtrip #11", pDevice->getPixel(aPt2) == aCol5); @@ -257,6 +257,11 @@ public: pDevice->setPixel( aPt3, aCol6, DrawMode_PAINT ); CPPUNIT_ASSERT_MESSAGE("get/setPixel roundtrip #12", pDevice->getPixel(aPt3) == aCol6); + + CPPUNIT_ASSERT_MESSAGE("raw pixel value #4", + pDevice->getBuffer()[2] == 0x3F + && pDevice->getBuffer()[1] == 0x2F + && pDevice->getBuffer()[0] == 0x1F); } // 32bpp diff --git a/basebmp/test/bmpmasktest.cxx b/basebmp/test/bmpmasktest.cxx index a42bb4f82d8e..3b9575979510 100644 --- a/basebmp/test/bmpmasktest.cxx +++ b/basebmp/test/bmpmasktest.cxx @@ -4,9 +4,9 @@ * * $RCSfile: bmpmasktest.cxx,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: thb $ $Date: 2006-07-12 15:09:45 $ + * last change: $Author: thb $ $Date: 2006-07-13 12:03:26 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -139,14 +139,15 @@ public: basegfx::B2DPolyPolygon aPoly; basegfx::tools::importFromSvgD( aPoly, aSvg ); - const Color aCol(0xFFFFFFFF); + const Color aColWhite(0xFFFFFFFF); + const Color aColBlack(0); mpBmp1bpp->fillPolyPolygon( aPoly, - aCol, + aColWhite, DrawMode_PAINT ); mpBmp32bpp->fillPolyPolygon( aPoly, - aCol, + aColWhite, DrawMode_PAINT ); aSvg = ::rtl::OUString::createFromAscii( @@ -154,9 +155,10 @@ public: aPoly.clear(); basegfx::tools::importFromSvgD( aPoly, aSvg ); + mpMaskBmp1bpp->clear(aColWhite); mpMaskBmp1bpp->fillPolyPolygon( aPoly, - aCol, + aColBlack, DrawMode_PAINT ); } diff --git a/basebmp/test/cliptest.cxx b/basebmp/test/cliptest.cxx index 38e6797c13c1..eec3dd1bf339 100644 --- a/basebmp/test/cliptest.cxx +++ b/basebmp/test/cliptest.cxx @@ -4,9 +4,9 @@ * * $RCSfile: cliptest.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: thb $ $Date: 2006-07-12 22:47:21 $ + * last change: $Author: thb $ $Date: 2006-07-13 12:03:26 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -208,10 +208,10 @@ public: "m 0 0 h5 l5 5 v5 h-5 l-5-5 z" ); basegfx::B2DPolyPolygon aPoly; basegfx::tools::importFromSvgD( aPoly, aSvg ); - mpClipMask->clear(Color(0xFFFFFFFF)); + mpClipMask->clear(Color(0)); mpClipMask->drawPolygon( aPoly.getB2DPolygon(0), - Color(0), + Color(0xFFFFFFFF), DrawMode_PAINT ); } |