/hg/gfx-test: Eleven helper methods added into CommonBitmapOpera...

ptisnovs at icedtea.classpath.org ptisnovs at icedtea.classpath.org
Mon May 5 08:45:39 UTC 2014


changeset 6a0991824cdb in /hg/gfx-test
details: http://icedtea.classpath.org/hg/gfx-test?cmd=changeset;node=6a0991824cdb
author: Pavel Tisnovsky <ptisnovs at redhat.com>
date: Mon May 05 10:46:18 2014 +0200

	Eleven helper methods added into CommonBitmapOperations.


diffstat:

 ChangeLog                                             |    5 +
 src/org/gfxtest/framework/CommonBitmapOperations.java |  325 +++++++++++++++++-
 2 files changed, 329 insertions(+), 1 deletions(-)

diffs (422 lines):

diff -r 32c273c0ef64 -r 6a0991824cdb ChangeLog
--- a/ChangeLog	Fri May 02 09:46:53 2014 +0200
+++ b/ChangeLog	Mon May 05 10:46:18 2014 +0200
@@ -1,3 +1,8 @@
+2014-05-05  Pavel Tisnovsky  <ptisnovs at redhat.com>
+
+	* src/org/gfxtest/framework/CommonBitmapOperations.java:
+	Eleven helper methods added into CommonBitmapOperations.
+
 2014-05-01  Pavel Tisnovsky  <ptisnovs at redhat.com>
 
 	* src/org/gfxtest/testsuites/CAGOperationsOnChordAndRectangle.java:
