[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-distro-pkg-dev
Subject:    /hg/gfx-test: 2011-11-30  Pavel Tisnovsky  <ptisnovs@redhat.com>
From:       ptisnovs () icedtea ! classpath ! org (ptisnovs at icedtea ! classpath ! org)
Date:       2011-11-30 10:01:04
Message-ID: hg.f81d252641cf.1322647264.-6248649288953172555 () icedtea ! classpath ! org
[Download RAW message or body]

changeset f81d252641cf in /hg/gfx-test
details: http://icedtea.classpath.org/hg/gfx-test?cmd=changeset;node=f81d252641cf
author: Pavel Tisnovsky <ptisnovs at redhat.com>
date: Wed Nov 30 11:03:18 2011 +0100

	2011-11-30 Pavel Tisnovsky <ptisnovs at redhat.com>

	 *
	src/org/gfxtest/testsuites/ClippingCircleByEllipseShape.java:
	Refactoring and added 14 new tests to this test suite.


diffstat:

 ChangeLog                                                    |    5 +
 src/org/gfxtest/testsuites/ClippingCircleByEllipseShape.java |  349 ++++++++++-
 2 files changed, 339 insertions(+), 15 deletions(-)

diffs (401 lines):

diff -r 99792ac3c3e2 -r f81d252641cf ChangeLog
--- a/ChangeLog	Mon Nov 28 15:17:35 2011 +0100
+++ b/ChangeLog	Wed Nov 30 11:03:18 2011 +0100
@@ -1,3 +1,8 @@
+2011-11-30  Pavel Tisnovsky  <ptisnovs at redhat.com>
+
+	* src/org/gfxtest/testsuites/ClippingCircleByEllipseShape.java:
+	Refactoring and added 14 new tests to this test suite.
+
 2011-11-28  Pavel Tisnovsky  <ptisnovs at redhat.com>
 
 	* src/org/gfxtest/framework/annotations/GraphicsPrimitive.java:
diff -r 99792ac3c3e2 -r f81d252641cf \
                src/org/gfxtest/testsuites/ClippingCircleByEllipseShape.java
--- a/src/org/gfxtest/testsuites/ClippingCircleByEllipseShape.java	Mon Nov 28 \
                15:17:35 2011 +0100
+++ b/src/org/gfxtest/testsuites/ClippingCircleByEllipseShape.java	Wed Nov 30 \
11:03:18 2011 +0100 @@ -80,7 +80,7 @@
      */
     private static void basicSetupForRendering(TestImage image, Graphics2D \
graphics2d)  {
-        // create clip area
+        // create clip area which is constructed from the ellipse shape
         CommonClippingOperations.createClipUsingEllipseShape(image, graphics2d);
     }
 
@@ -119,6 +119,81 @@
     }
 
     /**
+     * Draw circle clipped by an ellipse shape. Circle is drawn using alpha
+     * paint with red color and selected transparency.
+     * 
+     * @param image
+     *            work image
+     * @param graphics2d
+     *            graphics canvas
+     * @param transparency
+     *            selected transparency (0..100 percent)
+     */
+    private void drawCircleClippedByEllipseShapeAlphaPaintRed(TestImage image, \
Graphics2D graphics2d, int transparency) +    {
+        // render clip rectangle
+        CommonClippingOperations.renderClipEllipse(image, graphics2d);
+        // set stroke color
+        CommonRenderingStyles.setStrokeColor(graphics2d);
+        // set fill color
+        CommonRenderingStyles.setTransparentFillRedColor(graphics2d, transparency);
+        // create clip area
+        CommonClippingOperations.createClipUsingEllipseShape(image, graphics2d);
+        // fill the shape
+        CommonShapesRenderer.drawFilledCircle(image, graphics2d);
+    }
+
+    /**
+     * Draw circle clipped by an ellipse shape. Circle is drawn using alpha
+     * paint with green color and selected transparency.
+     * 
+     * @param image
+     *            work image
+     * @param graphics2d
+     *            graphics canvas
+     * @param transparency
+     *            selected transparency (0..100 percent)
+     */
+    private void drawCircleClippedByEllipseShapeAlphaPaintGreen(TestImage image, \
Graphics2D graphics2d, int transparency) +    {
+        // render clip rectangle
+        CommonClippingOperations.renderClipEllipse(image, graphics2d);
+        // set stroke color
+        CommonRenderingStyles.setStrokeColor(graphics2d);
+        // set fill color
+        CommonRenderingStyles.setTransparentFillGreenColor(graphics2d, \
transparency); +        // create clip area
+        CommonClippingOperations.createClipUsingEllipseShape(image, graphics2d);
+        // fill the shape
+        CommonShapesRenderer.drawFilledCircle(image, graphics2d);
+    }
+
+    /**
+     * Draw circle clipped by an ellipse shape. Circle is drawn using alpha
+     * paint with blue color and selected transparency.
+     * 
+     * @param image
+     *            work image
+     * @param graphics2d
+     *            graphics canvas
+     * @param transparency
+     *            selected transparency (0..100 percent)
+     */
+    private void drawCircleClippedByEllipseShapeAlphaPaintBlue(TestImage image, \
Graphics2D graphics2d, int transparency) +    {
+        // render clip rectangle
+        CommonClippingOperations.renderClipEllipse(image, graphics2d);
+        // set stroke color
+        CommonRenderingStyles.setStrokeColor(graphics2d);
+        // set fill color
+        CommonRenderingStyles.setTransparentFillBlueColor(graphics2d, transparency);
+        // create clip area
+        CommonClippingOperations.createClipUsingEllipseShape(image, graphics2d);
+        // fill the shape
+        CommonShapesRenderer.drawFilledCircle(image, graphics2d);
+    }
+
+    /**
      * Check if circle shape could be clipped by an ellipse shape. Circle is
      * rendered using stroke paint.
      * 
@@ -200,9 +275,9 @@
         CommonRenderingStyles.setStrokeColor(graphics2d);
         // set fill color
         CommonRenderingStyles.setFillColor(graphics2d);
-        // create clip area
+        // create clip shape
         CommonClippingOperations.createClipUsingEllipseShape(image, graphics2d);
-        // fill the area
+        // fill the shape
         CommonShapesRenderer.drawFilledCircle(image, graphics2d);
         // test result
         return TestResult.PASSED;
@@ -210,7 +285,7 @@
 
     /**
      * Check if circle shape could be clipped by an ellipse shape. Circle is
-     * rendered using alpha paint.
+     * rendered using alpha paint with red color at 0% transparency.
      * 
      * @param image
      *            work image
@@ -218,18 +293,262 @@
      *            graphics canvas
      * @return test result status - PASSED, FAILED or ERROR
      */
