changeset 494:9e3ed864e7ac draft

Six new tests added into CAGOperationsOnCircleAndRectangle test suite.
author Pavel Tisnovsky <ptisnovs@redhat.com>
date Tue, 03 Dec 2013 09:46:48 +0100
parents 712591ecc9d1
children fb8c2b009c38
files ChangeLog src/org/gfxtest/testsuites/CAGOperationsOnCircleAndRectangle.java
diffstat 2 files changed, 157 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Mon Dec 02 11:00:53 2013 +0100
+++ b/ChangeLog	Tue Dec 03 09:46:48 2013 +0100
@@ -1,3 +1,8 @@
+2013-12-03  Pavel Tisnovsky  <ptisnovs@redhat.com>
+
+	* src/org/gfxtest/testsuites/CAGOperationsOnCircleAndRectangle.java:
+	Six new tests added into CAGOperationsOnCircleAndRectangle test suite.
+
 2013-12-02  Pavel Tisnovsky  <ptisnovs@redhat.com>
 
 	* src/org/gfxtest/testsuites/BitBltAffineIdentityTransformOp.java:
--- a/src/org/gfxtest/testsuites/CAGOperationsOnCircleAndRectangle.java	Mon Dec 02 11:00:53 2013 +0100
+++ b/src/org/gfxtest/testsuites/CAGOperationsOnCircleAndRectangle.java	Tue Dec 03 09:46:48 2013 +0100
@@ -45,8 +45,20 @@
 
 
 
-import org.gfxtest.framework.*;
-import org.gfxtest.framework.annotations.*;
+import org.gfxtest.framework.CommonCAGOperations;
+import org.gfxtest.framework.CommonRenderingStyles;
+import org.gfxtest.framework.GfxTest;
+import org.gfxtest.framework.TestImage;
+import org.gfxtest.framework.TestResult;
+import org.gfxtest.framework.annotations.GraphicsPrimitive;
+import org.gfxtest.framework.annotations.GraphicsPrimitives;
+import org.gfxtest.framework.annotations.RenderStyle;
+import org.gfxtest.framework.annotations.RenderStyles;
+import org.gfxtest.framework.annotations.TestType;
+import org.gfxtest.framework.annotations.TestTypes;
+import org.gfxtest.framework.annotations.Transformation;
+import org.gfxtest.framework.annotations.Transformations;
+import org.gfxtest.framework.annotations.Zoom;
 
 
 
@@ -2452,6 +2464,144 @@
     }
 
     /**
+     * Checks the process of creating and rendering new geometric shape
+     * constructed from a circle inside a rectangle using subtract operator. The shape is
+     * rendered using radial gradient fill.
+     * 
+     * @param image
+     *            image to which area is to be drawn
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testOverlappingCircleAndRectangleSubtractRadialGradientPaint(TestImage image, Graphics2D graphics2d)
+    {
+        // set radial gradient fill
+        CommonRenderingStyles.setRadialGradientFill(image, graphics2d);
+        // create area using subtract operator
+        Area area = CommonCAGOperations.createAreaFromOverlappingCircleAndRectangleUsingSubtractOperator(image);
+        // fill the area
+        graphics2d.fill(area);
+        // test result
+        return TestResult.PASSED;
+    }
+
+    /**
+     * Checks the process of creating and rendering new geometric shape
+     * constructed from a circle inside a rectangle using inverse subtract operator.
+     * The shape is rendered using radial gradient fill.
+     * 
+     * @param image
+     *            image to which area is to be drawn
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testOverlappingCircleAndRectangleInverseSubtractRadialGradientPaint(TestImage image, Graphics2D graphics2d)
+    {
+        // set radial gradient fill
+        CommonRenderingStyles.setRadialGradientFill(image, graphics2d);
+        // create area using inverse subtract operator
+        Area area = CommonCAGOperations.createAreaFromOverlappingCircleAndRectangleUsingInverseSubtractOperator(image);
+        // fill the area
+        graphics2d.fill(area);
+        // test result
+        return TestResult.PASSED;
+    }
+
+    /**
+     * Checks the process of creating and rendering new geometric shape
+     * constructed from a circle inside a rectangle using intersect operator. The shape is
+     * rendered using radial gradient fill.
+     * 
+     * @param image
+     *            image to which area is to be drawn
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testOverlappingCircleAndRectangleIntersectRadialGradientPaint(TestImage image, Graphics2D graphics2d)
+    {
+        // set radial gradient fill
+        CommonRenderingStyles.setRadialGradientFill(image, graphics2d);
+        // create area using intersect operator
+        Area area = CommonCAGOperations.createAreaFromOverlappingCircleAndRectangleUsingIntersectOperator(image);
+        // fill the area
+        graphics2d.fill(area);
+        // test result
+        return TestResult.PASSED;
+    }
+
+    /**
+     * Checks the process of creating and rendering new geometric shape
+     * constructed from a circle inside a rectangle using XOR operator. The shape is
+     * rendered using radial gradient fill.
+     * 
+     * @param image
+     *            image to which area is to be drawn
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testOverlappingCircleAndRectangleXorRadialGradientPaint(TestImage image, Graphics2D graphics2d)
+    {
+        // set radial gradient fill
+        CommonRenderingStyles.setRadialGradientFill(image, graphics2d);
+        // create area using XOR operator
+        Area area = CommonCAGOperations.createAreaFromOverlappingCircleAndRectangleUsingXorOperator(image);
+        // fill the area
+        graphics2d.fill(area);
+        // test result
+        return TestResult.PASSED;
+    }
+
+    /**
+     * Checks the process of creating and rendering new geometric shape
+     * constructed from a circle inside a rectangle using union operator. The shape is
+     * rendered using horizontal gradient fill.
+     * 
+     * @param image
+     *            image to which area is to be drawn
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testOverlappingCircleAndRectangleUnionHorizontalGradientPaint(TestImage image, Graphics2D graphics2d)
+    {
+        // set horizontal gradient fill
+        CommonRenderingStyles.setHorizontalGradientFill(image, graphics2d);
+        // create area using union operator
+        Area area = CommonCAGOperations.createAreaFromOverlappingCircleAndRectangleUsingUnionOperator(image);
+        // fill the area
+        graphics2d.fill(area);
+        // test result
+        return TestResult.PASSED;
+    }
+
+    /**
+     * Checks the process of creating and rendering new geometric shape
+     * constructed from a circle inside a rectangle using subtract operator. The shape is
+     * rendered using horizontal gradient fill.
+     * 
+     * @param image
+     *            image to which area is to be drawn
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testOverlappingCircleAndRectangleSubtractHorizontalGradientPaint(TestImage image, Graphics2D graphics2d)
+    {
+        // set horizontal gradient fill
+        CommonRenderingStyles.setHorizontalGradientFill(image, graphics2d);
+        // create area using subtract operator
+        Area area = CommonCAGOperations.createAreaFromOverlappingCircleAndRectangleUsingSubtractOperator(image);
+        // fill the area
+        graphics2d.fill(area);
+        // test result
+        return TestResult.PASSED;
+    }
+
+    /**
      * Entry point to the test suite.
      *
      * @param args not used in this case