diff -r 32c273c0ef64 -r 6a0991824cdb src/org/gfxtest/framework/CommonBitmapOperations.java
--- a/src/org/gfxtest/framework/CommonBitmapOperations.java	Fri May 02 09:46:53 2014 +0200
+++ b/src/org/gfxtest/framework/CommonBitmapOperations.java	Mon May 05 10:46:18 2014 +0200
@@ -2300,6 +2300,33 @@
     }
 
     /**
+     * Create new buffered image containing horizontal yellow gradient 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 doBitBltTestWithHorizontalYellowGradientImage(TestImage image, Graphics2D graphics2d, int imageType, BufferedImageOp rop)
+    {
+        // create new buffered bitmap with given type
+        // bitmap should contains checker pattern
+        BufferedImage bufferedImage = ImageFactory.createHorizontalYellowGradientImage(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 yellow gradient and then perform basic BitBlt test.
      *
      * @param image
@@ -2352,6 +2379,33 @@
     }
 
     /**
+     * Create new buffered image containing vertical yellow gradient 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 doBitBltTestWithVerticalYellowGradientImage(TestImage image, Graphics2D graphics2d, int imageType, BufferedImageOp rop)
+    {
+        // create new buffered bitmap with given type
+        // bitmap should contains checker pattern
+        BufferedImage bufferedImage = ImageFactory.createVerticalYellowGradientImage(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 magenta gradient and then perform basic BitBlt test.
      *
      * @param image
@@ -2404,6 +2458,33 @@
     }
 
     /**
+     * Create new buffered image containing horizontal magenta gradient 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 doBitBltTestWithHorizontalMagentaGradientImage(TestImage image, Graphics2D graphics2d, int imageType, BufferedImageOp rop)
+    {
+        // create new buffered bitmap with given type
+        // bitmap should contains checker pattern
+        BufferedImage bufferedImage = ImageFactory.createHorizontalMagentaGradientImage(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 magenta gradient and then perform basic BitBlt test.
      *
      * @param image
@@ -2456,6 +2537,33 @@
     }
 
     /**
+     * Create new buffered image containing vertical magenta gradient 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 doBitBltTestWithVerticalMagentaGradientImage(TestImage image, Graphics2D graphics2d, int imageType, BufferedImageOp rop)
+    {
+        // create new buffered bitmap with given type
+        // bitmap should contains checker pattern
+        BufferedImage bufferedImage = ImageFactory.createVerticalMagentaGradientImage(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 cyan gradient and then perform basic BitBlt test.
      *
      * @param image
@@ -2508,6 +2616,33 @@
     }
 
     /**
+     * Create new buffered image containing horizontal cyan gradient 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 doBitBltTestWithHorizontalCyanGradientImage(TestImage image, Graphics2D graphics2d, int imageType, BufferedImageOp rop)
+    {
+        // create new buffered bitmap with given type
+        // bitmap should contains checker pattern
+        BufferedImage bufferedImage = ImageFactory.createHorizontalCyanGradientImage(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 cyan gradient and then perform basic BitBlt test.
      *
      * @param image
@@ -2560,6 +2695,33 @@
     }
 
     /**
+     * Create new buffered image containing vertical cyan gradient 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 doBitBltTestWithVerticalCyanGradientImage(TestImage image, Graphics2D graphics2d, int imageType, BufferedImageOp rop)
+    {
+        // create new buffered bitmap with given type
+        // bitmap should contains checker pattern
+        BufferedImage bufferedImage = ImageFactory.createVerticalCyanGradientImage(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 RGB pattern #1 and then perform
      * basic BitBlt test.
      * 
@@ -2615,6 +2777,33 @@
     }
 
     /**
+     * Create new buffered image containing RGB pattern #1 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 doBitBltTestWithRGBTexture1Image(TestImage image, Graphics2D graphics2d, int imageType, BufferedImageOp rop)
+    {
+        // create new buffered bitmap with given type
+        BufferedImage bufferedImage = ProceduralTextureFactory.createRGBTexture1(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 RGB pattern #2 and then perform
      * basic BitBlt test.
      * 
@@ -2670,6 +2859,33 @@
     }
 
     /**
+     * Create new buffered image containing RGB pattern #2 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 doBitBltTestWithRGBTexture2Image(TestImage image, Graphics2D graphics2d, int imageType, BufferedImageOp rop)
+    {
+        // create new buffered bitmap with given type
+        BufferedImage bufferedImage = ProceduralTextureFactory.createRGBTexture2(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 RGB pattern #3 and then perform
      * basic BitBlt test.
      * 
@@ -2725,6 +2941,33 @@
     }
 
     /**
+     * Create new buffered image containing RGB pattern #3 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 doBitBltTestWithRGBTexture3Image(TestImage image, Graphics2D graphics2d, int imageType, BufferedImageOp rop)
+    {
+        // create new buffered bitmap with given type
+        BufferedImage bufferedImage = ProceduralTextureFactory.createRGBTexture3(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 RGB pattern #4 and then perform
      * basic BitBlt test.
      * 
@@ -2780,6 +3023,33 @@
     }
 
     /**
+     * Create new buffered image containing RGB pattern #4 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 doBitBltTestWithRGBTexture4Image(TestImage image, Graphics2D graphics2d, int imageType, BufferedImageOp rop)
+    {
+        // create new buffered bitmap with given type
+        BufferedImage bufferedImage = ProceduralTextureFactory.createRGBTexture4(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 RGB pattern #5 and then perform
      * basic BitBlt test.
      * 
@@ -2835,6 +3105,33 @@
     }
 
     /**
+     * Create new buffered image containing RGB pattern #5 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 doBitBltTestWithRGBTexture5Image(TestImage image, Graphics2D graphics2d, int imageType, BufferedImageOp rop)
+    {
+        // create new buffered bitmap with given type
+        BufferedImage bufferedImage = ProceduralTextureFactory.createRGBTexture5(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 RGB pattern #6 and then perform
      * basic BitBlt test.
      * 
@@ -2889,5 +3186,31 @@
         return BitBltOperations.performBitBlt(bufferedImage, image, graphics2d, width, height) ? TestResult.PASSED : TestResult.FAILED;
     }
 
+    /**
+     * Create new buffered image containing RGB pattern #6 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 doBitBltTestWithRGBTexture6Image(TestImage image, Graphics2D graphics2d, int imageType, BufferedImageOp rop)
+    {
+        // create new buffered bitmap with given type
+        BufferedImage bufferedImage = ProceduralTextureFactory.createRGBTexture6(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;
+    }
+
 }
-


More information about the distro-pkg-dev mailing list