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

ptisnovs at icedtea.classpath.org ptisnovs at icedtea.classpath.org
Mon Nov 21 03:01:29 PST 2011


changeset 009c81195a99 in /hg/gfx-test
details: http://icedtea.classpath.org/hg/gfx-test?cmd=changeset;node=009c81195a99
author: Pavel Tisnovsky <ptisnovs at redhat.com>
date: Mon Nov 21 12:02:48 2011 +0100

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


diffstat:

 ChangeLog                                                    |    5 +
 src/org/gfxtest/testsuites/ClippingCircleByEllipseShape.java |  260 +++++++++++
 2 files changed, 265 insertions(+), 0 deletions(-)

diffs (290 lines):

diff -r ee567b76ecc2 -r 009c81195a99 ChangeLog
--- a/ChangeLog	Fri Nov 11 12:25:13 2011 +0100
+++ b/ChangeLog	Mon Nov 21 12:02:48 2011 +0100
@@ -1,3 +1,8 @@
+2011-11-21  Pavel Tisnovsky  <ptisnovs at redhat.com>
+
+	* src/org/gfxtest/testsuites/ClippingCircleByEllipseShape.java:
+	Added nine new tests to this test suite.
+
 2011-11-11  Pavel Tisnovsky  <ptisnovs at redhat.com>
 
 	* Makefile: updated
diff -r ee567b76ecc2 -r 009c81195a99 src/org/gfxtest/testsuites/ClippingCircleByEllipseShape.java
--- a/src/org/gfxtest/testsuites/ClippingCircleByEllipseShape.java	Fri Nov 11 12:25:13 2011 +0100
+++ b/src/org/gfxtest/testsuites/ClippingCircleByEllipseShape.java	Mon Nov 21 12:02:48 2011 +0100
@@ -40,7 +40,16 @@
 
 package org.gfxtest.testsuites;
 
+import java.awt.Graphics2D;
+
+
+
+import org.gfxtest.framework.CommonClippingOperations;
+import org.gfxtest.framework.CommonRenderingStyles;
+import org.gfxtest.framework.CommonShapesRenderer;
 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;
@@ -61,6 +70,257 @@
 @Zoom(1)
 public class ClippingCircleByEllipseShape 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 empty circle clipped by an ellipse shape.
