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

ptisnovs at icedtea.classpath.org ptisnovs at icedtea.classpath.org
Thu Oct 6 01:48:08 PDT 2011


changeset 8dda8b319223 in /hg/gfx-test
details: http://icedtea.classpath.org/hg/gfx-test?cmd=changeset;node=8dda8b319223
author: Pavel Tisnovsky <ptisnovs at redhat.com>
date: Thu Oct 06 10:50:05 2011 +0200

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

	 * Makefile: added new class to compile
		* src/org/gfxtest/testsuites/CAGOperationsOnTwoConcentricCircles.java:
	Added new test suite containing 40 CAG tests.
		* src/org/gfxtest/testsuites/CAGOperationsOnCircleAndRectangle.java:
	Minor enhancement - added class annotations


diffstat:

 ChangeLog                                                           |     8 +
 Makefile                                                            |     2 +
 src/org/gfxtest/testsuites/CAGOperationsOnCircleAndRectangle.java   |    12 +-
 src/org/gfxtest/testsuites/CAGOperationsOnTwoConcentricCircles.java |  1071 ++++++++++
 4 files changed, 1088 insertions(+), 5 deletions(-)

diffs (truncated from 1138 to 500 lines):

diff -r 9925b5be7957 -r 8dda8b319223 ChangeLog
--- a/ChangeLog	Wed Oct 05 11:24:07 2011 +0200
+++ b/ChangeLog	Thu Oct 06 10:50:05 2011 +0200
@@ -1,3 +1,11 @@
+2011-10-06  Pavel Tisnovsky  <ptisnovs at redhat.com>
+
+	* Makefile: added new class to compile
+	* src/org/gfxtest/testsuites/CAGOperationsOnTwoConcentricCircles.java:
+	Added new test suite containing 40 CAG tests.
+	* src/org/gfxtest/testsuites/CAGOperationsOnCircleAndRectangle.java:
+	Minor enhancement - added class annotations
+
 2011-10-05  Pavel Tisnovsky  <ptisnovs at redhat.com>
 
 	* Makefile: added new class to compile
diff -r 9925b5be7957 -r 8dda8b319223 Makefile
--- a/Makefile	Wed Oct 05 11:24:07 2011 +0200
+++ b/Makefile	Thu Oct 06 10:50:05 2011 +0200
@@ -138,6 +138,7 @@
 	$(CLASSES)/$(TESTSUITE_DIR)/RadialGradientPaint.class \
 	$(CLASSES)/$(TESTSUITE_DIR)/CAGOperationsOnTwoOverlappingCircles.class \
 	$(CLASSES)/$(TESTSUITE_DIR)/CAGOperationsOnTwoTouchingCircles.class \
+	$(CLASSES)/$(TESTSUITE_DIR)/CAGOperationsOnTwoConcentricCircles.class \
 	$(CLASSES)/$(TESTSUITE_DIR)/CAGOperationsOnTwoOverlappingRectangles.class \
 	$(CLASSES)/$(TESTSUITE_DIR)/CAGOperationsOnCircleAndRectangle.class
 
@@ -183,6 +184,7 @@
 	$(RESULTS)/RadialGradientPaint \
 	$(RESULTS)/CAGOperationsOnTwoOverlappingCircles \
 	$(RESULTS)/CAGOperationsOnTwoTouchingCircles \
+	$(RESULTS)/CAGOperationsOnTwoConcentricCircles \
 	$(RESULTS)/CAGOperationsOnTwoOverlappingRectangles \
 	$(RESULTS)/CAGOperationsOnCircleAndRectangle
 
diff -r 9925b5be7957 -r 8dda8b319223 src/org/gfxtest/testsuites/CAGOperationsOnCircleAndRectangle.java
--- a/src/org/gfxtest/testsuites/CAGOperationsOnCircleAndRectangle.java	Wed Oct 05 11:24:07 2011 +0200
+++ b/src/org/gfxtest/testsuites/CAGOperationsOnCircleAndRectangle.java	Thu Oct 06 10:50:05 2011 +0200
@@ -45,11 +45,8 @@
 
 
 
-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.*;
+import org.gfxtest.framework.annotations.*;
 
 
 
@@ -61,6 +58,11 @@
  * 
  * @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 CAGOperationsOnCircleAndRectangle extends GfxTest
 {
 
diff -r 9925b5be7957 -r 8dda8b319223 src/org/gfxtest/testsuites/CAGOperationsOnTwoConcentricCircles.java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/org/gfxtest/testsuites/CAGOperationsOnTwoConcentricCircles.java	Thu Oct 06 10:50:05 2011 +0200
@@ -0,0 +1,1071 @@
+/*
+  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 concentric (i.e. they have
+ * common center point and different radius).
+ *
+ * @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 CAGOperationsOnTwoConcentricCircles extends GfxTest
+{
+
+    /**
+     * Checks the process of creating and rendering new geometric shape
+     * constructed from two concentric 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.createAreaFromTwoConcentricCirclesUsingUnionOperator(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 concentric 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.createAreaFromTwoConcentricCirclesUsingSubtractOperator(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 concentric 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.createAreaFromTwoConcentricCirclesUsingInverseSubtractOperator(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 concentric 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.createAreaFromTwoConcentricCirclesUsingIntersectOperator(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 concentric 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.createAreaFromTwoConcentricCirclesUsingXorOperator(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 concentric 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.createAreaFromTwoConcentricCirclesUsingUnionOperator(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 concentric 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.createAreaFromTwoConcentricCirclesUsingSubtractOperator(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 concentric 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.createAreaFromTwoConcentricCirclesUsingInverseSubtractOperator(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 concentric 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.createAreaFromTwoConcentricCirclesUsingIntersectOperator(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 concentric 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.createAreaFromTwoConcentricCirclesUsingXorOperator(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 concentric 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.createAreaFromTwoConcentricCirclesUsingUnionOperator(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 concentric 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.createAreaFromTwoConcentricCirclesUsingSubtractOperator(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 concentric 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.createAreaFromTwoConcentricCirclesUsingInverseSubtractOperator(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 concentric 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.createAreaFromTwoConcentricCirclesUsingIntersectOperator(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 concentric 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.createAreaFromTwoConcentricCirclesUsingXorOperator(image);
+        // draw the area
+        graphics2d.draw(area);
+        // test result
+        return TestResult.PASSED;



More information about the distro-pkg-dev mailing list