/hg/gfx-test: Eight new tests added to the test suite

ptisnovs at icedtea.classpath.org ptisnovs at icedtea.classpath.org
Wed Nov 14 01:55:46 PST 2012


changeset c88d4e4ba967 in /hg/gfx-test
details: http://icedtea.classpath.org/hg/gfx-test?cmd=changeset;node=c88d4e4ba967
author: Pavel Tisnovsky <ptisnovs at redhat.com>
date: Wed Nov 14 10:58:41 2012 +0100

	Eight new tests added to the test suite
	src/org/gfxtest/testsuites/ClippingPathByEllipseShape.java.


diffstat:

 ChangeLog                                                  |    5 +
 src/org/gfxtest/testsuites/ClippingPathByEllipseShape.java |  196 ++++++++++++-
 2 files changed, 188 insertions(+), 13 deletions(-)

diffs (353 lines):

diff -r a331ece4516a -r c88d4e4ba967 ChangeLog
--- a/ChangeLog	Tue Nov 13 11:03:22 2012 +0100
+++ b/ChangeLog	Wed Nov 14 10:58:41 2012 +0100
@@ -1,3 +1,8 @@
+2012-11-14  Pavel Tisnovsky  <ptisnovs at redhat.com>
+
+	* src/org/gfxtest/testsuites/ClippingPathByEllipseShape.java:
+	Eight new tests added to this test suite.
+
 2012-11-13  Pavel Tisnovsky  <ptisnovs at redhat.com>
 
 	* src/org/gfxtest/framework/CommonPathsGenerator.java:
diff -r a331ece4516a -r c88d4e4ba967 src/org/gfxtest/testsuites/ClippingPathByEllipseShape.java
--- a/src/org/gfxtest/testsuites/ClippingPathByEllipseShape.java	Tue Nov 13 11:03:22 2012 +0100
+++ b/src/org/gfxtest/testsuites/ClippingPathByEllipseShape.java	Wed Nov 14 10:58:41 2012 +0100
@@ -92,13 +92,14 @@
 
     /**
      * Draw path consisting of one line only clipped by an ellipse shape.
+     * Line path is constructed using new Path.Float()
      * 
      * @param image
      *            work image
      * @param graphics2d
      *            graphics canvas
      */
-    private static void drawLinePathClippedByEllipseShape(TestImage image, Graphics2D graphics2d)
+    private static void drawLinePathFloatClippedByEllipseShape(TestImage image, Graphics2D graphics2d)
     {
         // prepare canvas for the rendering
         basicSetupForRendering(image, graphics2d);
@@ -109,6 +110,25 @@
     }
 
     /**
+     * Draw path consisting of one line only clipped by an ellipse shape.
+     * Line path is constructed using new Path.Double()
+     * 
+     * @param image
+     *            work image
+     * @param graphics2d
+     *            graphics canvas
+     */
+    private static void drawLinePathDoubleClippedByEllipseShape(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.createLinePathDouble(image));
+    }
+
+    /**
      * Draw quadratic path clipped by an ellipse shape.
      * 
      * @param image
@@ -183,6 +203,7 @@
     /**
      * 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()
      * 
      * @param image
      *            work image
@@ -190,12 +211,33 @@
      *            graphics canvas
      * @return test result status - PASSED, FAILED or ERROR
      */
