/hg/gfx-test: src/org/gfxtest/testsuites/BitBltUsingBgColorAlpha...

ptisnovs at icedtea.classpath.org ptisnovs at icedtea.classpath.org
Fri Dec 14 01:26:51 PST 2012


changeset cb9c34f9d39a in /hg/gfx-test
details: http://icedtea.classpath.org/hg/gfx-test?cmd=changeset;node=cb9c34f9d39a
author: Pavel Tisnovsky <ptisnovs at redhat.com>
date: Fri Dec 14 10:29:53 2012 +0100

	src/org/gfxtest/testsuites/BitBltUsingBgColorAlpha.java: Fixed alpha
	color computation. Added five new tests to this test suite.


diffstat:

 ChangeLog                                               |   6 +
 src/org/gfxtest/testsuites/BitBltUsingBgColorAlpha.java |  81 ++++++++++++++++-
 2 files changed, 84 insertions(+), 3 deletions(-)

diffs (111 lines):

diff -r 9c43ef8b6cd6 -r cb9c34f9d39a ChangeLog
--- a/ChangeLog	Thu Dec 13 10:39:57 2012 +0100
+++ b/ChangeLog	Fri Dec 14 10:29:53 2012 +0100
@@ -1,3 +1,9 @@
+2012-12-14  Pavel Tisnovsky  <ptisnovs at redhat.com>
+
+	* src/org/gfxtest/testsuites/BitBltUsingBgColorAlpha.java:
+	Fixed alpha color computation. Added five new tests to this test
+	suite.
+
 2012-12-13  Pavel Tisnovsky  <ptisnovs at redhat.com>
 
 	* src/org/gfxtest/testsuites/BitBltUsingBgColor.java:
diff -r 9c43ef8b6cd6 -r cb9c34f9d39a src/org/gfxtest/testsuites/BitBltUsingBgColorAlpha.java
--- a/src/org/gfxtest/testsuites/BitBltUsingBgColorAlpha.java	Thu Dec 13 10:39:57 2012 +0100
+++ b/src/org/gfxtest/testsuites/BitBltUsingBgColorAlpha.java	Fri Dec 14 10:29:53 2012 +0100
@@ -110,9 +110,9 @@
      */
     private Color calculateTransparentColor(Color backgroundColor, float alpha)
     {
-        final float red = backgroundColor.getRed();
-        final float green = backgroundColor.getGreen();
-        final float blue = backgroundColor.getBlue();
+        final float red = backgroundColor.getRed() / 255.0f;
+        final float green = backgroundColor.getGreen() / 255.0f;
+        final float blue = backgroundColor.getBlue() / 255.0f;
         return new Color(red, green, blue, alpha);
     }
 
@@ -192,6 +192,81 @@
     }
 
     /**
+     * Test basic BitBlt operation for empty buffered image with type TYPE_3BYTE_BGR.
+     * Background color is set to Color.red.
+     *
+     * @param image
+     *            image to used as a destination for BitBlt-type operations
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testBitBltEmptyBufferedImageType3ByteBGRbackgroundRedAlpha000(TestImage image, Graphics2D graphics2d)
+    {
+        return doBitBltEmptyBufferedImageType3ByteRGB(image, graphics2d, Color.red, 0.0f);
+    }
+
+    /**
+     * Test basic BitBlt operation for empty buffered image with type TYPE_3BYTE_BGR.
+     * Background color is set to Color.red.
+     *
+     * @param image
+     *            image to used as a destination for BitBlt-type operations
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testBitBltEmptyBufferedImageType3ByteBGRbackgroundRedAlpha025(TestImage image, Graphics2D graphics2d)
+    {
+        return doBitBltEmptyBufferedImageType3ByteRGB(image, graphics2d, Color.red, 0.25f);
+    }
+
+    /**
+     * Test basic BitBlt operation for empty buffered image with type TYPE_3BYTE_BGR.
+     * Background color is set to Color.red.
+     *
+     * @param image
+     *            image to used as a destination for BitBlt-type operations
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testBitBltEmptyBufferedImageType3ByteBGRbackgroundRedAlpha050(TestImage image, Graphics2D graphics2d)
+    {
+        return doBitBltEmptyBufferedImageType3ByteRGB(image, graphics2d, Color.red, 0.5f);
+    }
+
+    /**
+     * Test basic BitBlt operation for empty buffered image with type TYPE_3BYTE_BGR.
+     * Background color is set to Color.red.
+     *
+     * @param image
+     *            image to used as a destination for BitBlt-type operations
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testBitBltEmptyBufferedImageType3ByteBGRbackgroundRedAlpha075(TestImage image, Graphics2D graphics2d)
+    {
+        return doBitBltEmptyBufferedImageType3ByteRGB(image, graphics2d, Color.red, 0.75f);
+    }
+
+    /**
+     * Test basic BitBlt operation for empty buffered image with type TYPE_3BYTE_BGR.
+     * Background color is set to Color.red.
+     *
+     * @param image
+     *            image to used as a destination for BitBlt-type operations
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testBitBltEmptyBufferedImageType3ByteBGRbackgroundRedAlpha100(TestImage image, Graphics2D graphics2d)
+    {
+        return doBitBltEmptyBufferedImageType3ByteRGB(image, graphics2d, Color.red, 1.00f);
+    }
+
+    /**
      * Entry point to the test suite.
      *
      * @param args not used in this case



More information about the distro-pkg-dev mailing list