/hg/gfx-test: Added several new ROPs to the test suite

ptisnovs at icedtea.classpath.org ptisnovs at icedtea.classpath.org
Tue Sep 24 01:17:35 PDT 2013


changeset dc0b34b65202 in /hg/gfx-test
details: http://icedtea.classpath.org/hg/gfx-test?cmd=changeset;node=dc0b34b65202
author: Pavel Tisnovsky <ptisnovs at redhat.com>
date: Tue Sep 24 10:21:23 2013 +0200

	Added several new ROPs to the test suite
	BitBltAffineScaleTransformOp.


diffstat:

 ChangeLog                                                    |   6 +
 src/org/gfxtest/testsuites/BitBltAffineScaleTransformOp.java |  49 ++++++++++++
 2 files changed, 55 insertions(+), 0 deletions(-)

diffs (79 lines):

diff -r ca8b78f61748 -r dc0b34b65202 ChangeLog
--- a/ChangeLog	Mon Sep 23 10:51:29 2013 +0200
+++ b/ChangeLog	Tue Sep 24 10:21:23 2013 +0200
@@ -1,3 +1,9 @@
+2013-09-24  Pavel Tisnovsky  <ptisnovs at redhat.com>
+
+	* src/org/gfxtest/testsuites/BitBltAffineScaleTransformOp.java:
+	Added several new ROPs to the test suite
+	BitBltAffineScaleTransformOp.
+
 2013-09-23  Pavel Tisnovsky  <ptisnovs at redhat.com>
 
 	* src/org/gfxtest/testsuites/BitBltAffineRotateTransformOp.java:
diff -r ca8b78f61748 -r dc0b34b65202 src/org/gfxtest/testsuites/BitBltAffineScaleTransformOp.java
--- a/src/org/gfxtest/testsuites/BitBltAffineScaleTransformOp.java	Mon Sep 23 10:51:29 2013 +0200
+++ b/src/org/gfxtest/testsuites/BitBltAffineScaleTransformOp.java	Tue Sep 24 10:21:23 2013 +0200
@@ -40,6 +40,15 @@
 
 package org.gfxtest.testsuites;
 
+import java.awt.Graphics2D;
+import java.awt.RenderingHints;
+import java.awt.geom.AffineTransform;
+import java.awt.image.AffineTransformOp;
+
+
+
+import org.gfxtest.framework.TestImage;
+import org.gfxtest.framework.TestResult;
 import org.gfxtest.framework.annotations.BitBltOperation;
 import org.gfxtest.framework.annotations.BitBltOperations;
 import org.gfxtest.framework.annotations.GraphicsPrimitive;
@@ -62,6 +71,46 @@
 @Zoom(1)
 public class BitBltAffineScaleTransformOp extends BitBltAffineTransformOp
 {
+    private static double SCALES[] = {.001, 0.01, 0.1, 1/3., 0.5, 2/3., 1.0, 2.0, 3.0, 4.0};
+    private static final int NUM_SCALES = SCALES.length * SCALES.length;
+
+    private static final AffineTransform ScaleTransformation[] = new AffineTransform[NUM_SCALES];
+
+    private static final RenderingHints RenderingHintsNearestNeighbor;
+    private static final RenderingHints RenderingHintsBilinear;
+    private static final RenderingHints RenderingHintsBicubic;
+
+    private static AffineTransformOp ScaleTransformationNearest1Op[] = new AffineTransformOp[NUM_SCALES];
+    private static AffineTransformOp ScaleTransformationBilinear1Op[] = new AffineTransformOp[NUM_SCALES];
+    private static AffineTransformOp ScaleTransformationBicubic1Op[] = new AffineTransformOp[NUM_SCALES];
+
+    private static AffineTransformOp ScaleTransformationNearest2Op[] = new AffineTransformOp[NUM_SCALES];
+    private static AffineTransformOp ScaleTransformationBilinear2Op[] = new AffineTransformOp[NUM_SCALES];
+    private static AffineTransformOp ScaleTransformationBicubic2Op[] = new AffineTransformOp[NUM_SCALES];
+
+    static
+    {
+        RenderingHintsNearestNeighbor = new RenderingHints(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR);
+        RenderingHintsBilinear = new RenderingHints(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
+        RenderingHintsBicubic = new RenderingHints(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BICUBIC);
+
+        int i = 0;
+        for (double verticalScale : SCALES) {
+            for (double horizontalScale : SCALES) {
+                ScaleTransformation[i] = AffineTransform.getScaleInstance(horizontalScale, verticalScale);
+
+                ScaleTransformationNearest1Op[i] = new AffineTransformOp(ScaleTransformation[i], AffineTransformOp.TYPE_NEAREST_NEIGHBOR);
+                ScaleTransformationBilinear1Op[i] = new AffineTransformOp(ScaleTransformation[i], AffineTransformOp.TYPE_BILINEAR);
+                ScaleTransformationBicubic1Op[i] = new AffineTransformOp(ScaleTransformation[i], AffineTransformOp.TYPE_BICUBIC);
+
+                ScaleTransformationNearest2Op[i] = new AffineTransformOp(ScaleTransformation[i], RenderingHintsNearestNeighbor);
+                ScaleTransformationBilinear2Op[i] = new AffineTransformOp(ScaleTransformation[i], RenderingHintsBilinear);
+                ScaleTransformationBicubic2Op[i] = new AffineTransformOp(ScaleTransformation[i], RenderingHintsBicubic);
+
+                i++;
+            }
+        }
+    }
     /**
      * Entry point to the test suite.
      *


More information about the distro-pkg-dev mailing list