/hg/gfx-test: * src/org/gfxtest/testsuites/ClippingPathByRectang...

ptisnovs at icedtea.classpath.org ptisnovs at icedtea.classpath.org
Wed Apr 18 06:08:18 PDT 2012


changeset 7adf78a0fba2 in /hg/gfx-test
details: http://icedtea.classpath.org/hg/gfx-test?cmd=changeset;node=7adf78a0fba2
author: Pavel Tisnovsky <ptisnovs at redhat.com>
date: Wed Apr 18 15:10:50 2012 +0200

	* src/org/gfxtest/testsuites/ClippingPathByRectangleArea.java:
		Added new tests to this test suite.


diffstat:

 ChangeLog                                                   |    5 +
 src/org/gfxtest/testsuites/ClippingPathByRectangleArea.java |  462 +++++++++++-
 2 files changed, 465 insertions(+), 2 deletions(-)

diffs (truncated from 505 to 500 lines):

diff -r 2bd442a17073 -r 7adf78a0fba2 ChangeLog
--- a/ChangeLog	Tue Apr 17 14:37:07 2012 +0200
+++ b/ChangeLog	Wed Apr 18 15:10:50 2012 +0200
@@ -1,3 +1,8 @@
+2012-04-18  Pavel Tisnovsky  <ptisnovs at redhat.com>
+
+	* src/org/gfxtest/testsuites/ClippingPathByRectangleArea.java:
+	Added new tests to this test suite.
+
 2012-04-17  Pavel Tisnovsky  <ptisnovs at redhat.com>
 
 	* src/org/gfxtest/reporter/Reporter.java:
