/hg/gfx-test: 2012-01-20 Pavel Tisnovsky <ptisnovs at redhat.com>
ptisnovs at icedtea.classpath.org
ptisnovs at icedtea.classpath.org
Fri Jan 20 01:17:27 PST 2012
changeset d20f41c8e71d in /hg/gfx-test
details: http://icedtea.classpath.org/hg/gfx-test?cmd=changeset;node=d20f41c8e71d
author: Pavel Tisnovsky <ptisnovs at redhat.com>
date: Fri Jan 20 10:19:51 2012 +0100
2012-01-20 Pavel Tisnovsky <ptisnovs at redhat.com>
* src/org/gfxtest/framework/CommonBitmapOperations.java:
* src/org/gfxtest/testsuites/BitBltBasicTests.java: Added
new tests which use new pattern types provided by class
ImageFactory.
diffstat:
ChangeLog | 7 +
src/org/gfxtest/framework/CommonBitmapOperations.java | 147 ++++++++++++++++++
src/org/gfxtest/testsuites/BitBltBasicTests.java | 80 +++++++++-
3 files changed, 232 insertions(+), 2 deletions(-)
diffs (372 lines):
diff -r 2ca9bcc1fb0c -r d20f41c8e71d ChangeLog
--- a/ChangeLog Thu Jan 19 12:52:36 2012 +0100
+++ b/ChangeLog Fri Jan 20 10:19:51 2012 +0100
@@ -1,3 +1,10 @@
+2012-01-20 Pavel Tisnovsky <ptisnovs at redhat.com>
+
+ * src/org/gfxtest/framework/CommonBitmapOperations.java:
+ * src/org/gfxtest/testsuites/BitBltBasicTests.java:
+ Added new tests which use new pattern types provided by
+ class ImageFactory.
+
2012-01-19 Pavel Tisnovsky <ptisnovs at redhat.com>
* src/org/gfxtest/framework/ColorPalette.java:
diff -r 2ca9bcc1fb0c -r d20f41c8e71d src/org/gfxtest/framework/CommonBitmapOperations.java
--- a/src/org/gfxtest/framework/CommonBitmapOperations.java Thu Jan 19 12:52:36 2012 +0100
+++ b/src/org/gfxtest/framework/CommonBitmapOperations.java Fri Jan 20 10:19:51 2012 +0100
@@ -132,6 +132,7 @@
{
return TestResult.FAILED;
}
+ // BitBlt with 1:1 scaling
return BitBlt(bufferedImage, image, graphics2d) ? TestResult.PASSED : TestResult.FAILED;
}
@@ -147,12 +148,14 @@
*/
public static TestResult doBitBltTestWithCheckerImage(TestImage image, Graphics2D graphics2d, int imageType)
{
+ // create image with given pattern
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
return BitBlt(bufferedImage, image, graphics2d) ? TestResult.PASSED : TestResult.FAILED;
}
@@ -168,12 +171,14 @@
*/
public static TestResult doBitBltTestWithCheckerImage(TestImage image, Graphics2D graphics2d, int imageType, int width, int height)
{
+ // create image with given pattern
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 custom scaling
return BitBlt(bufferedImage, image, graphics2d, width, height) ? TestResult.PASSED : TestResult.FAILED;
}
@@ -189,12 +194,14 @@
*/
public static TestResult doBitBltTestWithDiagonalCheckerImage(TestImage image, Graphics2D graphics2d, int imageType)
{
+ // create image with given pattern
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
return BitBlt(bufferedImage, image, graphics2d) ? TestResult.PASSED : TestResult.FAILED;
}
@@ -210,12 +217,14 @@
*/
public static TestResult doBitBltTestWithDiagonalCheckerImage(TestImage image, Graphics2D graphics2d, int imageType, int width, int height)
{
+ // create image with given pattern
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 custom scaling
return BitBlt(bufferedImage, image, graphics2d, width, height) ? TestResult.PASSED : TestResult.FAILED;
}
@@ -231,12 +240,14 @@
*/
public static TestResult doBitBltTestWithGridImage(TestImage image, Graphics2D graphics2d, int imageType)
{
+ // create image with given 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
return BitBlt(bufferedImage, image, graphics2d) ? TestResult.PASSED : TestResult.FAILED;
}
@@ -252,12 +263,14 @@
*/
public static TestResult doBitBltTestWithGridImage(TestImage image, Graphics2D graphics2d, int imageType, int width, int height)
{
+ // create image with given 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 custom scaling
return BitBlt(bufferedImage, image, graphics2d, width, height) ? TestResult.PASSED : TestResult.FAILED;
}
@@ -273,12 +286,14 @@
*/
public static TestResult doBitBltTestWithDiagonalGridImage(TestImage image, Graphics2D graphics2d, int imageType)
{
+ // create image with given 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
return BitBlt(bufferedImage, image, graphics2d) ? TestResult.PASSED : TestResult.FAILED;
}
@@ -294,12 +309,144 @@
*/
public static TestResult doBitBltTestWithDiagonalGridImage(TestImage image, Graphics2D graphics2d, int imageType, int width, int height)
{
+ // create image with given 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 custom scaling
+ return BitBlt(bufferedImage, image, graphics2d, width, height) ? TestResult.PASSED : TestResult.FAILED;
+ }
+
+ public static TestResult doBitBltTestWithHorizontalStripesImage(TestImage image, Graphics2D graphics2d, int imageType)
+ {
+ // create image with given pattern
+ BufferedImage bufferedImage = ImageFactory.createHorizontalStripesImage(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
+ return BitBlt(bufferedImage, image, graphics2d) ? TestResult.PASSED : TestResult.FAILED;
+ }
+
+ public static TestResult doBitBltTestWithHorizontalStripesImage(TestImage image, Graphics2D graphics2d, int imageType, int width, int height)
+ {
+ // create image with given pattern
+ BufferedImage bufferedImage = ImageFactory.createHorizontalStripesImage(DEFAULT_TEST_IMAGE_WIDTH, DEFAULT_TEST_IMAGE_HEIGHT, imageType);
+ // basic check if buffered image was created
+ if (bufferedImage == null)
+ {
+ return TestResult.FAILED;
+ }
+ // BitBlt with custom scaling
+ return BitBlt(bufferedImage, image, graphics2d, width, height) ? TestResult.PASSED : TestResult.FAILED;
+ }
+
+ public static TestResult doBitBltTestWithVerticalStripesImage(TestImage image, Graphics2D graphics2d, int imageType)
+ {
+ // create image with given pattern
+ BufferedImage bufferedImage = ImageFactory.createVerticalStripesImage(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
+ return BitBlt(bufferedImage, image, graphics2d) ? TestResult.PASSED : TestResult.FAILED;
+ }
+
+ public static TestResult doBitBltTestWithVerticalStripesImage(TestImage image, Graphics2D graphics2d, int imageType, int width, int height)
+ {
+ // create image with given pattern
+ BufferedImage bufferedImage = ImageFactory.createVerticalStripesImage(DEFAULT_TEST_IMAGE_WIDTH, DEFAULT_TEST_IMAGE_HEIGHT, imageType);
+ // basic check if buffered image was created
+ if (bufferedImage == null)
+ {
+ return TestResult.FAILED;
+ }
+ // BitBlt with custom scaling
+ return BitBlt(bufferedImage, image, graphics2d, width, height) ? TestResult.PASSED : TestResult.FAILED;
+ }
+
+ public static TestResult doBitBltTestWithDiagonalStripesImage(TestImage image, Graphics2D graphics2d, int imageType)
+ {
+ // create image with given pattern
+ BufferedImage bufferedImage = ImageFactory.createDiagonalStripesImage(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
+ return BitBlt(bufferedImage, image, graphics2d) ? TestResult.PASSED : TestResult.FAILED;
+ }
+
+ public static TestResult doBitBltTestWithDiagonalStripesImage(TestImage image, Graphics2D graphics2d, int imageType, int width, int height)
+ {
+ // create image with given pattern
+ BufferedImage bufferedImage = ImageFactory.createDiagonalStripesImage(DEFAULT_TEST_IMAGE_WIDTH, DEFAULT_TEST_IMAGE_HEIGHT, imageType);
+ // basic check if buffered image was created
+ if (bufferedImage == null)
+ {
+ return TestResult.FAILED;
+ }
+ // BitBlt with custom scaling
+ return BitBlt(bufferedImage, image, graphics2d, width, height) ? TestResult.PASSED : TestResult.FAILED;
+ }
+
+ public static TestResult doBitBltTestWithHorizontalColorStripesImage(TestImage image, Graphics2D graphics2d, int imageType)
+ {
+ // create image with given pattern
+ BufferedImage bufferedImage = ImageFactory.createHorizontalColorStripesImage(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
+ return BitBlt(bufferedImage, image, graphics2d) ? TestResult.PASSED : TestResult.FAILED;
+ }
+
+ public static TestResult doBitBltTestWithHorizontalColorStripesImage(TestImage image, Graphics2D graphics2d, int imageType, int width, int height)
+ {
+ // create image with given pattern
+ BufferedImage bufferedImage = ImageFactory.createHorizontalColorStripesImage(DEFAULT_TEST_IMAGE_WIDTH, DEFAULT_TEST_IMAGE_HEIGHT, imageType);
+ // basic check if buffered image was created
+ if (bufferedImage == null)
+ {
+ return TestResult.FAILED;
+ }
+ // BitBlt with custom scaling
+ return BitBlt(bufferedImage, image, graphics2d, width, height) ? TestResult.PASSED : TestResult.FAILED;
+ }
+
+ public static TestResult doBitBltTestWithVerticalColorStripesImage(TestImage image, Graphics2D graphics2d, int imageType)
+ {
+ // create image with given pattern
+ BufferedImage bufferedImage = ImageFactory.createVerticalColorStripesImage(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
+ return BitBlt(bufferedImage, image, graphics2d) ? TestResult.PASSED : TestResult.FAILED;
+ }
+
+ public static TestResult doBitBltTestWithVerticalColorStripesImage(TestImage image, Graphics2D graphics2d, int imageType, int width, int height)
+ {
+ // create image with given pattern
+ BufferedImage bufferedImage = ImageFactory.createVerticalColorStripesImage(DEFAULT_TEST_IMAGE_WIDTH, DEFAULT_TEST_IMAGE_HEIGHT, imageType);
+ // basic check if buffered image was created
+ if (bufferedImage == null)
+ {
+ return TestResult.FAILED;
+ }
+ // BitBlt with custom scaling
return BitBlt(bufferedImage, image, graphics2d, width, height) ? TestResult.PASSED : TestResult.FAILED;
}
}
diff -r 2ca9bcc1fb0c -r d20f41c8e71d src/org/gfxtest/testsuites/BitBltBasicTests.java
--- a/src/org/gfxtest/testsuites/BitBltBasicTests.java Thu Jan 19 12:52:36 2012 +0100
+++ b/src/org/gfxtest/testsuites/BitBltBasicTests.java Fri Jan 20 10:19:51 2012 +0100
@@ -425,8 +425,9 @@
}
/**
- * Test basic BitBlt operation for diagonal grid buffered image with type TYPE_BYTE_BINARY.
- *
+ * Test basic BitBlt operation for diagonal grid buffered image with type
+ * TYPE_BYTE_BINARY.
+ *
* @param image
* image to which line is to be drawn
* @param graphics2d
@@ -439,6 +440,81 @@
}
/**
+ * Test basic BitBlt operation for horizontal stripes buffered image with
+ * type TYPE_BYTE_BINARY.
+ *
+ * @param image
+ * image to which line is to be drawn
+ * @param graphics2d
+ * graphics canvas
+ * @return
+ */
+ public TestResult testBitBltHorizontalStripesBufferedImageTypeByteBinary(TestImage image, Graphics2D graphics2d)
+ {
+ return CommonBitmapOperations.doBitBltTestWithHorizontalStripesImage(image, graphics2d, BufferedImage.TYPE_BYTE_BINARY);
+ }
+
+ /**
+ * Test basic BitBlt operation for vertical stripes buffered image with type
+ * TYPE_BYTE_BINARY.
+ *
+ * @param image
+ * image to which line is to be drawn
+ * @param graphics2d
+ * graphics canvas
+ * @return
+ */
+ public TestResult testBitBltVerticalStripesBufferedImageTypeByteBinary(TestImage image, Graphics2D graphics2d)
+ {
+ return CommonBitmapOperations.doBitBltTestWithVerticalStripesImage(image, graphics2d, BufferedImage.TYPE_BYTE_BINARY);
+ }
+
+ /**
+ * Test basic BitBlt operation for diagonal stripes buffered image with type
+ * TYPE_BYTE_BINARY.
+ *
+ * @param image
+ * image to which line is to be drawn
+ * @param graphics2d
+ * graphics canvas
+ * @return
+ */
+ public TestResult testBitBltDiagonalStripesBufferedImageTypeByteBinary(TestImage image, Graphics2D graphics2d)
+ {
+ return CommonBitmapOperations.doBitBltTestWithDiagonalStripesImage(image, graphics2d, BufferedImage.TYPE_BYTE_BINARY);
+ }
+
+ /**
+ * Test basic BitBlt operation for horizontal color stripes buffered image
+ * with type TYPE_BYTE_BINARY.
+ *
+ * @param image
+ * image to which line is to be drawn
+ * @param graphics2d
+ * graphics canvas
+ * @return
+ */
+ public TestResult testBitBltHorizontalColorStripesBufferedImageTypeByteBinary(TestImage image, Graphics2D graphics2d)
+ {
+ return CommonBitmapOperations.doBitBltTestWithHorizontalColorStripesImage(image, graphics2d, BufferedImage.TYPE_BYTE_BINARY);
+ }
+
+ /**
+ * Test basic BitBlt operation for vertical color stripes buffered image
+ * with type TYPE_BYTE_BINARY.
+ *
+ * @param image
+ * image to which line is to be drawn
+ * @param graphics2d
+ * graphics canvas
+ * @return
+ */
+ public TestResult testBitBltVerticalColorStripesBufferedImageTypeByteBinary(TestImage image, Graphics2D graphics2d)
+ {
+ return CommonBitmapOperations.doBitBltTestWithVerticalColorStripesImage(image, graphics2d, BufferedImage.TYPE_BYTE_BINARY);
+ }
+
+ /**
* Entry point to the test suite.
*
* @param args not used in this case
More information about the distro-pkg-dev
mailing list