/hg/gfx-test: Added and updated static methods in the class Comm...
ptisnovs at icedtea.classpath.org
ptisnovs at icedtea.classpath.org
Fri Nov 30 05:07:33 PST 2012
changeset 62c4c2946710 in /hg/gfx-test
details: http://icedtea.classpath.org/hg/gfx-test?cmd=changeset;node=62c4c2946710
author: Pavel Tisnovsky <ptisnovs at redhat.com>
date: Fri Nov 30 14:10:30 2012 +0100
Added and updated static methods in the class CommonPathsGenerator used by various tests.
diffstat:
ChangeLog | 5 +
src/org/gfxtest/framework/CommonPathsGenerator.java | 136 ++++++++++++++++++-
2 files changed, 132 insertions(+), 9 deletions(-)
diffs (193 lines):
diff -r f92cdf46d17a -r 62c4c2946710 ChangeLog
--- a/ChangeLog Thu Nov 29 10:12:29 2012 +0100
+++ b/ChangeLog Fri Nov 30 14:10:30 2012 +0100
@@ -1,3 +1,8 @@
+2012-11-30 Pavel Tisnovsky <ptisnovs at redhat.com>
+
+ * src/org/gfxtest/framework/CommonPathsGenerator.java:
+ Added and updated static methods used by various tests.
+
2012-11-29 Pavel Tisnovsky <ptisnovs at redhat.com>
* src/org/gfxtest/testsuites/BitBltUsingBgColor.java:
diff -r f92cdf46d17a -r 62c4c2946710 src/org/gfxtest/framework/CommonPathsGenerator.java
--- a/src/org/gfxtest/framework/CommonPathsGenerator.java Thu Nov 29 10:12:29 2012 +0100
+++ b/src/org/gfxtest/framework/CommonPathsGenerator.java Fri Nov 30 14:10:30 2012 +0100
@@ -192,6 +192,19 @@
* Create new path using Path2D.Double() which contains just one quadratic
* curve.
*
+ * @param image
+ * test image
+ * @return created path
+ */
+ public static Path2D createQuadraticPathDouble(TestImage image)
+ {
+ return createQuadraticPathDouble(image.getWidth(), image.getHeight());
+ }
+
+ /**
+ * Create new path using Path2D.Double() which contains just one quadratic
+ * curve.
+ *
* @param width
* canvas width
* @param height
@@ -621,6 +634,50 @@
}
/**
+ * Create simple new path using Path2D.Double() which contains just lines.
+ *
+ * @param image
+ * test image
+ * @return created path
+ */
+ public static Path2D createClosedPathDouble(TestImage image)
+ {
+ return createClosedPathFloat(image.getWidth(), image.getHeight());
+ }
+
+ /**
+ * Create simple new path using Path2D.Double() which contains just lines.
+ *
+ * @param width
+ * canvas width
+ * @param height
+ * canvas height
+ * @return created path
+ */
+ public static Path2D createClosedPathDouble(int width, int height)
+ {
+ Path2D path = new Path2D.Double();
+ // 1st vertex
+ int x1 = LINE_PATH_OFFSET;
+ int y1 = LINE_PATH_OFFSET;
+ // 2nd vertex
+ int x2 = width - LINE_PATH_OFFSET;
+ int y2 = y1;
+ // 3rd vertex
+ int x3 = x2;
+ int y3 = height - LINE_PATH_OFFSET;
+ // 4rd vertex
+ int x4 = x1;
+ int y4 = y3;
+ path.moveTo(x1, y1);
+ path.lineTo(x2, y2);
+ path.lineTo(x3, y3);
+ path.lineTo(x4, y4);
+ path.closePath();
+ return path;
+ }
+
+ /**
*
* @param image
* @return
@@ -814,6 +871,50 @@
return path;
}
+ /**
+ * Create new path using Path2D.Double() which contains just lines.
+ *
+ * @param image
+ * test image
+ * @return created path
+ */
+ public static Path2D createCrossedClosedPathDouble(TestImage image)
+ {
+ return createCrossedClosedPathDouble(image.getWidth(), image.getHeight());
+ }
+
+ /**
+ * Create new path using Path2D.Double() which contains just lines.
+ *
+ * @param width
+ * canvas width
+ * @param height
+ * canvas height
+ * @return created path
+ */
+ public static Path2D createCrossedClosedPathDouble(int width, int height)
+ {
+ Path2D path = new Path2D.Double();
+ // 1st vertex
+ int x1 = LINE_PATH_OFFSET;
+ int y1 = LINE_PATH_OFFSET;
+ // 2nd vertex
+ int x2 = width - LINE_PATH_OFFSET;
+ int y2 = height - LINE_PATH_OFFSET;
+ // 3rd vertex
+ int x3 = x2;
+ int y3 = y1;
+ // 4rd vertex
+ int x4 = x1;
+ int y4 = y2;
+ path.moveTo(x1, y1);
+ path.lineTo(x2, y2);
+ path.lineTo(x3, y3);
+ path.lineTo(x4, y4);
+ path.closePath();
+ return path;
+ }
+
public static Path2D createCrossedClosedPathContainingQuadraticSegmentFloat(TestImage image)
{
return createCrossedClosedPathContainingQuadraticSegmentFloat(image.getWidth(), image.getWidth());
@@ -833,10 +934,10 @@
int y3 = y1;
// 4rd vertex
int x4 = x1;
- int y4 = y2;
- path.moveTo(x1, y1);
- path.quadTo(x2, y2, x3, y3);
- path.lineTo(x4, y4);
+ int y4 = y2 - 100;
+ path.moveTo(x2, y1);
+ path.quadTo(x4, y2, x1, y3);
+ path.lineTo(x3, y4);
path.closePath();
return path;
}
@@ -860,10 +961,10 @@
int y3 = y1;
// 4rd vertex
int x4 = x1;
- int y4 = y2;
- path.moveTo(x1, y1);
- path.quadTo(x2, y2, x3, y3);
- path.lineTo(x4, y4);
+ int y4 = y2 - 100;
+ path.moveTo(x2, y1);
+ path.quadTo(x3, y2, x4, y3);
+ path.lineTo(x2, y4);
path.closePath();
return path;
}
@@ -875,7 +976,24 @@
public static Path2D createCrossedClosedPathContainingCubicSegmentFloat(int width, int height)
{
- return null;
+ Path2D path = new Path2D.Double();
+ // 1st vertex
+ int x1 = LINE_PATH_OFFSET;
+ int y1 = LINE_PATH_OFFSET;
+ // 2nd vertex
+ int x2 = width - LINE_PATH_OFFSET;
+ int y2 = height - LINE_PATH_OFFSET * 4;
+ // 3rd vertex
+ int x3 = x2;
+ int y3 = y1;
+ // 4rd vertex
+ int x4 = x1;
+ int y4 = y2;
+ path.moveTo(x1, y1);
+ path.curveTo(x2 + 100, y2, x4 - 100, y4, x3, y3);
+ path.lineTo((x1 + x2) / 2, y2 - 100);
+ path.closePath();
+ return path;
}
public static Path2D createCrossedClosedPathContainingCubicSegmentDouble(TestImage image)
More information about the distro-pkg-dev
mailing list