+     *
+     * @param image
+     *            work image
+     * @param graphics2d
+     *            graphics canvas
+     */
+    private static void drawEmptyCircleClippedByEllipseShape(TestImage image, Graphics2D graphics2d)
+    {
+        // prepare canvas for the rendering
+        basicSetupForRendering(image, graphics2d);
+        // set stroke color
+        CommonRenderingStyles.setStrokeColor(graphics2d);
+        // draw the area
+        CommonShapesRenderer.drawCircle(image, graphics2d);
+    }
+
+    /**
+     * Draw empty circle clipped by an ellipse shape.
+     *
+     * @param image
+     *            work image
+     * @param graphics2d
+     *            graphics canvas
+     */
+    private static void drawFilledCircleClippedByEllipseShape(TestImage image, Graphics2D graphics2d)
+    {
+        // prepare canvas for the rendering
+        basicSetupForRendering(image, graphics2d);
+        // fill the area
+        CommonShapesRenderer.drawFilledCircle(image, graphics2d);
+    }
+
+    /**
+     * Check if circle shape could be clipped by an ellipse shape. Circle is
+     * rendered using stroke paint.
+     * 
+     * @param image
+     *            work image
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testClipCircleByEllipseShapeStrokePaint(TestImage image, Graphics2D graphics2d)
+    {
+        // render an ellipse which is used as a base for clip shape
+        CommonClippingOperations.renderClipEllipse(image, graphics2d);
+        // set clip region and draw the circle
+        drawEmptyCircleClippedByEllipseShape(image, graphics2d);
+        // test result
+        return TestResult.PASSED;
+    }
+
+    /**
+     * Check if circle shape could be clipped by an ellipse shape. Circle is
+     * rendered using wide stroke paint.
+     * 
+     * @param image
+     *            work image
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testClipCircleByEllipseShapeWideStrokePaint(TestImage image, Graphics2D graphics2d)
+    {
+        // render an ellipse which is used as a base for clip shape
+        CommonClippingOperations.renderClipEllipse(image, graphics2d);
+        // set stroke width
+        CommonRenderingStyles.setStrokeThickWidth(graphics2d);
+        // set clip region and draw the circle
+        drawEmptyCircleClippedByEllipseShape(image, graphics2d);
+        // test result
+        return TestResult.PASSED;
+    }
+
+    /**
+     * Check if circle shape could be clipped by an ellipse shape. Circle is
+     * rendered using extra wide stroke paint.
+     * 
+     * @param image
+     *            work image
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testClipCircleByEllipseShapeExtraWideStrokePaint(TestImage image, Graphics2D graphics2d)
+    {
+        // render an ellipse which is used as a base for clip shape
+        CommonClippingOperations.renderClipEllipse(image, graphics2d);
+        // set stroke width
+        CommonRenderingStyles.setStrokeExtraThickWidth(graphics2d);
+        // set clip region and draw the circle
+        drawEmptyCircleClippedByEllipseShape(image, graphics2d);
+        // test result
+        return TestResult.PASSED;
+    }
+
+    /**
+     * Check if circle shape could be clipped by an ellipse shape. Circle is
+     * rendered using color paint.
+     * 
+     * @param image
+     *            work image
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testClipCircleByEllipseShapeColorPaint(TestImage image, Graphics2D graphics2d)
+    {
+        // render an ellipse which is used as a base for clip shape
+        CommonClippingOperations.renderClipEllipse(image, graphics2d);
+        // set stroke color
+        CommonRenderingStyles.setStrokeColor(graphics2d);
+        // set fill color
+        CommonRenderingStyles.setFillColor(graphics2d);
+        // create clip area
+        CommonClippingOperations.createClipUsingEllipseShape(image, graphics2d);
+        // fill the area
+        CommonShapesRenderer.drawFilledCircle(image, graphics2d);
+        // test result
+        return TestResult.PASSED;
+    }
+
+    /**
+     * Check if circle shape could be clipped by an ellipse shape. Circle is
+     * rendered using alpha paint.
+     * 
+     * @param image
+     *            work image
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testClipCircleByEllipseShapeAlphaPaintBlue25(TestImage image, Graphics2D graphics2d)
+    {
+        // render an ellipse which is used as a base for clip shape
+        CommonClippingOperations.renderClipEllipse(image, graphics2d);
+        // set stroke color
+        CommonRenderingStyles.setStrokeColor(graphics2d);
+        // set fill color
+        CommonRenderingStyles.setTransparentFillBlueColor(graphics2d, 25);
+        // create clip area
+        CommonClippingOperations.createClipUsingEllipseShape(image, graphics2d);
+        // fill the area
+        CommonShapesRenderer.drawFilledCircle(image, graphics2d);
+        // test result
+        return TestResult.PASSED;
+    }
+
+    /**
+     * Check if circle shape could be clipped by an ellipse shape. Circle is
+     * rendered using horizontal gradient paint.
+     * 
+     * @param image
+     *            work image
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testClipCircleByEllipseShapeHorizontalGradientPaint(TestImage image, Graphics2D graphics2d)
+    {
+        // render an ellipse which is used as a base for clip shape
+        CommonClippingOperations.renderClipEllipse(image, graphics2d);
+        // set horizontal gradient paint
+        CommonRenderingStyles.setHorizontalGradientFill(image, graphics2d);
+        // set clip region and draw the circle
+        drawFilledCircleClippedByEllipseShape(image, graphics2d);
+        // test result
+        return TestResult.PASSED;
+    }
+
+    /**
+     * Check if circle shape could be clipped by an ellipse shape. Circle is
+     * rendered using vertical gradient paint.
+     * 
+     * @param image
+     *            work image
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testClipCircleByEllipseShapeVerticalGradientPaint(TestImage image, Graphics2D graphics2d)
+    {
+        // render an ellipse which is used as a base for clip shape
+        CommonClippingOperations.renderClipEllipse(image, graphics2d);
+        // set vertical gradient paint
+        CommonRenderingStyles.setVerticalGradientFill(image, graphics2d);
+        // set clip region and draw the circle
+        drawFilledCircleClippedByEllipseShape(image, graphics2d);
+        // test result
+        return TestResult.PASSED;
+    }
+
+    /**
+     * Check if circle shape could be clipped by an ellipse shape. Circle is
+     * rendered using diagonal gradient paint.
+     * 
+     * @param image
+     *            work image
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testClipCircleByEllipseShapeDiagonalGradientPaint(TestImage image, Graphics2D graphics2d)
+    {
+        // render an ellipse which is used as a base for clip shape
+        CommonClippingOperations.renderClipEllipse(image, graphics2d);
+        // set diagonal gradient paint
+        CommonRenderingStyles.setDiagonalGradientFill(image, graphics2d);
+        // set clip region and draw the circle
+        drawFilledCircleClippedByEllipseShape(image, graphics2d);
+        // test result
+        return TestResult.PASSED;
+    }
+
+    /**
+     * Check if circle shape could be clipped by an ellipse shape. Circle is
+     * rendered using radial gradient paint.
+     * 
+     * @param image
+     *            work image
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testClipCircleByEllipseShapeRadialGradientPaint(TestImage image, Graphics2D graphics2d)
+    {
+        // render an ellipse which is used as a base for clip shape
+        CommonClippingOperations.renderClipEllipse(image, graphics2d);
+        // set radial gradient paint
+        CommonRenderingStyles.setRadialGradientFill(image, graphics2d);
+        // set clip region and draw the circle
+        drawFilledCircleClippedByEllipseShape(image, graphics2d);
+        // test result
+        return TestResult.PASSED;
+    }
 
     /**
      * Entry point to the test suite.



More information about the distro-pkg-dev mailing list