/hg/gfx-test: Twelve new tests added into the test suite BitBltB...
ptisnovs at icedtea.classpath.org
ptisnovs at icedtea.classpath.org
Tue Apr 9 00:44:32 PDT 2013
changeset 186560e3aa5e in /hg/gfx-test
details: http://icedtea.classpath.org/hg/gfx-test?cmd=changeset;node=186560e3aa5e
author: Pavel Tisnovsky <ptisnovs at redhat.com>
date: Tue Apr 09 09:47:49 2013 +0200
Twelve new tests added into the test suite BitBltBasicTests.
One helper method used by various BitBlt-related tests added into
CommonBitmapOperations.
diffstat:
ChangeLog | 7 +
src/org/gfxtest/framework/CommonBitmapOperations.java | 26 ++
src/org/gfxtest/testsuites/BitBltBasicTests.java | 181 ++++++++++++++++++
3 files changed, 214 insertions(+), 0 deletions(-)
diffs (248 lines):
diff -r 381ff1eacb01 -r 186560e3aa5e ChangeLog
--- a/ChangeLog Mon Apr 08 10:45:15 2013 +0200
+++ b/ChangeLog Tue Apr 09 09:47:49 2013 +0200
@@ -1,3 +1,10 @@
+2013-04-09 Pavel Tisnovsky <ptisnovs at redhat.com>
+
+ * src/org/gfxtest/framework/CommonBitmapOperations.java:
+ One helper method used by various BitBlt-related tests added.
+ * src/org/gfxtest/testsuites/BitBltBasicTests.java:
+ Twelve new tests added into the test suite BitBltBasicTests.
+
2013-04-08 Pavel Tisnovsky <ptisnovs at redhat.com>
* src/org/gfxtest/testsuites/BitBltUsingBgColor.java:
diff -r 381ff1eacb01 -r 186560e3aa5e src/org/gfxtest/framework/CommonBitmapOperations.java
--- a/src/org/gfxtest/framework/CommonBitmapOperations.java Mon Apr 08 10:45:15 2013 +0200
+++ b/src/org/gfxtest/framework/CommonBitmapOperations.java Tue Apr 09 09:47:49 2013 +0200
@@ -346,6 +346,32 @@
}
/**
+ * Create new buffered image and then perform basic BitBlt test.
+ *
+ * @param image
+ * image to which another image is to be drawn
+ * @param graphics2d
+ * graphics canvas
+ * @param imageType
+ * type of the created image
+ * @param bgcolor
+ * background color
+ */
+ public static TestResult doBitBltTestWithCheckerImage(TestImage image, Graphics2D graphics2d, int imageType, Color bgcolor)
+ {
+ // create new buffered bitmap with given type
+ // bitmap should be empty - solid color pixels
+ BufferedImage bufferedImage = ImageFactory.createCheckerImage(GRID_SIZE, DEFAULT_TEST_IMAGE_WIDTH, DEFAULT_TEST_IMAGE_HEIGHT, imageType);
+ // basic check if buffered image was created
+ if (bufferedImage == null)
+ {
+ return TestResult.FAILED;
+ }
+ // BitBlt with 1:1 scaling, no flipping and no cropping
+ return BitBltOperations.performBitBlt(bufferedImage, image, graphics2d, bgcolor) ? TestResult.PASSED : TestResult.FAILED;
+ }
+
+ /**
* Create new buffered image containing checker pattern and then perform basic BitBlt test.
*
* @param image
diff -r 381ff1eacb01 -r 186560e3aa5e src/org/gfxtest/testsuites/BitBltBasicTests.java
--- a/src/org/gfxtest/testsuites/BitBltBasicTests.java Mon Apr 08 10:45:15 2013 +0200
+++ b/src/org/gfxtest/testsuites/BitBltBasicTests.java Tue Apr 09 09:47:49 2013 +0200
@@ -3019,6 +3019,51 @@
}
/**
+ * Test basic BitBlt operation for horizontal red gradient buffered image with type TYPE_3BYTE_BGR.
+ *
+ * @param image
+ * image used as a destination for BitBlt-type operations
+ * @param graphics2d
+ * graphics canvas
+ * @return test result status - PASSED, FAILED or ERROR
+ */
+ public TestResult testBitBltHorizontalRedGradientBufferedImageType3ByteBGR(TestImage image, Graphics2D graphics2d)
+ {
+ // create new buffered image and then perform basic BitBlt test.
+ return CommonBitmapOperations.doBitBltTestWithHorizontalRedGradientImage(image, graphics2d, BufferedImage.TYPE_3BYTE_BGR);
+ }
+
+ /**
+ * Test basic BitBlt operation for horizontal red gradient buffered image with type TYPE_4BYTE_ABGR.
+ *
+ * @param image
+ * image used as a destination for BitBlt-type operations
+ * @param graphics2d
+ * graphics canvas
+ * @return test result status - PASSED, FAILED or ERROR
+ */
+ public TestResult testBitBltHorizontalRedGradientBufferedImageType4ByteABGR(TestImage image, Graphics2D graphics2d)
+ {
+ // create new buffered image and then perform basic BitBlt test.
+ return CommonBitmapOperations.doBitBltTestWithHorizontalRedGradientImage(image, graphics2d, BufferedImage.TYPE_4BYTE_ABGR);
+ }
+
+ /**
+ * Test basic BitBlt operation for horizontal red gradient buffered image with type TYPE_4BYTE_ABGR_PRE.
+ *
+ * @param image
+ * image used as a destination for BitBlt-type operations
+ * @param graphics2d
+ * graphics canvas
+ * @return test result status - PASSED, FAILED or ERROR
+ */
+ public TestResult testBitBltHorizontalRedGradientBufferedImageType4ByteABGR_PRE(TestImage image, Graphics2D graphics2d)
+ {
+ // create new buffered image and then perform basic BitBlt test.
+ return CommonBitmapOperations.doBitBltTestWithHorizontalRedGradientImage(image, graphics2d, BufferedImage.TYPE_4BYTE_ABGR_PRE);
+ }
+
+ /**
* Test basic BitBlt operation for horizontal red gradient buffered image
* with type TYPE_BYTE_BINARY.
*
@@ -3035,6 +3080,142 @@
}
/**
+ * Test basic BitBlt operation for horizontal red gradient buffered image
+ * with type TYPE_BYTE_INDEXED.
+ *
+ * @param image
+ * image used as a destination for BitBlt-type operations
+ * @param graphics2d
+ * graphics canvas
+ * @return test result status - PASSED, FAILED or ERROR
+ */
+ public TestResult testBitBltHorizontalRedGradientBufferedImageTypeByteIndexed(TestImage image, Graphics2D graphics2d)
+ {
+ // create new buffered image and then perform basic BitBlt test.
+ return CommonBitmapOperations.doBitBltTestWithHorizontalRedGradientImage(image, graphics2d, BufferedImage.TYPE_BYTE_INDEXED);
+ }
+
+ /**
+ * Test basic BitBlt operation for horizontal red gradient buffered image with type TYPE_BYTE_GRAY.
+ *
+ * @param image
+ * image used as a destination for BitBlt-type operations
+ * @param graphics2d
+ * graphics canvas
+ * @return test result status - PASSED, FAILED or ERROR
+ */
+ public TestResult testBitBltHorizontalRedGradientBufferedImageTypeByteGray(TestImage image, Graphics2D graphics2d)
+ {
+ // create new buffered image and then perform basic BitBlt test.
+ return CommonBitmapOperations.doBitBltTestWithHorizontalRedGradientImage(image, graphics2d, BufferedImage.TYPE_BYTE_GRAY);
+ }
+
+ /**
+ * Test basic BitBlt operation for horizontal red gradient buffered image with type TYPE_INT_BGR.
+ *
+ * @param image
+ * image used as a destination for BitBlt-type operations
+ * @param graphics2d
+ * graphics canvas
+ * @return test result status - PASSED, FAILED or ERROR
+ */
+ public TestResult testBitBltHorizontalRedGradientBufferedImageTypeIntBGR(TestImage image, Graphics2D graphics2d)
+ {
+ // create new buffered image and then perform basic BitBlt test.
+ return CommonBitmapOperations.doBitBltTestWithHorizontalRedGradientImage(image, graphics2d, BufferedImage.TYPE_INT_BGR);
+ }
+
+ /**
+ * Test basic BitBlt operation for horizontal red gradient buffered image with type TYPE_INT_RGB.
+ *
+ * @param image
+ * image used as a destination for BitBlt-type operations
+ * @param graphics2d
+ * graphics canvas
+ * @return test result status - PASSED, FAILED or ERROR
+ */
+ public TestResult testBitBltHorizontalRedGradientBufferedImageTypeIntRGB(TestImage image, Graphics2D graphics2d)
+ {
+ // create new buffered image and then perform basic BitBlt test.
+ return CommonBitmapOperations.doBitBltTestWithHorizontalRedGradientImage(image, graphics2d, BufferedImage.TYPE_INT_RGB);
+ }
+
+ /**
+ * Test basic BitBlt operation for horizontal red gradient buffered image with type TYPE_INT_ARGB.
+ *
+ * @param image
+ * image used as a destination for BitBlt-type operations
+ * @param graphics2d
+ * graphics canvas
+ * @return test result status - PASSED, FAILED or ERROR
+ */
+ public TestResult testBitBltHorizontalRedGradientBufferedImageTypeIntARGB(TestImage image, Graphics2D graphics2d)
+ {
+ // create new buffered image and then perform basic BitBlt test.
+ return CommonBitmapOperations.doBitBltTestWithHorizontalRedGradientImage(image, graphics2d, BufferedImage.TYPE_INT_ARGB);
+ }
+
+ /**
+ * Test basic BitBlt operation for horizontal red gradient buffered image with type TYPE_INT_ARGB_PRE.
+ *
+ * @param image
+ * image used as a destination for BitBlt-type operations
+ * @param graphics2d
+ * graphics canvas
+ * @return test result status - PASSED, FAILED or ERROR
+ */
+ public TestResult testBitBltHorizontalRedGradientBufferedImageTypeIntARGB_Pre(TestImage image, Graphics2D graphics2d)
+ {
+ // create new buffered image and then perform basic BitBlt test.
+ return CommonBitmapOperations.doBitBltTestWithHorizontalRedGradientImage(image, graphics2d, BufferedImage.TYPE_INT_ARGB_PRE);
+ }
+
+ /**
+ * Test basic BitBlt operation for horizontal red gradient buffered image with type TYPE_USHORT_555_RGB.
+ *
+ * @param image
+ * image used as a destination for BitBlt-type operations
+ * @param graphics2d
+ * graphics canvas
+ * @return test result status - PASSED, FAILED or ERROR
+ */
+ public TestResult testBitBltHorizontalRedGradientBufferedImageTypeUshort555RGB(TestImage image, Graphics2D graphics2d)
+ {
+ // create new buffered image and then perform basic BitBlt test.
+ return CommonBitmapOperations.doBitBltTestWithHorizontalRedGradientImage(image, graphics2d, BufferedImage.TYPE_USHORT_555_RGB);
+ }
+
+ /**
+ * Test basic BitBlt operation for horizontal red gradient buffered image with type TYPE_USHORT_565_RGB.
+ *
+ * @param image
+ * image used as a destination for BitBlt-type operations
+ * @param graphics2d
+ * graphics canvas
+ * @return test result status - PASSED, FAILED or ERROR
+ */
+ public TestResult testBitBltHorizontalRedGradientBufferedImageTypeUshort565RGB(TestImage image, Graphics2D graphics2d)
+ {
+ // create new buffered image and then perform basic BitBlt test.
+ return CommonBitmapOperations.doBitBltTestWithHorizontalRedGradientImage(image, graphics2d, BufferedImage.TYPE_USHORT_565_RGB);
+ }
+
+ /**
+ * Test basic BitBlt operation for horizontal red gradient buffered image with type TYPE_USHORT_GRAY.
+ *
+ * @param image
+ * image used as a destination for BitBlt-type operations
+ * @param graphics2d
+ * graphics canvas
+ * @return test result status - PASSED, FAILED or ERROR
+ */
+ public TestResult testBitBltHorizontalRedGradientBufferedImageTypeUshortGray(TestImage image, Graphics2D graphics2d)
+ {
+ // create new buffered image and then perform basic BitBlt test.
+ return CommonBitmapOperations.doBitBltTestWithHorizontalRedGradientImage(image, graphics2d, BufferedImage.TYPE_USHORT_GRAY);
+ }
+
+ /**
* Test basic BitBlt operation for vertical red gradient buffered image with type TYPE_3BYTE_BGR.
*
* @param image
More information about the distro-pkg-dev
mailing list