/hg/gfx-test: Added new classes containing callback methods used...

ptisnovs at icedtea.classpath.org ptisnovs at icedtea.classpath.org
Mon Jul 30 03:08:14 PDT 2012


changeset df77617740d9 in /hg/gfx-test
details: http://icedtea.classpath.org/hg/gfx-test?cmd=changeset;node=df77617740d9
author: Pavel Tisnovsky <ptisnovs at redhat.com>
date: Mon Jul 30 12:10:45 2012 +0200

	Added new classes containing callback methods used during rendering
	cubic curves. Fixed typo in a test suite PrintTestPolylines, added
	new constant to a class PrintTest.


diffstat:

 ChangeLog                                               |  12 ++
 Makefile                                                |   2 +
 src/org/gfxtest/callbacks/CommonCurveDrawCallbacks.java |  94 +++++++++++++++++
 src/org/gfxtest/callbacks/CubicCurveDrawCallback.java   |  68 ++++++++++++
 src/org/gfxtest/framework/PrintTest.java                |   5 +
 src/org/gfxtest/testsuites/PrintTestPolylines.java      |   1 -
 6 files changed, 181 insertions(+), 1 deletions(-)

diffs (229 lines):

diff -r df7b0d1fc991 -r df77617740d9 ChangeLog
--- a/ChangeLog	Fri Jul 27 11:40:11 2012 +0200
+++ b/ChangeLog	Mon Jul 30 12:10:45 2012 +0200
@@ -1,3 +1,15 @@
+2012-07-30  Pavel Tisnovsky  <ptisnovs at redhat.com>
+
+	* src/org/gfxtest/callbacks/CommonCurveDrawCallbacks.java:
+	* src/org/gfxtest/callbacks/CubicCurveDrawCallback.java:
+	Added new classes containing callback methods used during rendering
+	cubic curves.
+	* src/org/gfxtest/framework/PrintTest.java:
+	New constant.
+	* src/org/gfxtest/testsuites/PrintTestPolylines.java:
+	Fixed typo.
+	* Makefile: Updated - added new classes to compile.
+
 2012-07-27  Pavel Tisnovsky  <ptisnovs at redhat.com>
 
 	* src/org/gfxtest/testsuites/PrintTestPolygons.java:
diff -r df7b0d1fc991 -r df77617740d9 Makefile
--- a/Makefile	Fri Jul 27 11:40:11 2012 +0200
+++ b/Makefile	Mon Jul 30 12:10:45 2012 +0200
@@ -97,8 +97,10 @@
 	$(CLASSES)/$(FRAMEWORK_DIR)/PostScriptToPngConverter.class \
 	$(CLASSES)/$(FRAMEWORK_DIR)/PrintJobWatcher.class \
 	$(CLASSES)/$(CALLBACKS_DIR)/CommonCircleDrawCallbacks.class \
+	$(CLASSES)/$(CALLBACKS_DIR)/CommonCurveDrawCallbacks.class \
 	$(CLASSES)/$(CALLBACKS_DIR)/CommonEllipseDrawCallbacks.class \
 	$(CLASSES)/$(CALLBACKS_DIR)/CommonLineDrawCallbacks.class \
+	$(CLASSES)/$(CALLBACKS_DIR)/CubicCurveDrawCallbacks.class \
 	$(CLASSES)/$(CALLBACKS_DIR)/HorizontalLineDrawCallbacks.class \
 	$(CLASSES)/$(CALLBACKS_DIR)/VerticalLineDrawCallbacks.class \
 	$(CLASSES)/$(CALLBACKS_DIR)/DiagonalLineDrawCallbacks.class \
