/hg/gfx-test: Helper methods added into CommonBitmapOperations.j...

ptisnovs at icedtea.classpath.org ptisnovs at icedtea.classpath.org
Fri Jan 25 01:39:06 PST 2013


changeset dcf8661a53c2 in /hg/gfx-test
details: http://icedtea.classpath.org/hg/gfx-test?cmd=changeset;node=dcf8661a53c2
author: Pavel Tisnovsky <ptisnovs at redhat.com>
date: Fri Jan 25 10:42:12 2013 +0100

	Helper methods added into CommonBitmapOperations.java.


diffstat:

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

diffs (132 lines):

diff -r 29cdf3ddd67e -r dcf8661a53c2 ChangeLog
--- a/ChangeLog	Tue Jan 22 09:49:31 2013 +0100
+++ b/ChangeLog	Fri Jan 25 10:42:12 2013 +0100
@@ -1,3 +1,8 @@
+2013-01-25  Pavel Tisnovsky  <ptisnovs at redhat.com>
+
+	* src/org/gfxtest/framework/CommonBitmapOperations.java:
+	Helper methods added into CommonBitmapOperations.java.
+
 2013-01-22  Pavel Tisnovsky  <ptisnovs at redhat.com>
 
 	* src/org/gfxtest/framework/ImageFactory.java:
diff -r 29cdf3ddd67e -r dcf8661a53c2 src/org/gfxtest/framework/CommonBitmapOperations.java
--- a/src/org/gfxtest/framework/CommonBitmapOperations.java	Tue Jan 22 09:49:31 2013 +0100
+++ b/src/org/gfxtest/framework/CommonBitmapOperations.java	Fri Jan 25 10:42:12 2013 +0100
@@ -1552,7 +1552,7 @@
      * @param height
      *            height of a image after BitBlt operation is performed
      */
-    public static TestResult doBitBltTestWithHorizontalredGradientImage(TestImage image, Graphics2D graphics2d, int imageType,
+    public static TestResult doBitBltTestWithHorizontalRedGradientImage(TestImage image, Graphics2D graphics2d, int imageType,
                     int width, int height)
     {
         // create new buffered bitmap with given type
@@ -1618,4 +1618,107 @@
         return performBitBlt(bufferedImage, image, graphics2d, width, height) ? TestResult.PASSED : TestResult.FAILED;
     }
 
+    /**
+     * Create new buffered image containing horizontal blue 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
+     */
+    public static TestResult doBitBltTestWithHorizontalBlueGradientImage(TestImage image, Graphics2D graphics2d, int imageType)
+    {
+        // create new buffered bitmap with given type
+        BufferedImage bufferedImage = ImageFactory.createHorizontalBlueGradientImage(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 performBitBlt(bufferedImage, image, graphics2d) ? TestResult.PASSED : TestResult.FAILED;
+    }
+
+    /**
+     * Create new buffered image containing horizontal blue 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 width
+     *            width of a image after BitBlt operation is performed
+     * @param height
+     *            height of a image after BitBlt operation is performed
+     */
+    public static TestResult doBitBltTestWithHorizontalBlueGradientImage(TestImage image, Graphics2D graphics2d, int imageType,
+                    int width, int height)
+    {
+        // create new buffered bitmap with given type
+        BufferedImage bufferedImage = ImageFactory.createHorizontalBlueGradientImage(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 performBitBlt(bufferedImage, image, graphics2d, width, height) ? TestResult.PASSED : TestResult.FAILED;
+    }
+
+    /**
+     * Create new buffered image containing vertical blue 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
+     */
+    public static TestResult doBitBltTestWithVerticalBlueGradientImage(TestImage image, Graphics2D graphics2d, int imageType)
+    {
+        // create new buffered bitmap with given type
+        BufferedImage bufferedImage = ImageFactory.createVerticalBlueGradientImage(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 performBitBlt(bufferedImage, image, graphics2d) ? TestResult.PASSED : TestResult.FAILED;
+    }
+
+    /**
+     * Create new buffered image containing vertical blue 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 width
+     *            width of a image after BitBlt operation is performed
+     * @param height
+     *            height of a image after BitBlt operation is performed
+     */
+    public static TestResult doBitBltTestWithVerticalBlueGradientImage(TestImage image, Graphics2D graphics2d, int imageType,
+                    int width, int height)
+    {
+        // create new buffered bitmap with given type
+        BufferedImage bufferedImage = ImageFactory.createVerticalBlueGradientImage(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 performBitBlt(bufferedImage, image, graphics2d, width, height) ? TestResult.PASSED : TestResult.FAILED;
+    }
 }



More information about the distro-pkg-dev mailing list