summaryrefslogtreecommitdiffstats
path: root/basebmp/test
diff options
context:
space:
mode:
authorThorsten Behrens <thb@openoffice.org>2006-06-30 10:05:21 +0000
committerThorsten Behrens <thb@openoffice.org>2006-06-30 10:05:21 +0000
commit6928d01f7a4cff47b6c6b186885ac79a58e64ac6 (patch)
treece21bc8872116bf43c87f614d6faafe6a810677d /basebmp/test
parentnew version for SRC680 (diff)
downloadcore-6928d01f7a4cff47b6c6b186885ac79a58e64ac6.tar.gz
core-6928d01f7a4cff47b6c6b186885ac79a58e64ac6.zip
#i65904# Fixed ugly typos in clippedLine clipping; improved docs; added testcases for fixed bugs; corrected clip bounds for line and polyline rendering
Diffstat (limited to 'basebmp/test')
-rw-r--r--basebmp/test/basictest.cxx16
-rw-r--r--basebmp/test/bmpdemo.cxx19
2 files changed, 27 insertions, 8 deletions
diff --git a/basebmp/test/basictest.cxx b/basebmp/test/basictest.cxx
index 893fdae489d9..8126dfd18f99 100644
--- a/basebmp/test/basictest.cxx
+++ b/basebmp/test/basictest.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: basictest.cxx,v $
*
- * $Revision: 1.5 $
+ * $Revision: 1.6 $
*
- * last change: $Author: thb $ $Date: 2006-06-28 16:50:19 $
+ * last change: $Author: thb $ $Date: 2006-06-30 11:05:21 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -119,7 +119,7 @@ public:
void testPixelFuncs()
{
// 1bpp
- const basegfx::B2ISize aSize(101,101);
+ const basegfx::B2ISize aSize(64,64);
BitmapDeviceSharedPtr pDevice( createBitmapDevice( aSize,
true,
Format::ONE_BIT_MSB_PAL ));
@@ -142,11 +142,21 @@ public:
CPPUNIT_ASSERT_MESSAGE("get/setPixel roundtrip #3",
pDevice->getPixel(aPt3) == aCol3);
+ pDevice->setPixel( aPt3, aCol2, DrawMode_PAINT );
+ CPPUNIT_ASSERT_MESSAGE("get/setPixel roundtrip #3.5",
+ pDevice->getPixel(aPt3) == aCol2);
+
const basegfx::B2IPoint aPt4(-100000,-100000);
pDevice->setPixel( aPt4, aCol3, DrawMode_PAINT );
const basegfx::B2IPoint aPt5(100000,100000);
pDevice->setPixel( aPt5, aCol3, DrawMode_PAINT );
+ sal_Int32 nPixel(countPixel(pDevice, aCol2));
+ const basegfx::B2IPoint aPt6(aSize.getX(),aSize.getY());
+ pDevice->setPixel( aPt6, aCol2, DrawMode_PAINT );
+ CPPUNIT_ASSERT_MESSAGE("setPixel clipping",
+ countPixel(pDevice, aCol2) == nPixel);
+
// 8bit alpha
{
pDevice = createBitmapDevice( aSize,
diff --git a/basebmp/test/bmpdemo.cxx b/basebmp/test/bmpdemo.cxx
index 1a0b3d4512c4..8f699dc05a18 100644
--- a/basebmp/test/bmpdemo.cxx
+++ b/basebmp/test/bmpdemo.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: bmpdemo.cxx,v $
*
- * $Revision: 1.8 $
+ * $Revision: 1.9 $
*
- * last change: $Author: thb $ $Date: 2006-06-28 16:50:19 $
+ * last change: $Author: thb $ $Date: 2006-06-30 11:05:21 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -1078,14 +1078,23 @@ void TestWindow::Paint( const Rectangle& rRect )
{
basegfx::B2ISize aTestSize(1000,1000);
basebmp::BitmapDeviceSharedPtr pDevice( basebmp::createBitmapDevice( aTestSize,
- true,
+ false,
basebmp::Format::THIRTYTWO_BIT_TC_MASK ));
{
- const basegfx::B2IPoint aPt1(0,0);
- const basegfx::B2IPoint aPt2(1,9);
const basebmp::Color aCol(0xFFFFFFFF);
+#if 0
+ basegfx::B2DPolygon aRect = basegfx::tools::createPolygonFromRect(
+ basegfx::B2DRange( 0,0,1001,1001 ));
+ pDevice->drawPolygon( aRect, aCol, basebmp::DrawMode_PAINT );
+#endif
+
+ const basegfx::B2IPoint aPt1(0,0);
+ const basegfx::B2IPoint aPt2(0,800);
pDevice->drawLine( aPt1, aPt2, aCol, basebmp::DrawMode_PAINT );
+
+ const basegfx::B2IPoint aPt3(0,1001);
+ pDevice->drawLine( aPt1, aPt3, aCol, basebmp::DrawMode_PAINT );
}
{