-    public TestResult testClipCircleByEllipseShapeAlphaPaintBlue25(TestImage image, \
Graphics2D graphics2d) +    public TestResult \
testClipCircleByEllipseShapeAlphaPaintRed000(TestImage image, Graphics2D graphics2d)  \
                {
-        // render an ellipse which is used as a base for clip shape
-        CommonClippingOperations.renderClipEllipse(image, graphics2d);
-        // set stroke color
-        CommonRenderingStyles.setStrokeColor(graphics2d);
-        // set fill color
-        CommonRenderingStyles.setTransparentFillBlueColor(graphics2d, 25);
-        // create clip area
-        CommonClippingOperations.createClipUsingEllipseShape(image, graphics2d);
-        // fill the area
-        CommonShapesRenderer.drawFilledCircle(image, graphics2d);
+        // draw circle clipped by ellipse shape using alpha paint with 0% \
transparency +        drawCircleClippedByEllipseShapeAlphaPaintRed(image, graphics2d, \
0); +        // test result
+        return TestResult.PASSED;
+    }
+
+    /**
+     * Check if circle shape could be clipped by an ellipse shape. Circle is
+     * rendered using alpha paint with red color at 25% transparency.
+     * 
+     * @param image
+     *            work image
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testClipCircleByEllipseShapeAlphaPaintRed025(TestImage image, \
Graphics2D graphics2d) +    {
+        // draw circle clipped by ellipse shape using alpha paint with 25% \
transparency +        drawCircleClippedByEllipseShapeAlphaPaintRed(image, graphics2d, \
25); +        // test result
+        return TestResult.PASSED;
+    }
+
+    /**
+     * Check if circle shape could be clipped by an ellipse shape. Circle is
+     * rendered using alpha paint with red color at 50% transparency.
+     * 
+     * @param image
+     *            work image
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testClipCircleByEllipseShapeAlphaPaintRed050(TestImage image, \
Graphics2D graphics2d) +    {
+        // draw circle clipped by ellipse shape using alpha paint with 50% \
transparency +        drawCircleClippedByEllipseShapeAlphaPaintRed(image, graphics2d, \
50); +        // test result
+        return TestResult.PASSED;
+    }
+
+    /**
+     * Check if circle shape could be clipped by an ellipse shape. Circle is
+     * rendered using alpha paint with red color at 75% transparency.
+     * 
+     * @param image
+     *            work image
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testClipCircleByEllipseShapeAlphaPaintRed075(TestImage image, \
Graphics2D graphics2d) +    {
+        // draw circle clipped by ellipse shape using alpha paint with 75% \
transparency +        drawCircleClippedByEllipseShapeAlphaPaintRed(image, graphics2d, \
75); +        // test result
+        return TestResult.PASSED;
+    }
+
+    /**
+     * Check if circle shape could be clipped by an ellipse shape. Circle is
+     * rendered using alpha paint with red color at 100% transparency.
+     * 
+     * @param image
+     *            work image
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testClipCircleByEllipseShapeAlphaPaintRed100(TestImage image, \
Graphics2D graphics2d) +    {
+        // draw circle clipped by ellipse shape using alpha paint with 100% \
transparency +        drawCircleClippedByEllipseShapeAlphaPaintRed(image, graphics2d, \
100); +        // test result
+        return TestResult.PASSED;
+    }
+
+    /**
+     * Check if circle shape could be clipped by an ellipse shape. Circle is
+     * rendered using alpha paint with green color at 0% transparency.
+     * 
+     * @param image
+     *            work image
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testClipCircleByEllipseShapeAlphaPaintGreen000(TestImage \
image, Graphics2D graphics2d) +    {
+        // draw circle clipped by ellipse shape using alpha paint with 0% \
transparency +        drawCircleClippedByEllipseShapeAlphaPaintGreen(image, \
graphics2d, 0); +        // test result
+        return TestResult.PASSED;
+    }
+
+    /**
+     * Check if circle shape could be clipped by an ellipse shape. Circle is
+     * rendered using alpha paint with green color at 25% transparency.
+     * 
+     * @param image
+     *            work image
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testClipCircleByEllipseShapeAlphaPaintGreen025(TestImage \
image, Graphics2D graphics2d) +    {
+        // draw circle clipped by ellipse shape using alpha paint with 25% \
transparency +        drawCircleClippedByEllipseShapeAlphaPaintGreen(image, \
graphics2d, 25); +        // test result
+        return TestResult.PASSED;
+    }
+
+    /**
+     * Check if circle shape could be clipped by an ellipse shape. Circle is
+     * rendered using alpha paint with green color at 50% transparency.
+     * 
+     * @param image
+     *            work image
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testClipCircleByEllipseShapeAlphaPaintGreen050(TestImage \
image, Graphics2D graphics2d) +    {
+        // draw circle clipped by ellipse shape using alpha paint with 50% \
transparency +        drawCircleClippedByEllipseShapeAlphaPaintGreen(image, \
graphics2d, 50); +        // test result
+        return TestResult.PASSED;
+    }
+
+    /**
+     * Check if circle shape could be clipped by an ellipse shape. Circle is
+     * rendered using alpha paint with green color at 75% transparency.
+     * 
+     * @param image
+     *            work image
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testClipCircleByEllipseShapeAlphaPaintGreen075(TestImage \
image, Graphics2D graphics2d) +    {
+        // draw circle clipped by ellipse shape using alpha paint with 75% \
transparency +        drawCircleClippedByEllipseShapeAlphaPaintGreen(image, \
graphics2d, 75); +        // test result
+        return TestResult.PASSED;
+    }
+
+    /**
+     * Check if circle shape could be clipped by an ellipse shape. Circle is
+     * rendered using alpha paint with green color at 100% transparency.
+     * 
+     * @param image
+     *            work image
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testClipCircleByEllipseShapeAlphaPaintGreen100(TestImage \
image, Graphics2D graphics2d) +    {
+        // draw circle clipped by ellipse shape using alpha paint with 100% \
transparency +        drawCircleClippedByEllipseShapeAlphaPaintGreen(image, \
graphics2d, 100); +        // test result
+        return TestResult.PASSED;
+    }
+
+    /**
+     * Check if circle shape could be clipped by an ellipse shape. Circle is
+     * rendered using alpha paint with blue color at 0% transparency.
+     * 
+     * @param image
+     *            work image
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testClipCircleByEllipseShapeAlphaPaintBlue000(TestImage image, \
Graphics2D graphics2d) +    {
+        // draw circle clipped by ellipse shape using alpha paint with 0% \
transparency +        drawCircleClippedByEllipseShapeAlphaPaintBlue(image, \
graphics2d, 0); +        // test result
+        return TestResult.PASSED;
+    }
+
+    /**
+     * Check if circle shape could be clipped by an ellipse shape. Circle is
+     * rendered using alpha paint with blue color at 25% transparency.
+     * 
+     * @param image
+     *            work image
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testClipCircleByEllipseShapeAlphaPaintBlue025(TestImage image, \
Graphics2D graphics2d) +    {
+        // draw circle clipped by ellipse shape using alpha paint with 25% \
transparency +        drawCircleClippedByEllipseShapeAlphaPaintBlue(image, \
graphics2d, 25); +        // test result
+        return TestResult.PASSED;
+    }
+
+    /**
+     * Check if circle shape could be clipped by an ellipse shape. Circle is
+     * rendered using alpha paint with blue color at 50% transparency.
+     * 
+     * @param image
+     *            work image
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testClipCircleByEllipseShapeAlphaPaintBlue050(TestImage image, \
Graphics2D graphics2d) +    {
+        // draw circle clipped by ellipse shape using alpha paint with 50% \
transparency +        drawCircleClippedByEllipseShapeAlphaPaintBlue(image, \
graphics2d, 50); +        // test result
+        return TestResult.PASSED;
+    }
+
+    /**
+     * Check if circle shape could be clipped by an ellipse shape. Circle is
+     * rendered using alpha paint with blue color at 75% transparency.
+     * 
+     * @param image
+     *            work image
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testClipCircleByEllipseShapeAlphaPaintBlue075(TestImage image, \
Graphics2D graphics2d) +    {
+        // draw circle clipped by ellipse shape using alpha paint with 75% \
transparency +        drawCircleClippedByEllipseShapeAlphaPaintBlue(image, \
graphics2d, 75); +        // test result
+        return TestResult.PASSED;
+    }
+
+    /**
+     * Check if circle shape could be clipped by an ellipse shape. Circle is
+     * rendered using alpha paint with blue color at 100% transparency.
+     * 
+     * @param image
+     *            work image
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testClipCircleByEllipseShapeAlphaPaintBlue100(TestImage image, \
Graphics2D graphics2d) +    {
+        // draw circle clipped by ellipse shape using alpha paint with 100% \
transparency +        drawCircleClippedByEllipseShapeAlphaPaintBlue(image, \
graphics2d, 100);  // test result
         return TestResult.PASSED;
     }


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic