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

ptisnovs at icedtea.classpath.org ptisnovs at icedtea.classpath.org
Wed Dec 21 01:52:18 PST 2011


changeset 6127c26483fb in /hg/gfx-test
details: http://icedtea.classpath.org/hg/gfx-test?cmd=changeset;node=6127c26483fb
author: Pavel Tisnovsky <ptisnovs at redhat.com>
date: Wed Dec 21 10:54:38 2011 +0100

	2011-12-21 Pavel Tisnovsky <ptisnovs at redhat.com>

	 *
	src/org/gfxtest/testsuites/ClippingPathByEllipseShape.java:
	        * src/org/gfxtest/testsuites/ClippingPathByPolygonalShape.java:
	        * src/org/gfxtest/testsuites/ClippingPathByRoundRectangleShape.java:
	Added common helper methods to these test stubs.


diffstat:

 ChangeLog                                                         |    7 +
 src/org/gfxtest/testsuites/ClippingPathByEllipseShape.java        |  113 +++++++++-
 src/org/gfxtest/testsuites/ClippingPathByPolygonalShape.java      |  113 +++++++++-
 src/org/gfxtest/testsuites/ClippingPathByRoundRectangleShape.java |   77 ++++++-
 4 files changed, 307 insertions(+), 3 deletions(-)

diffs (371 lines):

diff -r 470e7bd98ec4 -r 6127c26483fb ChangeLog
--- a/ChangeLog	Tue Dec 20 11:45:42 2011 +0100
+++ b/ChangeLog	Wed Dec 21 10:54:38 2011 +0100
@@ -1,3 +1,10 @@
+2011-12-21  Pavel Tisnovsky  <ptisnovs at redhat.com>
+
+	* src/org/gfxtest/testsuites/ClippingPathByEllipseShape.java:
+	* src/org/gfxtest/testsuites/ClippingPathByPolygonalShape.java:
+	* src/org/gfxtest/testsuites/ClippingPathByRoundRectangleShape.java:
+	Added common helper methods to these test stubs.
+
 2011-12-20  Pavel Tisnovsky  <ptisnovs at redhat.com>
 
 	* src/org/gfxtest/testsuites/ClippingPathByRectangleShape.java:
diff -r 470e7bd98ec4 -r 6127c26483fb src/org/gfxtest/testsuites/ClippingPathByEllipseShape.java
--- a/src/org/gfxtest/testsuites/ClippingPathByEllipseShape.java	Tue Dec 20 11:45:42 2011 +0100
+++ b/src/org/gfxtest/testsuites/ClippingPathByEllipseShape.java	Wed Dec 21 10:54:38 2011 +0100
@@ -40,7 +40,15 @@
 
 package org.gfxtest.testsuites;
 
+import java.awt.Graphics2D;
+
+
+
+import org.gfxtest.framework.CommonClippingOperations;
+import org.gfxtest.framework.CommonPathsGenerator;
+import org.gfxtest.framework.CommonRenderingStyles;
 import org.gfxtest.framework.GfxTest;
+import org.gfxtest.framework.TestImage;
 import org.gfxtest.framework.annotations.GraphicsPrimitive;
 import org.gfxtest.framework.annotations.GraphicsPrimitives;
 import org.gfxtest.framework.annotations.TestType;
