/hg/gfx-test: Fixed typos in JavaDoc, added two helper methods i...
ptisnovs at icedtea.classpath.org
ptisnovs at icedtea.classpath.org
Thu Apr 11 02:30:25 PDT 2013
changeset 010bd56c0282 in /hg/gfx-test
details: http://icedtea.classpath.org/hg/gfx-test?cmd=changeset;node=010bd56c0282
author: Pavel Tisnovsky <ptisnovs at redhat.com>
date: Thu Apr 11 11:33:40 2013 +0200
Fixed typos in JavaDoc, added two helper methods into CommonBitmapOperations.
Added helper methods into the test suite BitBltConvolveOp.
diffstat:
ChangeLog | 8 ++
src/org/gfxtest/framework/CommonBitmapOperations.java | 62 +++++++++++++++++-
src/org/gfxtest/testsuites/BitBltConvolveOp.java | 36 +++++++++++
3 files changed, 102 insertions(+), 4 deletions(-)
diffs (168 lines):
diff -r 2b45cb03da1d -r 010bd56c0282 ChangeLog
--- a/ChangeLog Wed Apr 10 09:57:28 2013 +0200
+++ b/ChangeLog Thu Apr 11 11:33:40 2013 +0200
@@ -1,3 +1,11 @@
+2013-04-11 Pavel Tisnovsky <ptisnovs at redhat.com>
+
+ * src/org/gfxtest/framework/CommonBitmapOperations.java:
+ Fixed typos in JavaDoc, added two helper methods into
+ CommonBitmapOperations.
+ * src/org/gfxtest/testsuites/BitBltConvolveOp.java:
+ Added helper methods into the test suite BitBltConvolveOp.
+
2013-04-10 Pavel Tisnovsky <ptisnovs at redhat.com>
* src/org/gfxtest/framework/CommonRenderingStyles.java:
diff -r 2b45cb03da1d -r 010bd56c0282 src/org/gfxtest/framework/CommonBitmapOperations.java
--- a/src/org/gfxtest/framework/CommonBitmapOperations.java Wed Apr 10 09:57:28 2013 +0200
+++ b/src/org/gfxtest/framework/CommonBitmapOperations.java Thu Apr 11 11:33:40 2013 +0200
@@ -674,7 +674,7 @@
}
/**
- * Create new buffered image containing diagonal checker pattern and then perform
+ * Create new buffered image containing grid pattern and then perform
* basic BitBlt test.
*
* @param image
@@ -704,7 +704,7 @@
}
/**
- * Create new buffered image containing diagonal checker pattern and then perform
+ * Create new buffered image containing grid pattern and then perform
* basic BitBlt test.
*
* @param image
@@ -732,6 +732,33 @@
}
/**
+ * Create new buffered image containing grid pattern 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 rop
+ * selected raster operation
+ */
+ public static TestResult doBitBltTestWithGridImage(TestImage image, Graphics2D graphics2d, int imageType, BufferedImageOp rop)
+ {
+ // create new buffered bitmap with given type
+ // bitmap should contains checker pattern
+ BufferedImage bufferedImage = ImageFactory.createGridImage(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 and using RescaleOp
+ return BitBltOperations.performBitBlt(bufferedImage, image, graphics2d, rop) ? TestResult.PASSED : TestResult.FAILED;
+ }
+
+ /**
* Create new buffered image containing diagonal grid pattern and then perform basic BitBlt test.
*
* @param image
@@ -784,7 +811,7 @@
}
/**
- * Create new buffered image containing diagonal checker pattern and then perform
+ * Create new buffered image containing diagonal grid pattern and then perform
* basic BitBlt test.
*
* @param image
@@ -814,7 +841,7 @@
}
/**
- * Create new buffered image containing diagonal checker pattern and then perform
+ * Create new buffered image containing diagonal grid pattern and then perform
* basic BitBlt test.
*
* @param image
@@ -842,6 +869,33 @@
}
/**
+ * Create new buffered image containing grid pattern 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 rop
+ * selected raster operation
+ */
+ public static TestResult doBitBltTestWithDiagonalGridImage(TestImage image, Graphics2D graphics2d, int imageType, BufferedImageOp rop)
+ {
+ // create new buffered bitmap with given type
+ // bitmap should contains checker pattern
+ BufferedImage bufferedImage = ImageFactory.createDiagonalGridImage(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 and using RescaleOp
+ return BitBltOperations.performBitBlt(bufferedImage, image, graphics2d, rop) ? TestResult.PASSED : TestResult.FAILED;
+ }
+
+ /**
* Create new buffered image containing black and white horizontal stripes then perform basic BitBlt test.
*
* @param image
diff -r 2b45cb03da1d -r 010bd56c0282 src/org/gfxtest/testsuites/BitBltConvolveOp.java
--- a/src/org/gfxtest/testsuites/BitBltConvolveOp.java Wed Apr 10 09:57:28 2013 +0200
+++ b/src/org/gfxtest/testsuites/BitBltConvolveOp.java Thu Apr 11 11:33:40 2013 +0200
@@ -153,6 +153,42 @@
}
/**
+ * Test basic BitBlt operation for buffered image containing grid pattern
+ * with type TYPE_3BYTE_BGR
+ *
+ * @param image
+ * image used as a destination for BitBlt-type operations
+ * @param graphics2d
+ * graphics canvas
+ * @param rasterOp
+ * selected raster operation
+ * @return test result status - PASSED, FAILED or ERROR
+ */
+ private TestResult doBitBltGridBufferedImageType3ByteRGB(TestImage image, Graphics2D graphics2d,
+ BufferedImageOp rasterOp)
+ {
+ return CommonBitmapOperations.doBitBltTestWithGridImage(image, graphics2d, BufferedImage.TYPE_3BYTE_BGR, rasterOp);
+ }
+
+ /**
+ * Test basic BitBlt operation for buffered image containing diagonal grid pattern
+ * with type TYPE_3BYTE_BGR
+ *
+ * @param image
+ * image used as a destination for BitBlt-type operations
+ * @param graphics2d
+ * graphics canvas
+ * @param rasterOp
+ * selected raster operation
+ * @return test result status - PASSED, FAILED or ERROR
+ */
+ private TestResult doBitBltDiagonalGridBufferedImageType3ByteRGB(TestImage image, Graphics2D graphics2d,
+ BufferedImageOp rasterOp)
+ {
+ return CommonBitmapOperations.doBitBltTestWithDiagonalGridImage(image, graphics2d, BufferedImage.TYPE_3BYTE_BGR, rasterOp);
+ }
+
+ /**
* Test basic BitBlt operation for empty buffered image with type TYPE_3BYTE_BGR.
*
* @param image
More information about the distro-pkg-dev
mailing list