/hg/gfx-test: 2011-10-05 Pavel Tisnovsky <ptisnovs at redhat.com>

ptisnovs at icedtea.classpath.org ptisnovs at icedtea.classpath.org
Wed Oct 5 02:22:17 PDT 2011


changeset 9925b5be7957 in /hg/gfx-test
details: http://icedtea.classpath.org/hg/gfx-test?cmd=changeset;node=9925b5be7957
author: Pavel Tisnovsky <ptisnovs at redhat.com>
date: Wed Oct 05 11:24:07 2011 +0200

	2011-10-05 Pavel Tisnovsky <ptisnovs at redhat.com>

	 * Makefile: added new class to compile
		* src/org/gfxtest/testsuites/CAGOperationsOnTwoTouchingCircles.java:
	Added new test suite containing 40 CAG tests.


diffstat:

 ChangeLog                                                               |     6 +
 Makefile                                                                |     2 +
 src/org/gfxtest/testsuites/CAGOperationsOnTwoOverlappingRectangles.java |     1 +
 src/org/gfxtest/testsuites/CAGOperationsOnTwoTouchingCircles.java       |  1070 ++++++++++
 4 files changed, 1079 insertions(+), 0 deletions(-)

diffs (truncated from 1117 to 500 lines):

diff -r 66a66e2e3307 -r 9925b5be7957 ChangeLog
--- a/ChangeLog	Tue Oct 04 13:31:50 2011 +0200
+++ b/ChangeLog	Wed Oct 05 11:24:07 2011 +0200
@@ -1,3 +1,9 @@
+2011-10-05  Pavel Tisnovsky  <ptisnovs at redhat.com>
+
+	* Makefile: added new class to compile
+	* src/org/gfxtest/testsuites/CAGOperationsOnTwoTouchingCircles.java:
+	Added new test suite containing 40 CAG tests.
+
 2011-10-04  Pavel Tisnovsky  <ptisnovs at redhat.com>
 
 	* src/org/gfxtest/framework/CommonCAGOperations.java:
diff -r 66a66e2e3307 -r 9925b5be7957 Makefile
--- a/Makefile	Tue Oct 04 13:31:50 2011 +0200
+++ b/Makefile	Wed Oct 05 11:24:07 2011 +0200
@@ -137,6 +137,7 @@
 	$(CLASSES)/$(TESTSUITE_DIR)/LinearGradientPaint.class \
 	$(CLASSES)/$(TESTSUITE_DIR)/RadialGradientPaint.class \
 	$(CLASSES)/$(TESTSUITE_DIR)/CAGOperationsOnTwoOverlappingCircles.class \
+	$(CLASSES)/$(TESTSUITE_DIR)/CAGOperationsOnTwoTouchingCircles.class \
 	$(CLASSES)/$(TESTSUITE_DIR)/CAGOperationsOnTwoOverlappingRectangles.class \
 	$(CLASSES)/$(TESTSUITE_DIR)/CAGOperationsOnCircleAndRectangle.class
 
@@ -181,6 +182,7 @@
 	$(RESULTS)/LinearGradientPaint \
 	$(RESULTS)/RadialGradientPaint \
 	$(RESULTS)/CAGOperationsOnTwoOverlappingCircles \
+	$(RESULTS)/CAGOperationsOnTwoTouchingCircles \
 	$(RESULTS)/CAGOperationsOnTwoOverlappingRectangles \
 	$(RESULTS)/CAGOperationsOnCircleAndRectangle
 
diff -r 66a66e2e3307 -r 9925b5be7957 src/org/gfxtest/testsuites/CAGOperationsOnTwoOverlappingRectangles.java
--- a/src/org/gfxtest/testsuites/CAGOperationsOnTwoOverlappingRectangles.java	Tue Oct 04 13:31:50 2011 +0200
+++ b/src/org/gfxtest/testsuites/CAGOperationsOnTwoOverlappingRectangles.java	Wed Oct 05 11:24:07 2011 +0200
@@ -55,6 +55,7 @@
  * by performing boolean operations on existing ones. This process is often
  * called Constructive area geometry (CAG). All CAG operations - union,
  * intersection, subtraction and XOR - is processed on two overlapping Rectangles.
+ * Rectangles which are the basis of the areas are overlapping.
  * 
  * @author Pavel Tisnovsky
  */
