Commit 04036b2b authored by Sven Langkamp's avatar Sven Langkamp

added a unittest where bltMask fails

svn path=/trunk/koffice/; revision=689390
parent 7faaa3b4
......@@ -168,6 +168,43 @@ void KisPainterTest::testPaintDeviceBltMaskIrregular()
allCsApplicator( &KisPainterTest::testPaintDeviceBltMaskIrregular );
}
void KisPainterTest::testPaintDeviceBltMaskInverted(KoColorSpace * cs)
{
KisPaintDeviceSP dst = new KisPaintDevice( cs, "dst");
KisPaintDeviceSP src = new KisPaintDevice( cs, "src" );
src->fill( 0, 0, 30, 30, KoColor( Qt::red, 128, cs ).data() );
QCOMPARE( src->exactBounds(), QRect( 0, 0, 30, 30 ) );
KisPixelSelectionSP mask = KisPixelSelectionSP(new KisPixelSelection(dst));
mask->select(QRect(10,10,20,20));
mask->invert();
QCOMPARE( mask->selectedExactRect(), QRect( 10, 10, 20, 20 ) );
KisPainter painter(dst);
painter.bltMask(0, 0,
dst->colorSpace()->compositeOp(COMPOSITE_OVER),
src,
mask,
OPACITY_OPAQUE,
0, 0, 30, 30);
painter.end();
QImage img = dst->convertToQImage(0);
img.save( "bla_" + cs->name() + ".png" );
QCOMPARE( dst->exactBounds(), QRect( 0, 0, 30, 30 ) );
}
void KisPainterTest::testPaintDeviceBltMaskInverted()
{
allCsApplicator( &KisPainterTest::testPaintDeviceBltMaskInverted );
}
void KisPainterTest::testSelectionBltMask()
{
......
......@@ -31,6 +31,7 @@ private:
void allCsApplicator(void (KisPainterTest::* funcPtr)( KoColorSpace*cs ) );
void testPaintDeviceBltMask( KoColorSpace * cs );
void testPaintDeviceBltMaskIrregular( KoColorSpace * cs );
void testPaintDeviceBltMaskInverted( KoColorSpace * cs );
......@@ -38,6 +39,7 @@ private slots:
void testPaintDeviceBltMask(); // Square selection
void testPaintDeviceBltMaskIrregular(); // Irregular selection
void testPaintDeviceBltMaskInverted(); // Inverted selection
void testSelectionBltMask(); // Square selection
void testSelectionBltMaskIrregular(); // Irregular selection
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment