/hg/gfx-test: New tests added to the test suite src/org/gfxtest/...

ptisnovs at icedtea.classpath.org ptisnovs at icedtea.classpath.org
Mon Dec 3 00:30:37 PST 2012


changeset b6ab20d99bbc in /hg/gfx-test
details: http://icedtea.classpath.org/hg/gfx-test?cmd=changeset;node=b6ab20d99bbc
author: Pavel Tisnovsky <ptisnovs at redhat.com>
date: Mon Dec 03 09:33:36 2012 +0100

	New tests added to the test suite src/org/gfxtest/testsuites/ClippingPathByEllipseShape.java.
	Added new test suite src/org/gfxtest/testsuites/Paths.java.


diffstat:

 ChangeLog                                                  |   8 +
 Makefile                                                   |   2 +
 src/org/gfxtest/testsuites/ClippingPathByEllipseShape.java |  38 ++++++
 src/org/gfxtest/testsuites/Paths.java                      |  85 ++++++++++++++
 4 files changed, 133 insertions(+), 0 deletions(-)

diffs (178 lines):

diff -r 62c4c2946710 -r b6ab20d99bbc ChangeLog
--- a/ChangeLog	Fri Nov 30 14:10:30 2012 +0100
+++ b/ChangeLog	Mon Dec 03 09:33:36 2012 +0100
@@ -1,3 +1,11 @@
+2012-12-03  Pavel Tisnovsky  <ptisnovs at redhat.com>
+
+	* src/org/gfxtest/testsuites/ClippingPathByEllipseShape.java:
+	New tests added to this test suite.
+	* src/org/gfxtest/testsuites/Paths.java:
+	Added new (now empty) test suite.
+	* Makefile: Added new class to compile.
+
 2012-11-30  Pavel Tisnovsky  <ptisnovs at redhat.com>
 
 	* src/org/gfxtest/framework/CommonPathsGenerator.java:
diff -r 62c4c2946710 -r b6ab20d99bbc Makefile
--- a/Makefile	Fri Nov 30 14:10:30 2012 +0100
+++ b/Makefile	Mon Dec 03 09:33:36 2012 +0100
@@ -160,6 +160,7 @@
 	$(CLASSES)/$(TESTSUITE_DIR)/NormalQuadraticCurvesAsPaths.class \
 	$(CLASSES)/$(TESTSUITE_DIR)/NormalCubicCurves.class \
 	$(CLASSES)/$(TESTSUITE_DIR)/NormalCubicCurvesAsPaths.class \
+	$(CLASSES)/$(TESTSUITE_DIR)/Paths.class \
 	$(CLASSES)/$(TESTSUITE_DIR)/FilledArcs.class \
 	$(CLASSES)/$(TESTSUITE_DIR)/FilledCircles.class \
 	$(CLASSES)/$(TESTSUITE_DIR)/FilledEllipses.class \
@@ -257,6 +258,7 @@
 	$(RESULTS)/NormalQuadraticCurvesAsPaths \
 	$(RESULTS)/NormalCubicCurves \
 	$(RESULTS)/NormalCubicCurvesAsPaths \
+	$(RESULTS)/Paths \
 	$(RESULTS)/FilledArcs \
 	$(RESULTS)/FilledCircles \
 	$(RESULTS)/FilledEllipses \
diff -r 62c4c2946710 -r b6ab20d99bbc src/org/gfxtest/testsuites/ClippingPathByEllipseShape.java
--- a/src/org/gfxtest/testsuites/ClippingPathByEllipseShape.java	Fri Nov 30 14:10:30 2012 +0100
+++ b/src/org/gfxtest/testsuites/ClippingPathByEllipseShape.java	Mon Dec 03 09:33:36 2012 +0100
@@ -219,6 +219,24 @@
     }
 
     /**
+     * Draw crossed path containing quadratic segment clipped by an ellipse shape.
+     * 
+     * @param image
+     *            work image
+     * @param graphics2d
+     *            graphics canvas
+     */
+    private static void drawCrossedPathContainingCubicSegmentClippedByEllipseShape(TestImage image, Graphics2D graphics2d)
+    {
+        // prepare canvas for the rendering
+        basicSetupForRendering(image, graphics2d);
+        // set stroke color
+        CommonRenderingStyles.setStrokeColor(graphics2d);
+        // draw the crossed path
+        graphics2d.draw(CommonPathsGenerator.createCrossedClosedPathContainingCubicSegmentFloat(image));
+    }
+
+    /**
      * Check if line path could be clipped by an ellipse shape. Path is rendered
      * using stroke paint with default stroke width.
      * Line path is constructed using new Path.Float()
@@ -361,6 +379,26 @@
     }
 
     /**
+     * Check if crossed closed path could be clipped by an ellipse shape. Path
+     * is rendered using stroke paint with default stroke width.
+     * 
+     * @param image
+     *            work image
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testClipCrossedClosedPathContainingCubicSegmentByEllipseShapeStrokePaint(TestImage image, Graphics2D graphics2d)
+    {
+        // render ellipse which is used as a clip shape
+        CommonClippingOperations.renderClipEllipse(image, graphics2d);
+        // set clip region and draw the path
+        drawCrossedPathContainingCubicSegmentClippedByEllipseShape(image, graphics2d);
+        // test result
+        return TestResult.PASSED;
+    }
+
+    /**
      * Check if line path could be clipped by an ellipse shape. Path is
      * rendered using stroke paint with zero stroke width.
      * Line path is constructed using new Path.Float()
diff -r 62c4c2946710 -r b6ab20d99bbc src/org/gfxtest/testsuites/Paths.java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/org/gfxtest/testsuites/Paths.java	Mon Dec 03 09:33:36 2012 +0100
@@ -0,0 +1,85 @@
+/*
+  Java gfx-test framework
+
+   Copyright (C) 2012  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 org.gfxtest.framework.CommonPathsGenerator;
+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.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;
+
+
+
+/**
+ * Various paths and various rendering styles are used for
+ * rendering.
+ * 
+ * @author Pavel Tisnovsky
+ */
+ at TestType(TestTypes.RENDER_TEST)
+ at Transformation(Transformations.NONE)
+ at GraphicsPrimitive(GraphicsPrimitives.PATH)
+ at Zoom(1)
+public class Paths extends GfxTest
+{
+
+    /**
+     * Entry point to the test suite.
+     * 
+     * @param args
+     *            graphics test configuration
+     */
+    public static void main(String[] args)
+    {
+        new Paths().runTestSuite(args);
+    }
+}
+



More information about the distro-pkg-dev mailing list