/hg/gfx-test: New method used by several gfx. tests added into C...
ptisnovs at icedtea.classpath.org
ptisnovs at icedtea.classpath.org
Thu Jun 6 00:36:37 PDT 2013
changeset ad011872d058 in /hg/gfx-test
details: http://icedtea.classpath.org/hg/gfx-test?cmd=changeset;node=ad011872d058
author: Pavel Tisnovsky <ptisnovs at redhat.com>
date: Wed Jun 05 15:38:12 2013 +0200
New method used by several gfx. tests added into CommonBitmapOperations,
six new tests added into BitBltBasicTests test suite.
diffstat:
ChangeLog | 7 +
src/org/gfxtest/framework/CommonBitmapOperations.java | 28 +++++-
src/org/gfxtest/testsuites/BitBltBasicTests.java | 90 +++++++++++++++++++
3 files changed, 124 insertions(+), 1 deletions(-)
diffs (159 lines):
diff -r 423cbdb30284 -r ad011872d058 ChangeLog
--- a/ChangeLog Wed Jun 05 10:28:26 2013 +0200
+++ b/ChangeLog Wed Jun 05 15:38:12 2013 +0200
@@ -1,3 +1,10 @@
+2013-06-06 Pavel Tisnovsky <ptisnovs at redhat.com>
+
+ * src/org/gfxtest/framework/CommonBitmapOperations.java:
+ New method used by several gfx. tests.
+ * src/org/gfxtest/testsuites/BitBltBasicTests.java:
+ Six new tests added into BitBltBasicTests test suite.
+
2013-06-05 Pavel Tisnovsky <ptisnovs at redhat.com>
* src/org/gfxtest/testsuites/BitBltCropImage.java:
diff -r 423cbdb30284 -r ad011872d058 src/org/gfxtest/framework/CommonBitmapOperations.java
--- a/src/org/gfxtest/framework/CommonBitmapOperations.java Wed Jun 05 10:28:26 2013 +0200
+++ b/src/org/gfxtest/framework/CommonBitmapOperations.java Wed Jun 05 15:38:12 2013 +0200
@@ -370,7 +370,7 @@
// 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.
*
@@ -509,6 +509,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 doBitBltTestWithDiagonalCheckerImage(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.createDiagonalCheckerImage(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 diagonal checker pattern and then perform basic BitBlt test.
*
* @param image
diff -r 423cbdb30284 -r ad011872d058 src/org/gfxtest/testsuites/BitBltBasicTests.java
--- a/src/org/gfxtest/testsuites/BitBltBasicTests.java Wed Jun 05 10:28:26 2013 +0200
+++ b/src/org/gfxtest/testsuites/BitBltBasicTests.java Wed Jun 05 15:38:12 2013 +0200
@@ -4308,6 +4308,96 @@
}
/**
+ * Test basic BitBlt operation for horizontal cyan 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 testBitBltHorizontalCyanGradientBufferedImageTypeIntRGB(TestImage image, Graphics2D graphics2d)
+ {
+ // create new buffered image and then perform basic BitBlt test.
+ return CommonBitmapOperations.doBitBltTestWithHorizontalCyanGradientImage(image, graphics2d, BufferedImage.TYPE_INT_RGB);
+ }
+
+ /**
+ * Test basic BitBlt operation for horizontal cyan 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 testBitBltHorizontalCyanGradientBufferedImageTypeIntARGB(TestImage image, Graphics2D graphics2d)
+ {
+ // create new buffered image and then perform basic BitBlt test.
+ return CommonBitmapOperations.doBitBltTestWithHorizontalCyanGradientImage(image, graphics2d, BufferedImage.TYPE_INT_ARGB);
+ }
+
+ /**
+ * Test basic BitBlt operation for horizontal cyan 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 testBitBltHorizontalCyanGradientBufferedImageTypeIntARGB_Pre(TestImage image, Graphics2D graphics2d)
+ {
+ // create new buffered image and then perform basic BitBlt test.
+ return CommonBitmapOperations.doBitBltTestWithHorizontalCyanGradientImage(image, graphics2d, BufferedImage.TYPE_INT_ARGB_PRE);
+ }
+
+ /**
+ * Test basic BitBlt operation for horizontal cyan 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 testBitBltHorizontalCyanGradientBufferedImageTypeUshort555RGB(TestImage image, Graphics2D graphics2d)
+ {
+ // create new buffered image and then perform basic BitBlt test.
+ return CommonBitmapOperations.doBitBltTestWithHorizontalCyanGradientImage(image, graphics2d, BufferedImage.TYPE_USHORT_555_RGB);
+ }
+
+ /**
+ * Test basic BitBlt operation for horizontal cyan 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 testBitBltHorizontalCyanGradientBufferedImageTypeUshort565RGB(TestImage image, Graphics2D graphics2d)
+ {
+ // create new buffered image and then perform basic BitBlt test.
+ return CommonBitmapOperations.doBitBltTestWithHorizontalCyanGradientImage(image, graphics2d, BufferedImage.TYPE_USHORT_565_RGB);
+ }
+
+ /**
+ * Test basic BitBlt operation for horizontal cyan 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 testBitBltHorizontalCyanGradientBufferedImageTypeUshortGray(TestImage image, Graphics2D graphics2d)
+ {
+ // create new buffered image and then perform basic BitBlt test.
+ return CommonBitmapOperations.doBitBltTestWithHorizontalCyanGradientImage(image, graphics2d, BufferedImage.TYPE_USHORT_GRAY);
+ }
+
+ /**
* Entry point to the test suite.
*
* @param args not used in this case
More information about the distro-pkg-dev
mailing list