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

ptisnovs at icedtea.classpath.org ptisnovs at icedtea.classpath.org
Wed Nov 9 01:14:00 PST 2011


changeset 7bbb18623f9e in /hg/gfx-test
details: http://icedtea.classpath.org/hg/gfx-test?cmd=changeset;node=7bbb18623f9e
author: Pavel Tisnovsky <ptisnovs at redhat.com>
date: Wed Nov 09 10:15:54 2011 +0100

	2011-11-09 Pavel Tisnovsky <ptisnovs at redhat.com>

	 * Makefile: updated
		* src/org/gfxtest/framework/CommonClippingOperations.java:
	Refactoring, added eight new tests to this test suite.


diffstat:

 ChangeLog                                                     |    6 +
 Makefile                                                      |    7 +-
 src/org/gfxtest/testsuites/ClippingCircleByRectangleArea.java |  319 +++++++--
 3 files changed, 258 insertions(+), 74 deletions(-)

diffs (477 lines):

diff -r 843d131b0d88 -r 7bbb18623f9e ChangeLog
--- a/ChangeLog	Tue Nov 08 12:51:12 2011 +0100
+++ b/ChangeLog	Wed Nov 09 10:15:54 2011 +0100
@@ -1,3 +1,9 @@
+2011-11-09  Pavel Tisnovsky  <ptisnovs at redhat.com>
+
+	* Makefile: updated
+	* src/org/gfxtest/framework/CommonClippingOperations.java:
+	Refactoring, added eight new tests to this test suite.
+
 2011-11-08  Pavel Tisnovsky  <ptisnovs at redhat.com>
 
 	* src/org/gfxtest/framework/CommonClippingOperations.java:
diff -r 843d131b0d88 -r 7bbb18623f9e Makefile
--- a/Makefile	Tue Nov 08 12:51:12 2011 +0100
+++ b/Makefile	Wed Nov 09 10:15:54 2011 +0100
@@ -79,6 +79,7 @@
 	$(CLASSES)/$(FRAMEWORK_DIR)/CommonCAGOperations.class \
 	$(CLASSES)/$(FRAMEWORK_DIR)/CommonRenderingStyles.class \
 	$(CLASSES)/$(FRAMEWORK_DIR)/CommonShapesRenderer.class \
+	$(CLASSES)/$(FRAMEWORK_DIR)/CommonClippingOperations.class \
 	$(CLASSES)/$(FRAMEWORK_DIR)/EntityRenderingStyle.class \
 	$(CLASSES)/$(FRAMEWORK_DIR)/TestResult.class \
 	$(CLASSES)/$(FRAMEWORK_DIR)/ParameterNotFoundException.class \
@@ -145,7 +146,8 @@
 	$(CLASSES)/$(TESTSUITE_DIR)/CAGOperationsOnTwoOverlappingRectangles.class \
 	$(CLASSES)/$(TESTSUITE_DIR)/CAGOperationsOnCircleAndRectangle.class \
 	$(CLASSES)/$(TESTSUITE_DIR)/TexturePaint.class \
-	$(CLASSES)/$(TESTSUITE_DIR)/Clipping.class
+	$(CLASSES)/$(TESTSUITE_DIR)/Clipping.class \
+	$(CLASSES)/$(TESTSUITE_DIR)/ClippingCircleByRectangleArea.class
 
 COMPARE_RESULTS = \
 	$(RESULTS)/Areas \
@@ -194,7 +196,8 @@
 	$(RESULTS)/CAGOperationsOnTwoOverlappingRectangles \
 	$(RESULTS)/CAGOperationsOnCircleAndRectangle \
 	$(RESULTS)/TexturePaint \
-	$(RESULTS)/Clipping
+	$(RESULTS)/Clipping \
+	$(RESULTS)/ClippingCircleByRectangleArea
 
 # targets for all test suites
 TESTSUITES = $(shell ls -1 src/org/gfxtest/testsuites | sed -n -e 's/\([A-Za-z0-9]*\)\.java/\1/p')
