/hg/gfx-test: * src/org/gfxtest/testsuites/ClippingCircleByRound...
ptisnovs at icedtea.classpath.org
ptisnovs at icedtea.classpath.org
Wed Apr 4 02:54:53 PDT 2012
changeset b26c11e47283 in /hg/gfx-test
details: http://icedtea.classpath.org/hg/gfx-test?cmd=changeset;node=b26c11e47283
author: Pavel Tisnovsky <ptisnovs at redhat.com>
date: Wed Apr 04 11:57:23 2012 +0200
* src/org/gfxtest/testsuites/ClippingCircleByRoundRectangleShape.java:
Added new tests to this test suite.
diffstat:
ChangeLog | 5 +
src/org/gfxtest/testsuites/ClippingPathByRoundRectangleShape.java | 144 +++++++++-
2 files changed, 147 insertions(+), 2 deletions(-)
diffs (194 lines):
diff -r 0ff7c385c559 -r b26c11e47283 ChangeLog
--- a/ChangeLog Mon Mar 26 11:56:56 2012 +0200
+++ b/ChangeLog Wed Apr 04 11:57:23 2012 +0200
@@ -1,3 +1,8 @@
+2012-04-04 Pavel Tisnovsky <ptisnovs at redhat.com>
+
+ * src/org/gfxtest/testsuites/ClippingCircleByRoundRectangleShape.java:
+ Added new tests to this test suite.
+
2012-03-26 Pavel Tisnovsky <ptisnovs at redhat.com>
* src/org/gfxtest/testsuites/ClippingPathByEllipseShape.java:
diff -r 0ff7c385c559 -r b26c11e47283 src/org/gfxtest/testsuites/ClippingPathByRoundRectangleShape.java
--- a/src/org/gfxtest/testsuites/ClippingPathByRoundRectangleShape.java Mon Mar 26 11:56:56 2012 +0200
+++ b/src/org/gfxtest/testsuites/ClippingPathByRoundRectangleShape.java Wed Apr 04 11:57:23 2012 +0200
@@ -1,7 +1,7 @@
/*
Java gfx-test framework
- Copyright (C) 2010, 2011 Red Hat
+ Copyright (C) 2010, 2011, 2012 Red Hat
This file is part of IcedTea.
@@ -40,6 +40,7 @@
package org.gfxtest.testsuites;
+import java.awt.BasicStroke;
import java.awt.Graphics2D;
@@ -141,7 +142,6 @@
graphics2d.draw(CommonPathsGenerator.createCubicPathFloat(image));
}
-
/**
* Draw closed path clipped by a round rectangle shape.
*
@@ -259,6 +259,26 @@
}
/**
+ * Check if crossed closed path could be clipped by a round rectangle shape. Path is
+ * rendered using stroke paint with default stroke width.
+ *
+ * @param image
+ * work image
+ * @param graphics2d
+ * graphics canvas
+ * @return test result status - PASSED, FAILED or ERROR
+ */
+ public TestResult testClipCrossedClosedPathByRoundRectangleShapeStrokePaint(TestImage image, Graphics2D graphics2d)
+ {
+ // render clip round rectangle
+ CommonClippingOperations.renderClipRoundRectangle(image, graphics2d);
+ // set clip region and draw the path
+ drawCrossedClosedPathClippedByRoundRectangleShape(image, graphics2d);
+ // test result
+ return TestResult.PASSED;
+ }
+
+ /**
* Check if crossed closed path could be clipped by a round rectangle shape.
* Path is rendered using stroke paint with default stroke width.
*
@@ -279,6 +299,126 @@
}
/**
+ * Check if line path could be clipped by a round rectangle shape. Path is
+ * rendered using stroke paint with zero stroke width.
+ *
+ * @param image
+ * work image
+ * @param graphics2d
+ * graphics canvas
+ * @return test result status - PASSED, FAILED or ERROR
+ */
+ public TestResult testClipLinePathByRoundRectangleShapeZeroStrokePaint(TestImage image, Graphics2D graphics2d)
+ {
+ // render clip rectangle
+ CommonClippingOperations.renderClipRoundRectangle(image, graphics2d);
+ // set stroke color
+ CommonRenderingStyles.setStrokeColor(graphics2d);
+ // set stroke width
+ CommonRenderingStyles.setStrokeZeroThick(graphics2d);
+ // set clip region and draw the path
+ drawLinePathClippedByRoundRectangleShape(image, graphics2d);
+ // test result
+ return TestResult.PASSED;
+ }
+
+ /**
+ * Check if quadratic path could be clipped by a round rectangle shape. Path is
+ * rendered using stroke paint with zero stroke width.
+ *
+ * @param image
+ * work image
+ * @param graphics2d
+ * graphics canvas
+ * @return test result status - PASSED, FAILED or ERROR
+ */
+ public TestResult testClipQuadraticPathByRoundRectangleShapeZeroStrokePaint(TestImage image, Graphics2D graphics2d)
+ {
+ // render clip rectangle
+ CommonClippingOperations.renderClipRoundRectangle(image, graphics2d);
+ // set stroke color
+ CommonRenderingStyles.setStrokeColor(graphics2d);
+ // set stroke width
+ CommonRenderingStyles.setStrokeZeroThick(graphics2d);
+ // set clip region and draw the path
+ drawQuadraticPathClippedByRoundRectangleShape(image, graphics2d);
+ // test result
+ return TestResult.PASSED;
+ }
+
+ /**
+ * Check if cubic path could be clipped by a round rectangle shape. Path is
+ * rendered using stroke paint with zero stroke width.
+ *
+ * @param image
+ * work image
+ * @param graphics2d
+ * graphics canvas
+ * @return test result status - PASSED, FAILED or ERROR
+ */
+ public TestResult testClipCubicPathByRoundRectangleShapeZeroStrokePaint(TestImage image, Graphics2D graphics2d)
+ {
+ // render clip rectangle
+ CommonClippingOperations.renderClipRoundRectangle(image, graphics2d);
+ // set stroke color
+ CommonRenderingStyles.setStrokeColor(graphics2d);
+ // set stroke width
+ CommonRenderingStyles.setStrokeZeroThick(graphics2d);
+ // set clip region and draw the path
+ drawCubicPathClippedByRoundRectangleShape(image, graphics2d);
+ // test result
+ return TestResult.PASSED;
+ }
+
+ /**
+ * Check if closed path could be clipped by a round rectangle shape. Path is
+ * rendered using stroke paint with zero stroke width.
+ *
+ * @param image
+ * work image
+ * @param graphics2d
+ * graphics canvas
+ * @return test result status - PASSED, FAILED or ERROR
+ */
+ public TestResult testClipClosedPathByRoundRectangleShapeZeroStrokePaint(TestImage image, Graphics2D graphics2d)
+ {
+ // render clip rectangle
+ CommonClippingOperations.renderClipRoundRectangle(image, graphics2d);
+ // set stroke color
+ CommonRenderingStyles.setStrokeColor(graphics2d);
+ // set stroke width
+ CommonRenderingStyles.setStrokeZeroThick(graphics2d);
+ // set clip region and draw the path
+ drawClosedPathClippedByRoundRectangleShape(image, graphics2d);
+ // test result
+ return TestResult.PASSED;
+ }
+
+ /**
+ * Check if crossed closed path could be clipped by a round rectangle shape. Path is
+ * rendered using stroke paint with zero stroke width.
+ *
+ * @param image
+ * work image
+ * @param graphics2d
+ * graphics canvas
+ * @return test result status - PASSED, FAILED or ERROR
+ */
+ public TestResult testClipCrossedClosedPathByRoundRectangleShapeZeroStrokePaint(TestImage image, Graphics2D graphics2d)
+ {
+ // render clip rectangle
+ CommonClippingOperations.renderClipRoundRectangle(image, graphics2d);
+ // set stroke color
+ CommonRenderingStyles.setStrokeColor(graphics2d);
+ // set stroke width
+ CommonRenderingStyles.setStrokeZeroThick(graphics2d);
+ // set clip region and draw the path
+ drawCrossedClosedPathClippedByRoundRectangleShape(image, graphics2d);
+ // test result
+ return TestResult.PASSED;
+ }
+
+ /**
* Entry point to the test suite.
*
* @param args
More information about the distro-pkg-dev
mailing list