diff -r df7b0d1fc991 -r df77617740d9 src/org/gfxtest/callbacks/CommonCurveDrawCallbacks.java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/org/gfxtest/callbacks/CommonCurveDrawCallbacks.java	Mon Jul 30 12:10:45 2012 +0200
@@ -0,0 +1,94 @@
+/*
+  Java gfx-test framework
+
+   Copyright (C) 2012  Red Hat
+
+This file is part of IcedTea.
+
+IcedTea is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+IcedTea is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with IcedTea; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version.
+*/
+
+package org.gfxtest.callbacks;
+
+
+
+import java.awt.Color;
+import java.awt.Graphics2D;
+
+
+
+import org.gfxtest.framework.TestImage;
+
+
+
+/**
+ * Class representing set of callback methods called for each rendered curve.
+ * 
+ * @author Pavel Tisnovsky
+ */
+public abstract class CommonCurveDrawCallbacks
+{
+    /**
+     * Image to which curve are to be drawn.
+     */
+    protected TestImage image;
+
+    /**
+     * Graphics canvas.
+     */
+    protected Graphics2D graphics;
+
+    /**
+     * Setup phase.
+     * 
+     * @param image
+     *            image to which curves are to be drawn
+     * @param graphics2d
+     *            graphics canvas
+     */
+    public void setup(TestImage image, Graphics2D graphics)
+    {
+        this.image = image;
+        this.graphics = graphics;
+        // set drawing color
+        graphics.setColor(Color.BLACK);
+    }
+
+    /**
+     * Cleanup phase.
+     */
+    public void cleanup()
+    {
+        return;
+    }
+}
diff -r df7b0d1fc991 -r df77617740d9 src/org/gfxtest/callbacks/CubicCurveDrawCallback.java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/org/gfxtest/callbacks/CubicCurveDrawCallback.java	Mon Jul 30 12:10:45 2012 +0200
@@ -0,0 +1,68 @@
+/*
+  Java gfx-test framework
+
+   Copyright (C) 2012  Red Hat
+
+This file is part of IcedTea.
+
+IcedTea is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+IcedTea is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with IcedTea; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version.
+ */
+
+package org.gfxtest.callbacks;
+
+
+
+/**
+ * Class representing set of callback methods called for each rendered
+ * cubic curve.
+ * 
+ * @author Pavel Tisnovsky
+ */
+public abstract class CubicCurveDrawCallback extends CommonCurveDrawCallbacks
+{
+    /**
+     * Called for each rendered cubic curve.
+     * 
+     * @param x1
+     *            the first point's x coordinate.
+     * @param y1
+     *            the first point's y coordinate.
+     * @param x2
+     *            the second point's x coordinate.
+     * @param y2
+     *            the second point's y coordinate.
+     * @param index
+     *            curve index
+     */
+    public abstract void iterationCallBack(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4, int index);
+}
diff -r df7b0d1fc991 -r df77617740d9 src/org/gfxtest/framework/PrintTest.java
--- a/src/org/gfxtest/framework/PrintTest.java	Fri Jul 27 11:40:11 2012 +0200
+++ b/src/org/gfxtest/framework/PrintTest.java	Mon Jul 30 12:10:45 2012 +0200
@@ -112,6 +112,11 @@
     protected static final int DIAGONAL_STEP = 16;
 
     /**
+     * Diagonal distance between cubic curves in each test iteration.
+     */
+    protected static final int CUBIC_CURVE_STEP= 16;
+
+    /**
      * Horizontal and also vertical distance between rectangles lines in each test iteration.
      */
     protected static final int RECTANGLE_STEP = 10;
diff -r df7b0d1fc991 -r df77617740d9 src/org/gfxtest/testsuites/PrintTestPolylines.java
--- a/src/org/gfxtest/testsuites/PrintTestPolylines.java	Fri Jul 27 11:40:11 2012 +0200
+++ b/src/org/gfxtest/testsuites/PrintTestPolylines.java	Mon Jul 30 12:10:45 2012 +0200
@@ -656,7 +656,6 @@
                 float gray = 1.0f - (y1 - BORDER) * 4.0f / this.image.getHeight();
                 // set polyline color
                 this.graphics.setColor(GrayscalePalette.createGrayscaleColor(gray));
-                // compute grayscale value
                 return;
             }
         });



More information about the distro-pkg-dev mailing list