diff -r 843d131b0d88 -r 7bbb18623f9e src/org/gfxtest/testsuites/ClippingCircleByRectangleArea.java
--- a/src/org/gfxtest/testsuites/ClippingCircleByRectangleArea.java	Tue Nov 08 12:51:12 2011 +0100
+++ b/src/org/gfxtest/testsuites/ClippingCircleByRectangleArea.java	Wed Nov 09 10:15:54 2011 +0100
@@ -70,6 +70,53 @@
 @Zoom(1)
 public class ClippingCircleByRectangleArea 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.createClipUsingRectangleArea(image, graphics2d);
+    }
+
+    /**
+     * Draw empty circle clipped by rectangle area.
+     *
+     * @param image
+     *            work image
+     * @param graphics2d
+     *            graphics canvas
+     */
+    private static void drawEmptyCircleClippedByRectangleArea(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 rectangle area.
+     *
+     * @param image
+     *            work image
+     * @param graphics2d
+     *            graphics canvas
+     */
+    private static void drawFilledCircleClippedByRectangleArea(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 a rectangle area. Circle is
@@ -85,12 +132,8 @@
     {
         // render clip rectangle
         CommonClippingOperations.renderClipRectangle(image, graphics2d);
-        // set stroke color
-        CommonRenderingStyles.setStrokeColor(graphics2d);
-        // create clip area
-        CommonClippingOperations.createClipUsingRectangleArea(image, graphics2d);
-        // draw the area
-        CommonShapesRenderer.drawCircle(image, graphics2d);
+        // set clip region and draw the circle
+        drawEmptyCircleClippedByRectangleArea(image, graphics2d);
         // test result
         return TestResult.PASSED;
     }
@@ -109,14 +152,10 @@
     {
         // render clip rectangle
         CommonClippingOperations.renderClipRectangle(image, graphics2d);
-        // set stroke color
-        CommonRenderingStyles.setStrokeColor(graphics2d);
         // set stroke width
         CommonRenderingStyles.setStrokeThickWidth(graphics2d);
-        // create clip area
-        CommonClippingOperations.createClipUsingRectangleArea(image, graphics2d);
-        // draw the area
-        CommonShapesRenderer.drawCircle(image, graphics2d);
+        // set clip region and draw the circle
+        drawEmptyCircleClippedByRectangleArea(image, graphics2d);
         // test result
         return TestResult.PASSED;
     }
@@ -137,12 +176,8 @@
         CommonClippingOperations.renderClipRectangle(image, graphics2d);
         // set stroke width
         CommonRenderingStyles.setStrokeExtraThickWidth(graphics2d);
-        // set stroke color
-        CommonRenderingStyles.setStrokeColor(graphics2d);
-        // create clip area
-        CommonClippingOperations.createClipUsingRectangleArea(image, graphics2d);
-        // draw the area
-        CommonShapesRenderer.drawCircle(image, graphics2d);
+        // set clip region and draw the circle
+        drawEmptyCircleClippedByRectangleArea(image, graphics2d);
         // test result
         return TestResult.PASSED;
     }
@@ -187,14 +222,10 @@
     {
         // render clip rectangle
         CommonClippingOperations.renderClipRectangle(image, graphics2d);
-        // set stroke color
-        CommonRenderingStyles.setStrokeColor(graphics2d);
         // set horizontal gradient paint
         CommonRenderingStyles.setHorizontalGradientFill(image, graphics2d);
-        // create horizontal gradient paint
-        CommonClippingOperations.createClipUsingRectangleArea(image, graphics2d);
-        // fill the area
-        CommonShapesRenderer.drawFilledCircle(image, graphics2d);
+        // set clip region and render filled circle
+        drawFilledCircleClippedByRectangleArea(image, graphics2d);
         // test result
         return TestResult.PASSED;
     }
@@ -213,14 +244,10 @@
     {
         // render clip rectangle
         CommonClippingOperations.renderClipRectangle(image, graphics2d);
-        // set stroke color
-        CommonRenderingStyles.setStrokeColor(graphics2d);
         // set vertical gradient paint
         CommonRenderingStyles.setVerticalGradientFill(image, graphics2d);
-        // create clip area
-        CommonClippingOperations.createClipUsingRectangleArea(image, graphics2d);
-        // fill the area
-        CommonShapesRenderer.drawFilledCircle(image, graphics2d);
+        // set clip region and render filled circle
+        drawFilledCircleClippedByRectangleArea(image, graphics2d);
         // test result
         return TestResult.PASSED;
     }
@@ -239,14 +266,10 @@
     {
         // render clip rectangle
         CommonClippingOperations.renderClipRectangle(image, graphics2d);
-        // set stroke color
-        CommonRenderingStyles.setStrokeColor(graphics2d);
         // set diagonal gradient paint
         CommonRenderingStyles.setDiagonalGradientFill(image, graphics2d);
-        // create clip area
-        CommonClippingOperations.createClipUsingRectangleArea(image, graphics2d);
-        // fill the area
-        CommonShapesRenderer.drawFilledCircle(image, graphics2d);
+        // set clip region and render filled circle
+        drawFilledCircleClippedByRectangleArea(image, graphics2d);
         // test result
         return TestResult.PASSED;
     }
@@ -265,14 +288,10 @@
     {
         // render clip rectangle
         CommonClippingOperations.renderClipRectangle(image, graphics2d);
-        // set stroke color
-        CommonRenderingStyles.setStrokeColor(graphics2d);
         // set radial gradient paint
         CommonRenderingStyles.setRadialGradientFill(image, graphics2d);
-        // create clip area
-        CommonClippingOperations.createClipUsingRectangleArea(image, graphics2d);
-        // fill the area
-        CommonShapesRenderer.drawFilledCircle(image, graphics2d);
+        // set clip region and render filled circle
+        drawFilledCircleClippedByRectangleArea(image, graphics2d);
         // test result
         return TestResult.PASSED;
     }
@@ -291,14 +310,10 @@
     {
         // render clip rectangle
         CommonClippingOperations.renderClipRectangle(image, graphics2d);
-        // set stroke color
-        CommonRenderingStyles.setStrokeColor(graphics2d);
         // set the texture
         CommonRenderingStyles.setTextureFillUsingCheckerTexture(image, graphics2d);
-        // create clip area
-        CommonClippingOperations.createClipUsingRectangleArea(image, graphics2d);
-        // fill the area
-        CommonShapesRenderer.drawFilledCircle(image, graphics2d);
+        // set clip region and render filled circle
+        drawFilledCircleClippedByRectangleArea(image, graphics2d);
         // test result
         return TestResult.PASSED;
     }
@@ -317,14 +332,186 @@
     {
         // render clip rectangle
         CommonClippingOperations.renderClipRectangle(image, graphics2d);
-        // set stroke color
-        CommonRenderingStyles.setStrokeColor(graphics2d);
         // set the texture
         CommonRenderingStyles.setTextureFillUsingDiagonalCheckerTexture(image, graphics2d);
-        // create clip area
-        CommonClippingOperations.createClipUsingRectangleArea(image, graphics2d);
-        // fill the area
-        CommonShapesRenderer.drawFilledCircle(image, graphics2d);
+        // set clip region and render filled circle
+        drawFilledCircleClippedByRectangleArea(image, graphics2d);
+        // test result
+        return TestResult.PASSED;
+    }
+
+    /**
+     * Check if circle shape could be clipped by a rectangle area. Circle is
+     * rendered using texture paint.
+     * 
+     * @param image
+     *            work image
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testClipCircleByRectangleAreaGridTexturePaint(TestImage image, Graphics2D graphics2d)
+    {
+        // render clip rectangle
+        CommonClippingOperations.renderClipRectangle(image, graphics2d);
+        // set the texture
+        CommonRenderingStyles.setTextureFillUsingGridTexture(image, graphics2d);
+        // set clip region and render filled circle
+        drawFilledCircleClippedByRectangleArea(image, graphics2d);
+        // test result
+        return TestResult.PASSED;
+    }
+
+    /**
+     * Check if circle shape could be clipped by a rectangle area. Circle is
+     * rendered using texture paint.
+     * 
+     * @param image
+     *            work image
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testClipCircleByRectangleAreaDiagonalGridTexturePaint(TestImage image, Graphics2D graphics2d)
+    {
+        // render clip rectangle
+        CommonClippingOperations.renderClipRectangle(image, graphics2d);
+        // set the texture
+        CommonRenderingStyles.setTextureFillUsingDiagonalGridTexture(image, graphics2d);
+        // set clip region and render filled circle
+        drawFilledCircleClippedByRectangleArea(image, graphics2d);
+        // test result
+        return TestResult.PASSED;
+    }
+
+    /**
+     * Check if circle shape could be clipped by a rectangle area. Circle is
+     * rendered using texture paint.
+     * 
+     * @param image
+     *            work image
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testClipCircleByRectangleAreaColorDotsTexturePaint(TestImage image, Graphics2D graphics2d)
+    {
+        // render clip rectangle
+        CommonClippingOperations.renderClipRectangle(image, graphics2d);
+        // set the texture
+        CommonRenderingStyles.setTextureFillUsingColorDotsTexture(image, graphics2d);
+        // set clip region and render filled circle
+        drawFilledCircleClippedByRectangleArea(image, graphics2d);
+        // test result
+        return TestResult.PASSED;
+    }
+
+    /**
+     * Check if circle shape could be clipped by a rectangle area. Circle is
+     * rendered using texture paint.
+     * 
+     * @param image
+     *            work image
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testClipCircleByRectangleAreaHorizontalStripesTexturePaint(TestImage image, Graphics2D graphics2d)
+    {
+        // render clip rectangle
+        CommonClippingOperations.renderClipRectangle(image, graphics2d);
+        // set the texture
+        CommonRenderingStyles.setTextureFillUsingHorizontalStripesTexture(image, graphics2d);
+        // set clip region and render filled circle
+        drawFilledCircleClippedByRectangleArea(image, graphics2d);
+        // test result
+        return TestResult.PASSED;
+    }
+
+    /**
+     * Check if circle shape could be clipped by a rectangle area. Circle is
+     * rendered using texture paint.
+     * 
+     * @param image
+     *            work image
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testClipCircleByRectangleAreaVerticalStripesTexturePaint(TestImage image, Graphics2D graphics2d)
+    {
+        // render clip rectangle
+        CommonClippingOperations.renderClipRectangle(image, graphics2d);
+        // set the texture
+        CommonRenderingStyles.setTextureFillUsingVerticalStripesTexture(image, graphics2d);
+        // set clip region and render filled circle
+        drawFilledCircleClippedByRectangleArea(image, graphics2d);
+        // test result
+        return TestResult.PASSED;
+    }
+
+    /**
+     * Check if circle shape could be clipped by a rectangle area. Circle is
+     * rendered using texture paint.
+     * 
+     * @param image
+     *            work image
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testClipCircleByRectangleAreaDiagonalStripesTexturePaint(TestImage image, Graphics2D graphics2d)
+    {
+        // render clip rectangle
+        CommonClippingOperations.renderClipRectangle(image, graphics2d);
+        // set the texture
+        CommonRenderingStyles.setTextureFillUsingDiagonalStripesTexture(image, graphics2d);
+        // set clip region and render filled circle
+        drawFilledCircleClippedByRectangleArea(image, graphics2d);
+        // test result
+        return TestResult.PASSED;
+    }
+
+    /**
+     * Check if circle shape could be clipped by a rectangle area. Circle is
+     * rendered using texture paint.
+     * 
+     * @param image
+     *            work image
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testClipCircleByRectangleAreaHorizontalColorStripesTexturePaint(TestImage image, Graphics2D graphics2d)
+    {
+        // render clip rectangle
+        CommonClippingOperations.renderClipRectangle(image, graphics2d);
+        // set the texture
+        CommonRenderingStyles.setTextureFillUsingHorizontalColorStripesTexture(image, graphics2d);
+        // set clip region and render filled circle
+        drawFilledCircleClippedByRectangleArea(image, graphics2d);
+        // test result
+        return TestResult.PASSED;
+    }
+
+    /**
+     * Check if circle shape could be clipped by a rectangle area. Circle is
+     * rendered using texture paint.
+     * 
+     * @param image
+     *            work image
+     * @param graphics2d
+     *            graphics canvas
+     * @return test result status - PASSED, FAILED or ERROR
+     */
+    public TestResult testClipCircleByRectangleAreaVerticalColorStripesTexturePaint(TestImage image, Graphics2D graphics2d)
+    {
+        // render clip rectangle
+        CommonClippingOperations.renderClipRectangle(image, graphics2d);
+        // set the texture
+        CommonRenderingStyles.setTextureFillUsingVerticalColorStripesTexture(image, graphics2d);
+        // set clip region and render filled circle
+        drawFilledCircleClippedByRectangleArea(image, graphics2d);
         // test result
         return TestResult.PASSED;
     }
@@ -343,14 +530,10 @@
     {
         // render clip rectangle
         CommonClippingOperations.renderClipRectangle(image, graphics2d);
-        // set stroke color
-        CommonRenderingStyles.setStrokeColor(graphics2d);
         // set the texture
         CommonRenderingStyles.setTextureFillUsingRGBTexture1(image, graphics2d);
-        // create clip area
-        CommonClippingOperations.createClipUsingRectangleArea(image, graphics2d);
-        // fill the area
-        CommonShapesRenderer.drawFilledCircle(image, graphics2d);
+        // set clip region and render filled circle
+        drawFilledCircleClippedByRectangleArea(image, graphics2d);
         // test result
         return TestResult.PASSED;
     }
@@ -369,14 +552,10 @@
     {
         // render clip rectangle
         CommonClippingOperations.renderClipRectangle(image, graphics2d);
-        // set stroke color
-        CommonRenderingStyles.setStrokeColor(graphics2d);
         // set the texture
         CommonRenderingStyles.setTextureFillUsingRGBTexture2(image, graphics2d);
-        // create clip area
-        CommonClippingOperations.createClipUsingRectangleArea(image, graphics2d);
-        // fill the area
-        CommonShapesRenderer.drawFilledCircle(image, graphics2d);
+        // set clip region and render filled circle
+        drawFilledCircleClippedByRectangleArea(image, graphics2d);
         // test result
         return TestResult.PASSED;
     }
@@ -395,14 +574,10 @@
     {
         // render clip rectangle
         CommonClippingOperations.renderClipRectangle(image, graphics2d);
-        // set stroke color
-        CommonRenderingStyles.setStrokeColor(graphics2d);
         // set the texture
         CommonRenderingStyles.setTextureFillUsingRGBTexture3(image, graphics2d);
-        // create clip area
-        CommonClippingOperations.createClipUsingRectangleArea(image, graphics2d);
-        // fill the area
-        CommonShapesRenderer.drawFilledCircle(image, graphics2d);
+        // set clip region and render filled circle
+        drawFilledCircleClippedByRectangleArea(image, graphics2d);
         // test result
         return TestResult.PASSED;
     }



More information about the distro-pkg-dev mailing list