diff -r 2bd442a17073 -r 7adf78a0fba2 src/org/gfxtest/testsuites/ClippingPathByRectangleArea.java
--- a/src/org/gfxtest/testsuites/ClippingPathByRectangleArea.java	Tue Apr 17 14:37:07 2012 +0200
+++ b/src/org/gfxtest/testsuites/ClippingPathByRectangleArea.java	Wed Apr 18 15:10:50 2012 +0200
@@ -74,6 +74,8 @@
 @Zoom(1)
 public class ClippingPathByRectangleArea extends GfxTest
 {
+    private static final float[] DOTTED_PATTERN = new float[] {1,40};
+
     /**
      * Prepare canvas for the rendering.
      *
@@ -1110,7 +1112,7 @@
 
     /**
      * Check if line path could be clipped by a rectangle area. Path is rendered
-     * using dotted stroke paint with normal stroke width and using round cap style.
+     * using dotted stroke paint with normal stroke width.
      * 
      * @param image
      *            work image
@@ -1125,7 +1127,7 @@
         // set stroke width
         //CommonRenderingStyles.setStrokeThickWidth(graphics2d, BasicStroke.CAP_ROUND);
         // set dashed pattern
-        CommonRenderingStyles.setDashedStrokePattern(graphics2d, new float[] {1,20});
+        CommonRenderingStyles.setDashedStrokePattern(graphics2d, DOTTED_PATTERN);
         // set clip region and draw the path
         drawLinePathClippedByRectangleArea(image, graphics2d);
         // test result
@@ -1133,6 +1135,462 @@
     }
 
     /**
+     * Check if quadratic path could be clipped by a rectangle area. Path is rendered
+     * using dotted stroke paint with normal stroke width.
+     * 
+     * @param image
+     *            work image
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testClipQuadraticPathByRectangleAreaDottedStrokePaint(TestImage image, Graphics2D graphics2d)
+    {
+        // render clip rectangle
+        CommonClippingOperations.renderClipRectangle(image, graphics2d);
+        // set stroke width
+        //CommonRenderingStyles.setStrokeThickWidth(graphics2d, BasicStroke.CAP_ROUND);
+        // set dashed pattern
+        CommonRenderingStyles.setDashedStrokePattern(graphics2d, DOTTED_PATTERN);
+        // set clip region and draw the path
+        drawQuadraticPathClippedByRectangleArea(image, graphics2d);
+        // test result
+        return TestResult.PASSED;
+    }
+
+    /**
+     * Check if cubic path could be clipped by a rectangle area. Path is rendered
+     * using dotted stroke paint with normal stroke width.
+     * 
+     * @param image
+     *            work image
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testClipCubicPathByRectangleAreaDottedStrokePaint(TestImage image, Graphics2D graphics2d)
+    {
+        // render clip rectangle
+        CommonClippingOperations.renderClipRectangle(image, graphics2d);
+        // set stroke width
+        //CommonRenderingStyles.setStrokeThickWidth(graphics2d, BasicStroke.CAP_ROUND);
+        // set dashed pattern
+        CommonRenderingStyles.setDashedStrokePattern(graphics2d, DOTTED_PATTERN);
+        // set clip region and draw the path
+        drawCubicPathClippedByRectangleArea(image, graphics2d);
+        // test result
+        return TestResult.PASSED;
+    }
+
+    /**
+     * Check if closed path could be clipped by a rectangle area. Path is rendered
+     * using dotted stroke paint with normal stroke width.
+     * 
+     * @param image
+     *            work image
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testClipClosedPathByRectangleAreaDottedStrokePaint(TestImage image, Graphics2D graphics2d)
+    {
+        // render clip rectangle
+        CommonClippingOperations.renderClipRectangle(image, graphics2d);
+        // set stroke width
+        //CommonRenderingStyles.setStrokeThickWidth(graphics2d, BasicStroke.CAP_ROUND);
+        // set dashed pattern
+        CommonRenderingStyles.setDashedStrokePattern(graphics2d, DOTTED_PATTERN);
+        // set clip region and draw the path
+        drawClosedPathClippedByRectangleArea(image, graphics2d);
+        // test result
+        return TestResult.PASSED;
+    }
+
+    /**
+     * Check if crossed closed path could be clipped by a rectangle area. Path is rendered
+     * using dotted stroke paint with normal stroke width.
+     * 
+     * @param image
+     *            work image
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testClipCrossedClosedPathByRectangleAreaDottedStrokePaint(TestImage image, Graphics2D graphics2d)
+    {
+        // render clip rectangle
+        CommonClippingOperations.renderClipRectangle(image, graphics2d);
+        // set stroke width
+        //CommonRenderingStyles.setStrokeThickWidth(graphics2d, BasicStroke.CAP_ROUND);
+        // set dashed pattern
+        CommonRenderingStyles.setDashedStrokePattern(graphics2d, DOTTED_PATTERN);
+        // set clip region and draw the path
+        drawCrossedClosedPathClippedByRectangleArea(image, graphics2d);
+        // test result
+        return TestResult.PASSED;
+    }
+
+    /**
+     * Check if line path could be clipped by a rectangle area. Path is rendered
+     * using dotted stroke paint with zero stroke width.
+     * 
+     * @param image
+     *            work image
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testClipLinePathByRectangleAreaDottedZeroStrokePaint(TestImage image, Graphics2D graphics2d)
+    {
+        // render clip rectangle
+        CommonClippingOperations.renderClipRectangle(image, graphics2d);
+        // set stroke width
+        CommonRenderingStyles.setStrokeZeroThick(graphics2d);
+        // set dashed pattern
+        CommonRenderingStyles.setDashedStrokePattern(graphics2d, DOTTED_PATTERN);
+        // set clip region and draw the path
+        drawLinePathClippedByRectangleArea(image, graphics2d);
+        // test result
+        return TestResult.PASSED;
+    }
+
+    /**
+     * Check if quadratic path could be clipped by a rectangle area. Path is rendered
+     * using dotted stroke paint with zero stroke width.
+     * 
+     * @param image
+     *            work image
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testClipQuadraticPathByRectangleAreaDottedZeroStrokePaint(TestImage image, Graphics2D graphics2d)
+    {
+        // render clip rectangle
+        CommonClippingOperations.renderClipRectangle(image, graphics2d);
+        // set stroke width
+        CommonRenderingStyles.setStrokeZeroThick(graphics2d);
+        // set dashed pattern
+        CommonRenderingStyles.setDashedStrokePattern(graphics2d, DOTTED_PATTERN);
+        // set clip region and draw the path
+        drawQuadraticPathClippedByRectangleArea(image, graphics2d);
+        // test result
+        return TestResult.PASSED;
+    }
+
+    /**
+     * Check if cubic path could be clipped by a rectangle area. Path is rendered
+     * using dotted stroke paint with zero stroke width.
+     * 
+     * @param image
+     *            work image
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testClipCubicPathByRectangleAreaDottedZeroStrokePaint(TestImage image, Graphics2D graphics2d)
+    {
+        // render clip rectangle
+        CommonClippingOperations.renderClipRectangle(image, graphics2d);
+        // set stroke width
+        CommonRenderingStyles.setStrokeZeroThick(graphics2d);
+        // set dashed pattern
+        CommonRenderingStyles.setDashedStrokePattern(graphics2d, DOTTED_PATTERN);
+        // set clip region and draw the path
+        drawCubicPathClippedByRectangleArea(image, graphics2d);
+        // test result
+        return TestResult.PASSED;
+    }
+
+    /**
+     * Check if closed path could be clipped by a rectangle area. Path is rendered
+     * using dotted stroke paint with zero stroke width.
+     * 
+     * @param image
+     *            work image
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testClipClosedPathByRectangleAreaDottedZeroStrokePaint(TestImage image, Graphics2D graphics2d)
+    {
+        // render clip rectangle
+        CommonClippingOperations.renderClipRectangle(image, graphics2d);
+        // set stroke width
+        CommonRenderingStyles.setStrokeZeroThick(graphics2d);
+        // set dashed pattern
+        CommonRenderingStyles.setDashedStrokePattern(graphics2d, DOTTED_PATTERN);
+        // set clip region and draw the path
+        drawClosedPathClippedByRectangleArea(image, graphics2d);
+        // test result
+        return TestResult.PASSED;
+    }
+
+    /**
+     * Check if crossed closed path could be clipped by a rectangle area. Path is rendered
+     * using dotted stroke paint with zero stroke width.
+     * 
+     * @param image
+     *            work image
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testClipCrossedClosedPathByRectangleAreaDottedZeroStrokePaint(TestImage image, Graphics2D graphics2d)
+    {
+        // render clip rectangle
+        CommonClippingOperations.renderClipRectangle(image, graphics2d);
+        // set stroke width
+        CommonRenderingStyles.setStrokeZeroThick(graphics2d);
+        // set dashed pattern
+        CommonRenderingStyles.setDashedStrokePattern(graphics2d, DOTTED_PATTERN);
+        // set clip region and draw the path
+        drawCrossedClosedPathClippedByRectangleArea(image, graphics2d);
+        // test result
+        return TestResult.PASSED;
+    }
+
+    /**
+     * Check if line path could be clipped by a rectangle area. Path is rendered
+     * using dotted stroke paint with thick stroke width.
+     * 
+     * @param image
+     *            work image
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testClipLinePathByRectangleAreaDottedThickStrokePaint(TestImage image, Graphics2D graphics2d)
+    {
+        // render clip rectangle
+        CommonClippingOperations.renderClipRectangle(image, graphics2d);
+        // set stroke width
+        CommonRenderingStyles.setStrokeThickWidth(graphics2d, BasicStroke.CAP_ROUND);
+        // set dashed pattern
+        CommonRenderingStyles.setDashedStrokePattern(graphics2d, DOTTED_PATTERN);
+        // set clip region and draw the path
+        drawLinePathClippedByRectangleArea(image, graphics2d);
+        // test result
+        return TestResult.PASSED;
+    }
+
+    /**
+     * Check if quadratic path could be clipped by a rectangle area. Path is rendered
+     * using dotted stroke paint with thick stroke width.
+     * 
+     * @param image
+     *            work image
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testClipQuadraticPathByRectangleAreaDottedThickStrokePaint(TestImage image, Graphics2D graphics2d)
+    {
+        // render clip rectangle
+        CommonClippingOperations.renderClipRectangle(image, graphics2d);
+        // set stroke width
+        CommonRenderingStyles.setStrokeThickWidth(graphics2d, BasicStroke.CAP_ROUND);
+        // set dashed pattern
+        CommonRenderingStyles.setDashedStrokePattern(graphics2d, DOTTED_PATTERN);
+        // set clip region and draw the path
+        drawQuadraticPathClippedByRectangleArea(image, graphics2d);
+        // test result
+        return TestResult.PASSED;
+    }
+
+    /**
+     * Check if cubic path could be clipped by a rectangle area. Path is rendered
+     * using dotted stroke paint with thick stroke width.
+     * 
+     * @param image
+     *            work image
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testClipCubicPathByRectangleAreaDottedThickStrokePaint(TestImage image, Graphics2D graphics2d)
+    {
+        // render clip rectangle
+        CommonClippingOperations.renderClipRectangle(image, graphics2d);
+        // set stroke width
+        CommonRenderingStyles.setStrokeThickWidth(graphics2d, BasicStroke.CAP_ROUND);
+        // set dashed pattern
+        CommonRenderingStyles.setDashedStrokePattern(graphics2d, DOTTED_PATTERN);
+        // set clip region and draw the path
+        drawCubicPathClippedByRectangleArea(image, graphics2d);
+        // test result
+        return TestResult.PASSED;
+    }
+
+    /**
+     * Check if closed path could be clipped by a rectangle area. Path is rendered
+     * using dotted stroke paint with thick stroke width.
+     * 
+     * @param image
+     *            work image
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testClipClosedPathByRectangleAreaDottedThickStrokePaint(TestImage image, Graphics2D graphics2d)
+    {
+        // render clip rectangle
+        CommonClippingOperations.renderClipRectangle(image, graphics2d);
+        // set stroke width
+        CommonRenderingStyles.setStrokeThickWidth(graphics2d, BasicStroke.CAP_ROUND);
+        // set dashed pattern
+        CommonRenderingStyles.setDashedStrokePattern(graphics2d, DOTTED_PATTERN);
+        // set clip region and draw the path
+        drawClosedPathClippedByRectangleArea(image, graphics2d);
+        // test result
+        return TestResult.PASSED;
+    }
+
+    /**
+     * Check if crossed closed path could be clipped by a rectangle area. Path is rendered
+     * using dotted stroke paint with thick stroke width.
+     * 
+     * @param image
+     *            work image
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testClipCrossedClosedPathByRectangleAreaDottedThickStrokePaint(TestImage image, Graphics2D graphics2d)
+    {
+        // render clip rectangle
+        CommonClippingOperations.renderClipRectangle(image, graphics2d);
+        // set stroke width
+        CommonRenderingStyles.setStrokeThickWidth(graphics2d, BasicStroke.CAP_ROUND);
+        // set dashed pattern
+        CommonRenderingStyles.setDashedStrokePattern(graphics2d, DOTTED_PATTERN);
+        // set clip region and draw the path
+        drawCrossedClosedPathClippedByRectangleArea(image, graphics2d);
+        // test result
+        return TestResult.PASSED;
+    }
+
+    /**
+     * Check if line path could be clipped by a rectangle area. Path is rendered
+     * using dotted stroke paint with extra thick stroke width.
+     * 
+     * @param image
+     *            work image
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testClipLinePathByRectangleAreaDottedExtraThickStrokePaint(TestImage image, Graphics2D graphics2d)
+    {
+        // render clip rectangle
+        CommonClippingOperations.renderClipRectangle(image, graphics2d);
+        // set stroke width
+        CommonRenderingStyles.setStrokeExtraThickWidth(graphics2d, BasicStroke.CAP_ROUND);
+        // set dashed pattern
+        CommonRenderingStyles.setDashedStrokePattern(graphics2d, DOTTED_PATTERN);
+        // set clip region and draw the path
+        drawLinePathClippedByRectangleArea(image, graphics2d);
+        // test result
+        return TestResult.PASSED;
+    }
+
+    /**
+     * Check if quadratic path could be clipped by a rectangle area. Path is rendered
+     * using dotted stroke paint with extra thick stroke width.
+     * 
+     * @param image
+     *            work image
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testClipQuadraticPathByRectangleAreaDottedExtraThickStrokePaint(TestImage image, Graphics2D graphics2d)
+    {
+        // render clip rectangle
+        CommonClippingOperations.renderClipRectangle(image, graphics2d);
+        // set stroke width
+        CommonRenderingStyles.setStrokeExtraThickWidth(graphics2d, BasicStroke.CAP_ROUND);
+        // set dashed pattern
+        CommonRenderingStyles.setDashedStrokePattern(graphics2d, DOTTED_PATTERN);
+        // set clip region and draw the path
+        drawQuadraticPathClippedByRectangleArea(image, graphics2d);
+        // test result
+        return TestResult.PASSED;
+    }
+
+    /**
+     * Check if cubic path could be clipped by a rectangle area. Path is rendered
+     * using dotted stroke paint with extra thick stroke width.
+     * 
+     * @param image
+     *            work image
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testClipCubicPathByRectangleAreaDottedExtraThickStrokePaint(TestImage image, Graphics2D graphics2d)
+    {
+        // render clip rectangle
+        CommonClippingOperations.renderClipRectangle(image, graphics2d);
+        // set stroke width
+        CommonRenderingStyles.setStrokeExtraThickWidth(graphics2d, BasicStroke.CAP_ROUND);
+        // set dashed pattern
+        CommonRenderingStyles.setDashedStrokePattern(graphics2d, DOTTED_PATTERN);
+        // set clip region and draw the path
+        drawCubicPathClippedByRectangleArea(image, graphics2d);
+        // test result
+        return TestResult.PASSED;
+    }
+
+    /**
+     * Check if closed path could be clipped by a rectangle area. Path is rendered
+     * using dotted stroke paint with extra thick stroke width.
+     * 
+     * @param image
+     *            work image
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testClipClosedPathByRectangleAreaDottedExtraThickStrokePaint(TestImage image, Graphics2D graphics2d)
+    {
+        // render clip rectangle
+        CommonClippingOperations.renderClipRectangle(image, graphics2d);
+        // set stroke width
+        CommonRenderingStyles.setStrokeExtraThickWidth(graphics2d, BasicStroke.CAP_ROUND);
+        // set dashed pattern
+        CommonRenderingStyles.setDashedStrokePattern(graphics2d, DOTTED_PATTERN);
+        // set clip region and draw the path
+        drawClosedPathClippedByRectangleArea(image, graphics2d);
+        // test result
+        return TestResult.PASSED;
+    }
+
+    /**
+     * Check if crossed closed path could be clipped by a rectangle area. Path is rendered
+     * using dotted stroke paint with extra thick stroke width.
+     * 
+     * @param image
+     *            work image
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testClipCrossedClosedPathByRectangleAreaDottedExtraThickStrokePaint(TestImage image, Graphics2D graphics2d)
+    {
+        // render clip rectangle
+        CommonClippingOperations.renderClipRectangle(image, graphics2d);
+        // set stroke width
+        CommonRenderingStyles.setStrokeExtraThickWidth(graphics2d, BasicStroke.CAP_ROUND);
+        // set dashed pattern
+        CommonRenderingStyles.setDashedStrokePattern(graphics2d, DOTTED_PATTERN);
+        // set clip region and draw the path
+        drawCrossedClosedPathClippedByRectangleArea(image, graphics2d);
+        // test result
+        return TestResult.PASSED;
+    }



More information about the distro-pkg-dev mailing list