-    public TestResult testClipLinePathByEllipseShapeStrokePaint(TestImage image, Graphics2D graphics2d)
+    public TestResult testClipLinePathFloatByEllipseShapeStrokePaint(TestImage image, Graphics2D graphics2d)
     {
         // render ellipse which is used as a clip shape
         CommonClippingOperations.renderClipEllipse(image, graphics2d);
         // set clip region and draw the path
-        drawLinePathClippedByEllipseShape(image, graphics2d);
+        drawLinePathFloatClippedByEllipseShape(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 default stroke width.
+     * Line path is constructed using new Path.Double()
+     * 
+     * @param image
+     *            work image
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testClipLinePathDoubleByEllipseShapeStrokePaint(TestImage image, Graphics2D graphics2d)
+    {
+        // render ellipse which is used as a clip shape
+        CommonClippingOperations.renderClipEllipse(image, graphics2d);
+        // set clip region and draw the path
+        drawLinePathDoubleClippedByEllipseShape(image, graphics2d);
         // test result
         return TestResult.PASSED;
     }
@@ -283,6 +325,7 @@
     /**
      * 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()
      * 
      * @param image
      *            work image
@@ -290,7 +333,7 @@
      *            graphics canvas
      * @return test result status - PASSED, FAILED or ERROR
      */
-    public TestResult testClipLinePathByEllipseShapeZeroStrokePaint(TestImage image, Graphics2D graphics2d)
+    public TestResult testClipLinePathFloatByEllipseShapeZeroStrokePaint(TestImage image, Graphics2D graphics2d)
     {
         // render ellipse which is used as a clip shape
         CommonClippingOperations.renderClipEllipse(image, graphics2d);
@@ -299,7 +342,32 @@
         // set stroke width
         CommonRenderingStyles.setStrokeZeroThick(graphics2d);
         // set clip region and draw the path
-        drawLinePathClippedByEllipseShape(image, graphics2d);
+        drawLinePathFloatClippedByEllipseShape(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.Double()
+     * 
+     * @param image
+     *            work image
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testClipLinePathDoubleByEllipseShapeZeroStrokePaint(TestImage image, Graphics2D graphics2d)
+    {
+        // render ellipse which is used as a clip shape
+        CommonClippingOperations.renderClipEllipse(image, graphics2d);
+        // set stroke color
+        CommonRenderingStyles.setStrokeColor(graphics2d);
+        // set stroke width
+        CommonRenderingStyles.setStrokeZeroThick(graphics2d);
+        // set clip region and draw the path
+        drawLinePathDoubleClippedByEllipseShape(image, graphics2d);
         // test result
         return TestResult.PASSED;
     }
@@ -403,6 +471,7 @@
     /**
      * Check if line path could be clipped by an ellipse shape. Path is rendered
      * using stroke paint with thick stroke width.
+     * Line path is constructed using new Path.Float()
      * 
      * @param image
      *            work image
@@ -410,7 +479,7 @@
      *            graphics canvas
      * @return test result status - PASSED, FAILED or ERROR
      */
-    public TestResult testClipLinePathByEllipseShapeThickStrokePaint(TestImage image, Graphics2D graphics2d)
+    public TestResult testClipLineFloatPathByEllipseShapeThickStrokePaint(TestImage image, Graphics2D graphics2d)
     {
         // render ellipse which is used as a clip shape
         CommonClippingOperations.renderClipEllipse(image, graphics2d);
@@ -419,7 +488,32 @@
         // set stroke width
         CommonRenderingStyles.setStrokeThickWidth(graphics2d);
         // set clip region and draw the path
-        drawLinePathClippedByEllipseShape(image, graphics2d);
+        drawLinePathFloatClippedByEllipseShape(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 thick stroke width.
+     * Line path is constructed using new Path.Double()
+     * 
+     * @param image
+     *            work image
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testClipLineDoublePathByEllipseShapeThickStrokePaint(TestImage image, Graphics2D graphics2d)
+    {
+        // render ellipse which is used as a clip shape
+        CommonClippingOperations.renderClipEllipse(image, graphics2d);
+        // set stroke color
+        CommonRenderingStyles.setStrokeColor(graphics2d);
+        // set stroke width
+        CommonRenderingStyles.setStrokeThickWidth(graphics2d);
+        // set clip region and draw the path
+        drawLinePathDoubleClippedByEllipseShape(image, graphics2d);
         // test result
         return TestResult.PASSED;
     }
@@ -523,6 +617,7 @@
     /**
      * Check if line path could be clipped by an ellipse shape. Path is rendered
      * using stroke paint with extra thick width.
+     * Line path is constructed using new Path.Float()
      * 
      * @param image
      *            work image
@@ -530,7 +625,7 @@
      *            graphics canvas
      * @return test result status - PASSED, FAILED or ERROR
      */
-    public TestResult testClipLinePathByEllipseShapeExtraThickStrokePaint(TestImage image, Graphics2D graphics2d)
+    public TestResult testClipLinePathFloatByEllipseShapeExtraThickStrokePaint(TestImage image, Graphics2D graphics2d)
     {
         // render ellipse which is used as a clip shape
         CommonClippingOperations.renderClipEllipse(image, graphics2d);
@@ -539,7 +634,32 @@
         // set stroke width
         CommonRenderingStyles.setStrokeExtraThickWidth(graphics2d);
         // set clip region and draw the path
-        drawLinePathClippedByEllipseShape(image, graphics2d);
+        drawLinePathFloatClippedByEllipseShape(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 extra thick width.
+     * Line path is constructed using new Path.Double()
+     * 
+     * @param image
+     *            work image
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testClipLinePathDoubleByEllipseShapeExtraThickStrokePaint(TestImage image, Graphics2D graphics2d)
+    {
+        // render ellipse which is used as a clip shape
+        CommonClippingOperations.renderClipEllipse(image, graphics2d);
+        // set stroke color
+        CommonRenderingStyles.setStrokeColor(graphics2d);
+        // set stroke width
+        CommonRenderingStyles.setStrokeExtraThickWidth(graphics2d);
+        // set clip region and draw the path
+        drawLinePathDoubleClippedByEllipseShape(image, graphics2d);
         // test result
         return TestResult.PASSED;
     }
@@ -643,6 +763,7 @@
     /**
      * 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()
      * 
      * @param image
      *            work image
@@ -650,14 +771,37 @@
      *            graphics canvas
      * @return test result status - PASSED, FAILED or ERROR
      */
-    public TestResult testClipLinePathByEllipseShapeDashedStrokePaint(TestImage image, Graphics2D graphics2d)
+    public TestResult testClipLinePathFloatByEllipseShapeDashedStrokePaint(TestImage image, Graphics2D graphics2d)
     {
         // render clip ellipse shape
         CommonClippingOperations.renderClipEllipse(image, graphics2d);
         // set dashed pattern
         CommonRenderingStyles.setDashedStrokePattern(graphics2d);
         // set clip region and draw the path
-        drawLinePathClippedByEllipseShape(image, graphics2d);
+        drawLinePathFloatClippedByEllipseShape(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 default stroke width.
+     * Line path is constructed using new Path.Double()
+     * 
+     * @param image
+     *            work image
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testClipLinePathDoubleByEllipseShapeDashedStrokePaint(TestImage image, Graphics2D graphics2d)
+    {
+        // render clip ellipse shape
+        CommonClippingOperations.renderClipEllipse(image, graphics2d);
+        // set dashed pattern
+        CommonRenderingStyles.setDashedStrokePattern(graphics2d);
+        // set clip region and draw the path
+        drawLinePathDoubleClippedByEllipseShape(image, graphics2d);
         // test result
         return TestResult.PASSED;
     }
@@ -753,6 +897,7 @@
     /**
      * Check if line path could be clipped by an ellipse shape. Path is
      * rendered using stroke paint with thick stroke width.
+     * Line path is constructed using new Path.Float()
      * 
      * @param image
      *            work image
@@ -760,7 +905,7 @@
      *            graphics canvas
      * @return test result status - PASSED, FAILED or ERROR
      */
-    public TestResult testClipLinePathByEllipseShapeDashedThickStrokePaint(TestImage image, Graphics2D graphics2d)
+    public TestResult testClipLinePathFloatByEllipseShapeDashedThickStrokePaint(TestImage image, Graphics2D graphics2d)
     {
         // render clip ellipse
         CommonClippingOperations.renderClipEllipse(image, graphics2d);
@@ -769,7 +914,32 @@
         // set dashed pattern
         CommonRenderingStyles.setDashedStrokePattern(graphics2d);
         // set clip region and draw the path
-        drawLinePathClippedByEllipseShape(image, graphics2d);
+        drawLinePathFloatClippedByEllipseShape(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 thick stroke width.
+     * Line path is constructed using new Path.Double()
+     * 
+     * @param image
+     *            work image
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testClipLinePathDoubleByEllipseShapeDashedThickStrokePaint(TestImage image, Graphics2D graphics2d)
+    {
+        // render clip ellipse
+        CommonClippingOperations.renderClipEllipse(image, graphics2d);
+        // set stroke width
+        CommonRenderingStyles.setStrokeThickWidth(graphics2d);
+        // set dashed pattern
+        CommonRenderingStyles.setDashedStrokePattern(graphics2d);
+        // set clip region and draw the path
+        drawLinePathDoubleClippedByEllipseShape(image, graphics2d);
         // test result
         return TestResult.PASSED;
     }



More information about the distro-pkg-dev mailing list