/hg/gfx-test: Yet another five new helper methods added into Com...

ptisnovs at icedtea.classpath.org ptisnovs at icedtea.classpath.org
Thu Jul 3 07:23:40 UTC 2014


changeset 82e38b9fae09 in /hg/gfx-test
details: http://icedtea.classpath.org/hg/gfx-test?cmd=changeset;node=82e38b9fae09
author: Pavel Tisnovsky <ptisnovs at redhat.com>
date: Thu Jul 03 09:24:33 2014 +0200

	Yet another five new helper methods added into CommonBitmapOperations.


diffstat:

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

diffs (175 lines):

diff -r fd8732d7d493 -r 82e38b9fae09 ChangeLog
--- a/ChangeLog	Wed Jul 02 11:54:25 2014 +0200
+++ b/ChangeLog	Thu Jul 03 09:24:33 2014 +0200
@@ -1,3 +1,8 @@
+2014-07-02  Pavel Tisnovsky  <ptisnovs at redhat.com>
+
+	* src/org/gfxtest/framework/CommonBitmapOperations.java:
+	Yet another five new helper methods added into CommonBitmapOperations.
+
 2014-07-02  Pavel Tisnovsky  <ptisnovs at redhat.com>
 
 	* src/org/gfxtest/framework/CommonBitmapOperations.java:
diff -r fd8732d7d493 -r 82e38b9fae09 src/org/gfxtest/framework/CommonBitmapOperations.java
--- a/src/org/gfxtest/framework/CommonBitmapOperations.java	Wed Jul 02 11:54:25 2014 +0200
+++ b/src/org/gfxtest/framework/CommonBitmapOperations.java	Thu Jul 03 09:24:33 2014 +0200
@@ -3417,6 +3417,31 @@
     }
 
     /**
+     * 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 bgcolor
+     *            background color
+     */
+    public static TestResult doBitBltTestWithRGBTexture2Image(TestImage image, Graphics2D graphics2d, int imageType, Color bgcolor)
+    {
+        // 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
+        return BitBltOperations.performBitBlt(bufferedImage, image, graphics2d, bgcolor) ? TestResult.PASSED : TestResult.FAILED;
+    }
+
+    /**
      * Create new buffered image containing RGB pattern #2 and then perform
      * basic BitBlt test.
      * 
@@ -3499,6 +3524,31 @@
     }
 
     /**
+     * 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 bgcolor
+     *            background color
+     */
+    public static TestResult doBitBltTestWithRGBTexture3Image(TestImage image, Graphics2D graphics2d, int imageType, Color bgcolor)
+    {
+        // 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
+        return BitBltOperations.performBitBlt(bufferedImage, image, graphics2d, bgcolor) ? TestResult.PASSED : TestResult.FAILED;
+    }
+
+    /**
      * Create new buffered image containing RGB pattern #3 and then perform
      * basic BitBlt test.
      * 
@@ -3581,6 +3631,31 @@
     }
 
     /**
+     * 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 bgcolor
+     *            background color
+     */
+    public static TestResult doBitBltTestWithRGBTexture4Image(TestImage image, Graphics2D graphics2d, int imageType, Color bgcolor)
+    {
+        // 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
+        return BitBltOperations.performBitBlt(bufferedImage, image, graphics2d, bgcolor) ? TestResult.PASSED : TestResult.FAILED;
+    }
+
+    /**
      * Create new buffered image containing RGB pattern #4 and then perform
      * basic BitBlt test.
      * 
@@ -3663,6 +3738,31 @@
     }
 
     /**
+     * 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 bgcolor
+     *            background color
+     */
+    public static TestResult doBitBltTestWithRGBTexture5Image(TestImage image, Graphics2D graphics2d, int imageType, Color bgcolor)
+    {
+        // 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
+        return BitBltOperations.performBitBlt(bufferedImage, image, graphics2d, bgcolor) ? TestResult.PASSED : TestResult.FAILED;
+    }
+
+    /**
      * Create new buffered image containing RGB pattern #5 and then perform
      * basic BitBlt test.
      * 
@@ -3745,6 +3845,31 @@
     }
 
     /**
+     * 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 bgcolor
+     *            background color
+     */
+    public static TestResult doBitBltTestWithRGBTexture6Image(TestImage image, Graphics2D graphics2d, int imageType, Color bgcolor)
+    {
+        // 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
+        return BitBltOperations.performBitBlt(bufferedImage, image, graphics2d, bgcolor) ? TestResult.PASSED : TestResult.FAILED;
+    }
+
+    /**
      * Create new buffered image containing RGB pattern #6 and then perform
      * basic BitBlt test.
      * 


More information about the distro-pkg-dev mailing list