/hg/gfx-test: Eight new methods used by several gfx. tests added...

ptisnovs at icedtea.classpath.org ptisnovs at icedtea.classpath.org
Fri Jun 21 03:11:18 PDT 2013


changeset bc102f07b264 in /hg/gfx-test
details: http://icedtea.classpath.org/hg/gfx-test?cmd=changeset;node=bc102f07b264
author: Pavel Tisnovsky <ptisnovs at redhat.com>
date: Fri Jun 21 12:14:47 2013 +0200

	Eight new methods used by several gfx. tests added into CommonBitmapOperations.


diffstat:

 ChangeLog                                             |    5 +
 src/org/gfxtest/framework/CommonBitmapOperations.java |  216 ++++++++++++++++++
 2 files changed, 221 insertions(+), 0 deletions(-)

diffs (287 lines):

diff -r 6be1d654c48d -r bc102f07b264 ChangeLog
--- a/ChangeLog	Thu Jun 20 11:11:32 2013 +0200
+++ b/ChangeLog	Fri Jun 21 12:14:47 2013 +0200
@@ -1,3 +1,8 @@
+2013-06-21  Pavel Tisnovsky  <ptisnovs at redhat.com>
+
+	* src/org/gfxtest/framework/CommonBitmapOperations.java:
+	Eight new methods used by several gfx. tests.
+
 2013-06-20  Pavel Tisnovsky  <ptisnovs at redhat.com>
 
 	* src/org/gfxtest/testsuites/BitBltUsingBgColor.java:
diff -r 6be1d654c48d -r bc102f07b264 src/org/gfxtest/framework/CommonBitmapOperations.java
--- a/src/org/gfxtest/framework/CommonBitmapOperations.java	Thu Jun 20 11:11:32 2013 +0200
+++ b/src/org/gfxtest/framework/CommonBitmapOperations.java	Fri Jun 21 12:14:47 2013 +0200
@@ -974,6 +974,33 @@
     }
 
     /**
+     * Create new buffered image containing black and white horizontal stripes
+     * 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 doBitBltTestWithHorizontalStripesImage(TestImage image, Graphics2D graphics2d, int imageType, BufferedImageOp rop)
+    {
+        // create new buffered bitmap with given type
+        // bitmap should contains checker 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, 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 vertical stripes then perform basic BitBlt test.
      *
      * @param image
@@ -1026,6 +1053,33 @@
     }
 
     /**
+     * Create new buffered image containing black and white vertical stripes
+     * 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 doBitBltTestWithVerticalStripesImage(TestImage image, Graphics2D graphics2d, int imageType, BufferedImageOp rop)
+    {
+        // create new buffered bitmap with given type
+        // bitmap should contains checker 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, 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 diagonal stripes then perform basic BitBlt test.
      *
      * @param image
@@ -1078,6 +1132,33 @@
     }
 
     /**
+     * Create new buffered image containing black and white diagonal stripes
+     * 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 doBitBltTestWithDiagonalStripesImage(TestImage image, Graphics2D graphics2d, int imageType, BufferedImageOp rop)
+    {
+        // create new buffered bitmap with given type
+        // bitmap should contains checker 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, no flipping and no cropping and using RescaleOp
+        return BitBltOperations.performBitBlt(bufferedImage, image, graphics2d, rop) ? TestResult.PASSED : TestResult.FAILED;
+    }
+
+    /**
      * Create new buffered image containing horizontal color stripes and then
      * perform basic BitBlt test.
      * 
@@ -1132,6 +1213,33 @@
     }
 
     /**
+     * Create new buffered image containing horizontal color stripes 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 doBitBltTestWithHorizontalColorStripesImage(TestImage image, Graphics2D graphics2d, int imageType, BufferedImageOp rop)
+    {
+        // create new buffered bitmap with given type
+        // bitmap should contains checker 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, no flipping and no cropping and using RescaleOp
+        return BitBltOperations.performBitBlt(bufferedImage, image, graphics2d, rop) ? TestResult.PASSED : TestResult.FAILED;
+    }
+
+    /**
      * Create new buffered image containing vertical color stripes and then
      * perform basic BitBlt test.
      * 
@@ -1186,6 +1294,33 @@
     }
 
     /**
+     * Create new buffered image containing vertical color stripes 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 doBitBltTestWithVerticalColorStripesImage(TestImage image, Graphics2D graphics2d, int imageType, BufferedImageOp rop)
+    {
+        // create new buffered bitmap with given type
+        // bitmap should contains checker 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, 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 color stripes and then
      * perform basic BitBlt test.
      * 
@@ -1240,6 +1375,33 @@
     }
 
     /**
+     * Create new buffered image containing diagonal color stripes 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 doBitBltTestWithDiagonalColorStripesImage(TestImage image, Graphics2D graphics2d, int imageType, BufferedImageOp rop)
+    {
+        // create new buffered bitmap with given type
+        // bitmap should contains checker pattern
+        BufferedImage bufferedImage = ImageFactory.createDiagonalColorStripesImage(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 dot pattern and then
      * perform basic BitBlt test.
      * 
@@ -1294,6 +1456,33 @@
     }
 
     /**
+     * Create new buffered image containing black and white dot 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 doBitBltTestWithBWDotsImage(TestImage image, Graphics2D graphics2d, int imageType, BufferedImageOp rop)
+    {
+        // create new buffered bitmap with given type
+        // bitmap should contains checker pattern
+        BufferedImage bufferedImage = ImageFactory.createBWDotsPatternImage(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 color dot pattern and then perform basic BitBlt test.
      *
      * @param image
@@ -1348,6 +1537,33 @@
     }
 
     /**
+     * Create new buffered image containing color dot 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 doBitBltTestWithColorDotsImage(TestImage image, Graphics2D graphics2d, int imageType, BufferedImageOp rop)
+    {
+        // create new buffered bitmap with given type
+        // bitmap should contains checker pattern
+        BufferedImage bufferedImage = ImageFactory.createColorDotsPatternImage(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 horizontal grayscale gradient and then perform basic BitBlt test.
      *
      * @param image



More information about the distro-pkg-dev mailing list