diff options
-rw-r--r-- | vcl/qa/cppunit/bitmaprender/BitmapRenderTest.cxx | 27 | ||||
-rw-r--r-- | vcl/qa/cppunit/bitmaprender/data/ImageRGBA.png | bin | 0 -> 106 bytes |
2 files changed, 27 insertions, 0 deletions
diff --git a/vcl/qa/cppunit/bitmaprender/BitmapRenderTest.cxx b/vcl/qa/cppunit/bitmaprender/BitmapRenderTest.cxx index b6f2dbbd3d99..e770f1a4cc86 100644 --- a/vcl/qa/cppunit/bitmaprender/BitmapRenderTest.cxx +++ b/vcl/qa/cppunit/bitmaprender/BitmapRenderTest.cxx @@ -19,6 +19,7 @@ #include <vcl/pngwrite.hxx> #include <vcl/graphicfilter.hxx> +#include <vcl/filter/PngImageReader.hxx> static OUString const gaDataUrl = "/vcl/qa/cppunit/bitmaprender/data/"; @@ -37,10 +38,13 @@ public: void testTdf104141(); void testTdf113918(); + void testDrawBitmap32(); CPPUNIT_TEST_SUITE(BitmapRenderTest); CPPUNIT_TEST(testTdf104141); CPPUNIT_TEST(testTdf113918); + CPPUNIT_TEST(testDrawBitmap32); + CPPUNIT_TEST_SUITE_END(); }; @@ -95,6 +99,29 @@ void BitmapRenderTest::testTdf113918() CPPUNIT_ASSERT(aColor.GetGreen() > 100); } +void BitmapRenderTest::testDrawBitmap32() +{ + ScopedVclPtrInstance<VirtualDevice> pVDev; + pVDev->SetOutputSizePixel(Size(8, 8)); + pVDev->SetBackground(Wallpaper(COL_WHITE)); + pVDev->Erase(); + + CPPUNIT_ASSERT_EQUAL(COL_WHITE, pVDev->GetPixel(Point(0, 0))); + CPPUNIT_ASSERT_EQUAL(COL_WHITE, pVDev->GetPixel(Point(1, 1))); + CPPUNIT_ASSERT_EQUAL(COL_WHITE, pVDev->GetPixel(Point(2, 2))); + + SvFileStream aFileStream(getFullUrl("ImageRGBA.png"), StreamMode::READ); + + vcl::PngImageReader aPngReader(aFileStream); + BitmapEx aBitmapEx; + aPngReader.read(aBitmapEx); + pVDev->DrawBitmapEx(Point(), aBitmapEx); + + CPPUNIT_ASSERT_EQUAL(COL_WHITE, pVDev->GetPixel(Point(0, 0))); + CPPUNIT_ASSERT_EQUAL(COL_YELLOW, pVDev->GetPixel(Point(1, 1))); + CPPUNIT_ASSERT_EQUAL(Color(0x00, 0x7F, 0xFF, 0x7F), pVDev->GetPixel(Point(2, 2))); +} + CPPUNIT_TEST_SUITE_REGISTRATION(BitmapRenderTest); CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/vcl/qa/cppunit/bitmaprender/data/ImageRGBA.png b/vcl/qa/cppunit/bitmaprender/data/ImageRGBA.png Binary files differnew file mode 100644 index 000000000000..7a8399293c94 --- /dev/null +++ b/vcl/qa/cppunit/bitmaprender/data/ImageRGBA.png |