diff -r 66a66e2e3307 -r 9925b5be7957 src/org/gfxtest/testsuites/CAGOperationsOnTwoTouchingCircles.java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/org/gfxtest/testsuites/CAGOperationsOnTwoTouchingCircles.java	Wed Oct 05 11:24:07 2011 +0200
@@ -0,0 +1,1070 @@
+/*
+  Java gfx-test framework
+
+   Copyright (C) 2010, 2011  Red Hat
+
+This file is part of IcedTea.
+
+IcedTea is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+IcedTea is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with IcedTea; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version.
+*/
+
+package org.gfxtest.testsuites;
+
+import java.awt.Graphics2D;
+import java.awt.geom.Area;
+
+
+
+import org.gfxtest.framework.*;
+import org.gfxtest.framework.annotations.*;
+
+
+
+/**
+ * This test checks the process of creating and rendering new geometric shapes
+ * by performing boolean operations on existing ones. This process is often
+ * called Constructive area geometry (CAG). All CAG operations - union,
+ * intersection, subtraction and XOR - is processed on two circular Areas.
+ * Circles which are the basis of the areas are touching at just one point.
+ *
+ * @author Pavel Tisnovsky
+ */
+ at TestType(TestTypes.RENDER_TEST)
+ at GraphicsPrimitive(GraphicsPrimitives.AREA)
+ at RenderStyle(RenderStyles.FILL)
+ at Transformation(Transformations.NONE)
+ at Zoom(1)
+public class CAGOperationsOnTwoTouchingCircles extends GfxTest
+{
+
+    /**
+     * Checks the process of creating and rendering new geometric shape
+     * constructed from two touching circles using union operator. The shape
+     * is rendered using stroke.
+     * 
+     * @param image
+     *            image to which area is to be drawn
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testUnionStrokePaint(TestImage image, Graphics2D graphics2d)
+    {
+        // set stroke color
+        CommonRenderingStyles.setStrokeColor(graphics2d);
+        // create area using union operator
+        Area area = CommonCAGOperations.createAreaFromTwoTouchingCirclesUsingUnionOperator(image);
+        // draw the area
+        graphics2d.draw(area);
+        // test result
+        return TestResult.PASSED;
+    }
+
+    /**
+     * Checks the process of creating and rendering new geometric shape
+     * constructed from two touching circles using subtract operator. The
+     * shape is rendered using stroke.
+     * 
+     * @param image
+     *            image to which area is to be drawn
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testSubtractStrokePaint(TestImage image, Graphics2D graphics2d)
+    {
+        // set stroke color
+        CommonRenderingStyles.setStrokeColor(graphics2d);
+        // create area using subtract operator
+        Area area = CommonCAGOperations.createAreaFromTwoTouchingCirclesUsingSubtractOperator(image);
+        // draw the area
+        graphics2d.draw(area);
+        // test result
+        return TestResult.PASSED;
+    }
+
+    /**
+     * Checks the process of creating and rendering new geometric shape
+     * constructed from two touching circles using inverse subtract operator.
+     * The shape is rendered using stroke.
+     * 
+     * @param image
+     *            image to which area is to be drawn
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testInverseSubtractStrokePaint(TestImage image, Graphics2D graphics2d)
+    {
+        // set stroke color
+        CommonRenderingStyles.setStrokeColor(graphics2d);
+        // create area using subtract operator
+        Area area = CommonCAGOperations.createAreaFromTwoTouchingCirclesUsingInverseSubtractOperator(image);
+        // draw the area
+        graphics2d.draw(area);
+        // test result
+        return TestResult.PASSED;
+    }
+
+    /**
+     * Checks the process of creating and rendering new geometric shape
+     * constructed from two touching circles using intersect operator. The
+     * shape is rendered using stroke.
+     * 
+     * @param image
+     *            image to which area is to be drawn
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testIntersectStrokePaint(TestImage image, Graphics2D graphics2d)
+    {
+        // set stroke color
+        CommonRenderingStyles.setStrokeColor(graphics2d);
+        // create area using intersect operator
+        Area area = CommonCAGOperations.createAreaFromTwoTouchingCirclesUsingIntersectOperator(image);
+        // draw the area
+        graphics2d.draw(area);
+        // test result
+        return TestResult.PASSED;
+    }
+
+    /**
+     * Checks the process of creating and rendering new geometric shape
+     * constructed from two touching circles using XOR operator. The shape is
+     * rendered using stroke.
+     * 
+     * @param image
+     *            image to which area is to be drawn
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testXorStrokePaint(TestImage image, Graphics2D graphics2d)
+    {
+        // set stroke color
+        CommonRenderingStyles.setStrokeColor(graphics2d);
+        // create area using XOR operator
+        Area area = CommonCAGOperations.createAreaFromTwoTouchingCirclesUsingXorOperator(image);
+        // draw the area
+        graphics2d.draw(area);
+        // test result
+        return TestResult.PASSED;
+    }
+
+    /**
+     * Checks the process of creating and rendering new geometric shape
+     * constructed from two touching circles using union operator. The shape is rendered
+     * using wide stroke.
+     * 
+     * @param image
+     *            image to which area is to be drawn
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testUnionWideStrokePaint(TestImage image, Graphics2D graphics2d)
+    {
+        // set stroke color
+        CommonRenderingStyles.setStrokeColor(graphics2d);
+        // set stroke width
+        CommonRenderingStyles.setStrokeThickWidth(graphics2d);
+        // create area using union operator
+        Area area = CommonCAGOperations.createAreaFromTwoTouchingCirclesUsingUnionOperator(image);
+        // draw the area
+        graphics2d.draw(area);
+        // test result
+        return TestResult.PASSED;
+    }
+
+    /**
+     * Checks the process of creating and rendering new geometric shape
+     * constructed from two touching circles using subtract operator. The shape is
+     * rendered using wide stroke.
+     * 
+     * @param image
+     *            image to which area is to be drawn
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testSubtractWideStrokePaint(TestImage image, Graphics2D graphics2d)
+    {
+        // set stroke color
+        CommonRenderingStyles.setStrokeColor(graphics2d);
+        // set stroke width
+        CommonRenderingStyles.setStrokeThickWidth(graphics2d);
+        // create area using subtract operator
+        Area area = CommonCAGOperations.createAreaFromTwoTouchingCirclesUsingSubtractOperator(image);
+        // draw the area
+        graphics2d.draw(area);
+        // test result
+        return TestResult.PASSED;
+    }
+
+    /**
+     * Checks the process of creating and rendering new geometric shape
+     * constructed from two touching circles using inverse subtract operator. The shape
+     * is rendered using wide stroke.
+     * 
+     * @param image
+     *            image to which area is to be drawn
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testInverseSubtractWideStrokePaint(TestImage image, Graphics2D graphics2d)
+    {
+        // set stroke color
+        CommonRenderingStyles.setStrokeColor(graphics2d);
+        // set stroke width
+        CommonRenderingStyles.setStrokeThickWidth(graphics2d);
+        // create area using subtract operator
+        Area area = CommonCAGOperations.createAreaFromTwoTouchingCirclesUsingInverseSubtractOperator(image);
+        // draw the area
+        graphics2d.draw(area);
+        // test result
+        return TestResult.PASSED;
+    }
+
+    /**
+     * Checks the process of creating and rendering new geometric shape
+     * constructed from two touching circles using intersect operator. The shape is
+     * rendered using wide stroke.
+     * 
+     * @param image
+     *            image to which area is to be drawn
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testIntersectWideStrokePaint(TestImage image, Graphics2D graphics2d)
+    {
+        // set stroke color
+        CommonRenderingStyles.setStrokeColor(graphics2d);
+        // set stroke width
+        CommonRenderingStyles.setStrokeThickWidth(graphics2d);
+        // create area using intersect operator
+        Area area = CommonCAGOperations.createAreaFromTwoTouchingCirclesUsingIntersectOperator(image);
+        // draw the area
+        graphics2d.draw(area);
+        // test result
+        return TestResult.PASSED;
+    }
+
+    /**
+     * Checks the process of creating and rendering new geometric shape
+     * constructed from two touching circles using XOR operator. The shape is rendered
+     * using wide stroke.
+     * 
+     * @param image
+     *            image to which area is to be drawn
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testXorWideStrokePaint(TestImage image, Graphics2D graphics2d)
+    {
+        // set stroke color
+        CommonRenderingStyles.setStrokeColor(graphics2d);
+        // set stroke width
+        CommonRenderingStyles.setStrokeThickWidth(graphics2d);
+        // create area using XOR operator
+        Area area = CommonCAGOperations.createAreaFromTwoTouchingCirclesUsingXorOperator(image);
+        // draw the area
+        graphics2d.draw(area);
+        // test result
+        return TestResult.PASSED;
+    }
+
+    /**
+     * Checks the process of creating and rendering new geometric shape
+     * constructed from two touching circles using union operator. The shape is rendered
+     * using extra wide stroke.
+     * 
+     * @param image
+     *            image to which area is to be drawn
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testUnionExtraWideStrokePaint(TestImage image, Graphics2D graphics2d)
+    {
+        // set stroke color
+        CommonRenderingStyles.setStrokeColor(graphics2d);
+        // set stroke width
+        CommonRenderingStyles.setStrokeExtraThickWidth(graphics2d);
+        // create area using union operator
+        Area area = CommonCAGOperations.createAreaFromTwoTouchingCirclesUsingUnionOperator(image);
+        // draw the area
+        graphics2d.draw(area);
+        // test result
+        return TestResult.PASSED;
+    }
+
+    /**
+     * Checks the process of creating and rendering new geometric shape
+     * constructed from two touching circles using subtract operator. The shape is
+     * rendered using extra wide stroke.
+     * 
+     * @param image
+     *            image to which area is to be drawn
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testSubtractExtraWideStrokePaint(TestImage image, Graphics2D graphics2d)
+    {
+        // set stroke color
+        CommonRenderingStyles.setStrokeColor(graphics2d);
+        // set stroke width
+        CommonRenderingStyles.setStrokeExtraThickWidth(graphics2d);
+        // create area using subtract operator
+        Area area = CommonCAGOperations.createAreaFromTwoTouchingCirclesUsingSubtractOperator(image);
+        // draw the area
+        graphics2d.draw(area);
+        // test result
+        return TestResult.PASSED;
+    }
+
+    /**
+     * Checks the process of creating and rendering new geometric shape
+     * constructed from two touching circles using inverse subtract operator. The shape
+     * is rendered using extra wide stroke.
+     * 
+     * @param image
+     *            image to which area is to be drawn
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testInverseSubtractExtraWideStrokePaint(TestImage image, Graphics2D graphics2d)
+    {
+        // set stroke color
+        CommonRenderingStyles.setStrokeColor(graphics2d);
+        // set stroke width
+        CommonRenderingStyles.setStrokeExtraThickWidth(graphics2d);
+        // create area using subtract operator
+        Area area = CommonCAGOperations.createAreaFromTwoTouchingCirclesUsingInverseSubtractOperator(image);
+        // draw the area
+        graphics2d.draw(area);
+        // test result
+        return TestResult.PASSED;
+    }
+
+    /**
+     * Checks the process of creating and rendering new geometric shape
+     * constructed from two touching circles using intersect operator. The shape is
+     * rendered using extra wide stroke.
+     * 
+     * @param image
+     *            image to which area is to be drawn
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testIntersectExtraWideStrokePaint(TestImage image, Graphics2D graphics2d)
+    {
+        // set stroke color
+        CommonRenderingStyles.setStrokeColor(graphics2d);
+        // set stroke width
+        CommonRenderingStyles.setStrokeExtraThickWidth(graphics2d);
+        // create area using intersect operator
+        Area area = CommonCAGOperations.createAreaFromTwoTouchingCirclesUsingIntersectOperator(image);
+        // draw the area
+        graphics2d.draw(area);
+        // test result
+        return TestResult.PASSED;
+    }
+
+    /**
+     * Checks the process of creating and rendering new geometric shape
+     * constructed from two touching circles using XOR operator. The shape is rendered
+     * using extra wide stroke.
+     * 
+     * @param image
+     *            image to which area is to be drawn
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testXorExtraWideStrokePaint(TestImage image, Graphics2D graphics2d)
+    {
+        // set stroke color
+        CommonRenderingStyles.setStrokeColor(graphics2d);
+        // set stroke width
+        CommonRenderingStyles.setStrokeExtraThickWidth(graphics2d);
+        // create area using XOR operator
+        Area area = CommonCAGOperations.createAreaFromTwoTouchingCirclesUsingXorOperator(image);
+        // draw the area
+        graphics2d.draw(area);
+        // test result
+        return TestResult.PASSED;
+    }
+
+    /**
+     * Checks the process of creating and rendering new geometric shape
+     * constructed from two touching circles using union operator. The shape is rendered
+     * using color paint (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 testUnionColorPaint(TestImage image, Graphics2D graphics2d)
+    {
+        // set stroke color
+        CommonRenderingStyles.setStrokeColor(graphics2d);
+        // set fill color
+        CommonRenderingStyles.setFillColor(graphics2d);
+        // create area using union operator
+        Area area = CommonCAGOperations.createAreaFromTwoTouchingCirclesUsingUnionOperator(image);



More information about the distro-pkg-dev mailing list