@@ -64,7 +72,110 @@
 @Zoom(1)
 public class ClippingPathByEllipseShape extends GfxTest
 {
-    
+    /**
+     * Prepare canvas for the rendering.
+     *
+     * @param image
+     *            work image
+     * @param graphics2d
+     *            graphics canvas
+     */
+    private static void basicSetupForRendering(TestImage image, Graphics2D graphics2d)
+    {
+        // create clip area
+        CommonClippingOperations.createClipUsingEllipseShape(image, graphics2d);
+    }
+
+    /**
+     * Draw path consisting of one line only clipped by an ellipse shape.
+     * 
+     * @param image
+     *            work image
+     * @param graphics2d
+     *            graphics canvas
+     */
+    private static void drawLinePathClippedByEllipseShape(TestImage image, Graphics2D graphics2d)
+    {
+        // prepare canvas for the rendering
+        basicSetupForRendering(image, graphics2d);
+        // set stroke color
+        CommonRenderingStyles.setStrokeColor(graphics2d);
+        // draw the line path
+        graphics2d.draw(CommonPathsGenerator.createLinePathFloat(image));
+    }
+
+    /**
+     * Draw quadratic path clipped by an ellipse shape.
+     * 
+     * @param image
+     *            work image
+     * @param graphics2d
+     *            graphics canvas
+     */
+    private static void drawQuadraticPathClippedByEllipseShape(TestImage image, Graphics2D graphics2d)
+    {
+        // prepare canvas for the rendering
+        basicSetupForRendering(image, graphics2d);
+        // set stroke color
+        CommonRenderingStyles.setStrokeColor(graphics2d);
+        // draw the quadratic path
+        graphics2d.draw(CommonPathsGenerator.createQuadraticPathFloat(image));
+    }
+
+    /**
+     * Draw cubic path clipped by an ellipse shape.
+     * 
+     * @param image
+     *            work image
+     * @param graphics2d
+     *            graphics canvas
+     */
+    private static void drawCubicPathClippedByEllipseShape(TestImage image, Graphics2D graphics2d)
+    {
+        // prepare canvas for the rendering
+        basicSetupForRendering(image, graphics2d);
+        // set stroke color
+        CommonRenderingStyles.setStrokeColor(graphics2d);
+        // draw the cubic path
+        graphics2d.draw(CommonPathsGenerator.createCubicPathFloat(image));
+    }
+
+    /**
+     * Draw closed path clipped by an ellipse shape.
+     * 
+     * @param image
+     *            work image
+     * @param graphics2d
+     *            graphics canvas
+     */
+    private static void drawClosedPathClippedByEllipseShape(TestImage image, Graphics2D graphics2d)
+    {
+        // prepare canvas for the rendering
+        basicSetupForRendering(image, graphics2d);
+        // set stroke color
+        CommonRenderingStyles.setStrokeColor(graphics2d);
+        // draw the closed path
+        graphics2d.draw(CommonPathsGenerator.createClosedPathFloat(image));
+    }
+
+    /**
+     * Draw crossed path clipped by an ellipse shape.
+     * 
+     * @param image
+     *            work image
+     * @param graphics2d
+     *            graphics canvas
+     */
+    private static void drawCrossedPathClippedByEllipseShape(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.createCrossedClosedPathFloat(image));
+    }
+
     /**
      * Entry point to the test suite.
      * 
diff -r 470e7bd98ec4 -r 6127c26483fb src/org/gfxtest/testsuites/ClippingPathByPolygonalShape.java
--- a/src/org/gfxtest/testsuites/ClippingPathByPolygonalShape.java	Tue Dec 20 11:45:42 2011 +0100
+++ b/src/org/gfxtest/testsuites/ClippingPathByPolygonalShape.java	Wed Dec 21 10:54:38 2011 +0100
@@ -40,7 +40,15 @@
 
 package org.gfxtest.testsuites;
 
+import java.awt.Graphics2D;
+
+
+
+import org.gfxtest.framework.CommonClippingOperations;
+import org.gfxtest.framework.CommonPathsGenerator;
+import org.gfxtest.framework.CommonRenderingStyles;
 import org.gfxtest.framework.GfxTest;
+import org.gfxtest.framework.TestImage;
 import org.gfxtest.framework.annotations.GraphicsPrimitive;
 import org.gfxtest.framework.annotations.GraphicsPrimitives;
 import org.gfxtest.framework.annotations.TestType;
@@ -64,7 +72,110 @@
 @Zoom(1)
 public class ClippingPathByPolygonalShape extends GfxTest
 {
- 
+    /**
+     * Prepare canvas for the rendering.
+     *
+     * @param image
+     *            work image
+     * @param graphics2d
+     *            graphics canvas
+     */
+    private static void basicSetupForRendering(TestImage image, Graphics2D graphics2d)
+    {
+        // create clip area
+        CommonClippingOperations.createClipUsingPolygonalShape(image, graphics2d);
+    }
+
+    /**
+     * Draw path consisting of one line only clipped by a polygonal shape.
+     * 
+     * @param image
+     *            work image
+     * @param graphics2d
+     *            graphics canvas
+     */
+    private static void drawLinePathClippedByPolygonalShape(TestImage image, Graphics2D graphics2d)
+    {
+        // prepare canvas for the rendering
+        basicSetupForRendering(image, graphics2d);
+        // set stroke color
+        CommonRenderingStyles.setStrokeColor(graphics2d);
+        // draw the line path
+        graphics2d.draw(CommonPathsGenerator.createLinePathFloat(image));
+    }
+
+    /**
+     * Draw quadratic path clipped by a polygonal shape.
+     * 
+     * @param image
+     *            work image
+     * @param graphics2d
+     *            graphics canvas
+     */
+    private static void drawQuadraticPathClippedByPolygonalShape(TestImage image, Graphics2D graphics2d)
+    {
+        // prepare canvas for the rendering
+        basicSetupForRendering(image, graphics2d);
+        // set stroke color
+        CommonRenderingStyles.setStrokeColor(graphics2d);
+        // draw the quadratic path
+        graphics2d.draw(CommonPathsGenerator.createQuadraticPathFloat(image));
+    }
+
+    /**
+     * Draw cubic path clipped by a polygonal shape.
+     * 
+     * @param image
+     *            work image
+     * @param graphics2d
+     *            graphics canvas
+     */
+    private static void drawCubicPathClippedByPolygonalShape(TestImage image, Graphics2D graphics2d)
+    {
+        // prepare canvas for the rendering
+        basicSetupForRendering(image, graphics2d);
+        // set stroke color
+        CommonRenderingStyles.setStrokeColor(graphics2d);
+        // draw the cubic path
+        graphics2d.draw(CommonPathsGenerator.createCubicPathFloat(image));
+    }
+
+    /**
+     * Draw closed path clipped by a polygonal shape.
+     * 
+     * @param image
+     *            work image
+     * @param graphics2d
+     *            graphics canvas
+     */
+    private static void drawClosedPathClippedByPolygonalShape(TestImage image, Graphics2D graphics2d)
+    {
+        // prepare canvas for the rendering
+        basicSetupForRendering(image, graphics2d);
+        // set stroke color
+        CommonRenderingStyles.setStrokeColor(graphics2d);
+        // draw the closed path
+        graphics2d.draw(CommonPathsGenerator.createClosedPathFloat(image));
+    }
+
+    /**
+     * Draw crossed path clipped by a polygonal shape.
+     * 
+     * @param image
+     *            work image
+     * @param graphics2d
+     *            graphics canvas
+     */
+    private static void drawCrossedPathClippedByPolygonalShape(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.createCrossedClosedPathFloat(image));
+    }
+
     /**
      * Entry point to the test suite.
      * 
diff -r 470e7bd98ec4 -r 6127c26483fb src/org/gfxtest/testsuites/ClippingPathByRoundRectangleShape.java
--- a/src/org/gfxtest/testsuites/ClippingPathByRoundRectangleShape.java	Tue Dec 20 11:45:42 2011 +0100
+++ b/src/org/gfxtest/testsuites/ClippingPathByRoundRectangleShape.java	Wed Dec 21 10:54:38 2011 +0100
@@ -40,7 +40,15 @@
 
 package org.gfxtest.testsuites;
 
+import java.awt.Graphics2D;
+
+
+
+import org.gfxtest.framework.CommonClippingOperations;
+import org.gfxtest.framework.CommonPathsGenerator;
+import org.gfxtest.framework.CommonRenderingStyles;
 import org.gfxtest.framework.GfxTest;
+import org.gfxtest.framework.TestImage;
 import org.gfxtest.framework.annotations.GraphicsPrimitive;
 import org.gfxtest.framework.annotations.GraphicsPrimitives;
 import org.gfxtest.framework.annotations.TestType;
@@ -64,7 +72,74 @@
 @Zoom(1)
 public class ClippingPathByRoundRectangleShape extends GfxTest
 {
-    
+    /**
+     * Prepare canvas for the rendering.
+     *
+     * @param image
+     *            work image
+     * @param graphics2d
+     *            graphics canvas
+     */
+    private static void basicSetupForRendering(TestImage image, Graphics2D graphics2d)
+    {
+        // create clip area
+        CommonClippingOperations.createClipUsingRoundRectangleShape(image, graphics2d);
+    }
+
+    /**
+     * Draw path consisting of one line only clipped by a round rectangle shape.
+     * 
+     * @param image
+     *            work image
+     * @param graphics2d
+     *            graphics canvas
+     */
+    private static void drawLinePathClippedByRoundRectangleShape(TestImage image, Graphics2D graphics2d)
+    {
+        // prepare canvas for the rendering
+        basicSetupForRendering(image, graphics2d);
+        // set stroke color
+        CommonRenderingStyles.setStrokeColor(graphics2d);
+        // draw the line path
+        graphics2d.draw(CommonPathsGenerator.createLinePathFloat(image));
+    }
+
+    /**
+     * Draw quadratic path clipped by a round rectangle shape.
+     * 
+     * @param image
+     *            work image
+     * @param graphics2d
+     *            graphics canvas
+     */
+    private static void drawQuadraticPathClippedByRoundRectangleShape(TestImage image, Graphics2D graphics2d)
+    {
+        // prepare canvas for the rendering
+        basicSetupForRendering(image, graphics2d);
+        // set stroke color
+        CommonRenderingStyles.setStrokeColor(graphics2d);
+        // draw the quadratic path
+        graphics2d.draw(CommonPathsGenerator.createQuadraticPathFloat(image));
+    }
+
+    /**
+     * Draw cubic path clipped by a round rectangle shape.
+     * 
+     * @param image
+     *            work image
+     * @param graphics2d
+     *            graphics canvas
+     */
+    private static void drawCubicPathClippedByRoundRectangleShape(TestImage image, Graphics2D graphics2d)
+    {
+        // prepare canvas for the rendering
+        basicSetupForRendering(image, graphics2d);
+        // set stroke color
+        CommonRenderingStyles.setStrokeColor(graphics2d);
+        // draw the cubic path
+        graphics2d.draw(CommonPathsGenerator.createCubicPathFloat(image));
+    }
+
     /**
      * Entry point to the test suite.
      * 



More information about the distro-pkg-dev mailing list