/hg/gfx-test: 12 helper methods added into CommonBitmapOperation...
ptisnovs at icedtea.classpath.org
ptisnovs at icedtea.classpath.org
Tue Apr 16 00:53:06 PDT 2013
changeset a7ed7b19f6aa in /hg/gfx-test
details: http://icedtea.classpath.org/hg/gfx-test?cmd=changeset;node=a7ed7b19f6aa
author: Pavel Tisnovsky <ptisnovs at redhat.com>
date: Tue Apr 16 09:56:19 2013 +0200
12 helper methods added into CommonBitmapOperations class.
diffstat:
ChangeLog | 5 +
src/org/gfxtest/framework/CommonBitmapOperations.java | 312 ++++++++++++++++++
2 files changed, 317 insertions(+), 0 deletions(-)
diffs (332 lines):
diff -r 333cbb14438b -r a7ed7b19f6aa ChangeLog
--- a/ChangeLog Mon Apr 15 10:54:43 2013 +0200
+++ b/ChangeLog Tue Apr 16 09:56:19 2013 +0200
@@ -1,3 +1,8 @@
+2013-04-16 Pavel Tisnovsky <ptisnovs at redhat.com>
+
+ * src/org/gfxtest/framework/CommonBitmapOperations.java:
+ 12 helper methods added into CommonBitmapOperations class.
+
2013-04-15 Pavel Tisnovsky <ptisnovs at redhat.com>
* src/org/gfxtest/testsuites/BitBltConvolveOp.java:
diff -r 333cbb14438b -r a7ed7b19f6aa src/org/gfxtest/framework/CommonBitmapOperations.java
--- a/src/org/gfxtest/framework/CommonBitmapOperations.java Mon Apr 15 10:54:43 2013 +0200
+++ b/src/org/gfxtest/framework/CommonBitmapOperations.java Tue Apr 16 09:56:19 2013 +0200
@@ -1737,4 +1737,316 @@
return BitBltOperations.performBitBlt(bufferedImage, image, graphics2d, width, height) ? TestResult.PASSED : TestResult.FAILED;
}
+ /**
+ * Create new buffered image containing horizontal yellow gradient and then perform basic BitBlt test.
+ *
+ * @param image
+ * image to which another image is to be drawn
+ * @param graphics2d
+ * graphics canvas
+ * @param imageType
+ * type of the created image
+ */
+ public static TestResult doBitBltTestWithHorizontalYellowGradientImage(TestImage image, Graphics2D graphics2d, int imageType)
+ {
+ // create new buffered bitmap with given type
+ BufferedImage bufferedImage = ImageFactory.createHorizontalYellowGradientImage(DEFAULT_TEST_IMAGE_WIDTH, DEFAULT_TEST_IMAGE_HEIGHT, imageType);
+ // basic check if buffered image was created
+ if (bufferedImage == null)
+ {
+ return TestResult.FAILED;
+ }
+ // BitBlt with 1:1 scaling
+ return BitBltOperations.performBitBlt(bufferedImage, image, graphics2d) ? TestResult.PASSED : TestResult.FAILED;
+ }
+
+ /**
+ * Create new buffered image containing horizontal yellow gradient and then perform
+ * basic BitBlt test.
+ *
+ * @param image
+ * image to which another image is to be drawn
+ * @param graphics2d
+ * graphics canvas
+ * @param imageType
+ * type of the created image
+ * @param width
+ * width of a image after BitBlt operation is performed
+ * @param height
+ * height of a image after BitBlt operation is performed
+ */
+ public static TestResult doBitBltTestWithHorizontalYellowGradientImage(TestImage image, Graphics2D graphics2d, int imageType,
+ int width, int height)
+ {
+ // create new buffered bitmap with given type
+ BufferedImage bufferedImage = ImageFactory.createHorizontalYellowGradientImage(DEFAULT_TEST_IMAGE_WIDTH, DEFAULT_TEST_IMAGE_HEIGHT, imageType);
+ // basic check if buffered image was created
+ if (bufferedImage == null)
+ {
+ return TestResult.FAILED;
+ }
+ // BitBlt with custom scaling
+ return BitBltOperations.performBitBlt(bufferedImage, image, graphics2d, width, height) ? TestResult.PASSED : TestResult.FAILED;
+ }
+
+ /**
+ * Create new buffered image containing vertical yellow gradient and then perform basic BitBlt test.
+ *
+ * @param image
+ * image to which another image is to be drawn
+ * @param graphics2d
+ * graphics canvas
+ * @param imageType
+ * type of the created image
+ */
+ public static TestResult doBitBltTestWithVerticalYellowGradientImage(TestImage image, Graphics2D graphics2d, int imageType)
+ {
+ // create new buffered bitmap with given type
+ BufferedImage bufferedImage = ImageFactory.createVerticalYellowGradientImage(DEFAULT_TEST_IMAGE_WIDTH, DEFAULT_TEST_IMAGE_HEIGHT, imageType);
+ // basic check if buffered image was created
+ if (bufferedImage == null)
+ {
+ return TestResult.FAILED;
+ }
+ // BitBlt with 1:1 scaling
+ return BitBltOperations.performBitBlt(bufferedImage, image, graphics2d) ? TestResult.PASSED : TestResult.FAILED;
+ }
+
+ /**
+ * Create new buffered image containing vertical yellow gradient and then perform
+ * basic BitBlt test.
+ *
+ * @param image
+ * image to which another image is to be drawn
+ * @param graphics2d
+ * graphics canvas
+ * @param imageType
+ * type of the created image
+ * @param width
+ * width of a image after BitBlt operation is performed
+ * @param height
+ * height of a image after BitBlt operation is performed
+ */
+ public static TestResult doBitBltTestWithVerticalYellowGradientImage(TestImage image, Graphics2D graphics2d, int imageType,
+ int width, int height)
+ {
+ // create new buffered bitmap with given type
+ BufferedImage bufferedImage = ImageFactory.createVerticalYellowGradientImage(DEFAULT_TEST_IMAGE_WIDTH, DEFAULT_TEST_IMAGE_HEIGHT, imageType);
+ // basic check if buffered image was created
+ if (bufferedImage == null)
+ {
+ return TestResult.FAILED;
+ }
+ // BitBlt with custom scaling
+ return BitBltOperations.performBitBlt(bufferedImage, image, graphics2d, width, height) ? TestResult.PASSED : TestResult.FAILED;
+ }
+
+ /**
+ * Create new buffered image containing horizontal magenta gradient and then perform basic BitBlt test.
+ *
+ * @param image
+ * image to which another image is to be drawn
+ * @param graphics2d
+ * graphics canvas
+ * @param imageType
+ * type of the created image
+ */
+ public static TestResult doBitBltTestWithHorizontalMagentaGradientImage(TestImage image, Graphics2D graphics2d, int imageType)
+ {
+ // create new buffered bitmap with given type
+ BufferedImage bufferedImage = ImageFactory.createHorizontalMagentaGradientImage(DEFAULT_TEST_IMAGE_WIDTH, DEFAULT_TEST_IMAGE_HEIGHT, imageType);
+ // basic check if buffered image was created
+ if (bufferedImage == null)
+ {
+ return TestResult.FAILED;
+ }
+ // BitBlt with 1:1 scaling
+ return BitBltOperations.performBitBlt(bufferedImage, image, graphics2d) ? TestResult.PASSED : TestResult.FAILED;
+ }
+
+ /**
+ * Create new buffered image containing horizontal magenta gradient and then perform
+ * basic BitBlt test.
+ *
+ * @param image
+ * image to which another image is to be drawn
+ * @param graphics2d
+ * graphics canvas
+ * @param imageType
+ * type of the created image
+ * @param width
+ * width of a image after BitBlt operation is performed
+ * @param height
+ * height of a image after BitBlt operation is performed
+ */
+ public static TestResult doBitBltTestWithHorizontalMagentaGradientImage(TestImage image, Graphics2D graphics2d, int imageType,
+ int width, int height)
+ {
+ // create new buffered bitmap with given type
+ BufferedImage bufferedImage = ImageFactory.createHorizontalMagentaGradientImage(DEFAULT_TEST_IMAGE_WIDTH, DEFAULT_TEST_IMAGE_HEIGHT, imageType);
+ // basic check if buffered image was created
+ if (bufferedImage == null)
+ {
+ return TestResult.FAILED;
+ }
+ // BitBlt with custom scaling
+ return BitBltOperations.performBitBlt(bufferedImage, image, graphics2d, width, height) ? TestResult.PASSED : TestResult.FAILED;
+ }
+
+ /**
+ * Create new buffered image containing vertical magenta gradient and then perform basic BitBlt test.
+ *
+ * @param image
+ * image to which another image is to be drawn
+ * @param graphics2d
+ * graphics canvas
+ * @param imageType
+ * type of the created image
+ */
+ public static TestResult doBitBltTestWithVerticalMagentaGradientImage(TestImage image, Graphics2D graphics2d, int imageType)
+ {
+ // create new buffered bitmap with given type
+ BufferedImage bufferedImage = ImageFactory.createVerticalMagentaGradientImage(DEFAULT_TEST_IMAGE_WIDTH, DEFAULT_TEST_IMAGE_HEIGHT, imageType);
+ // basic check if buffered image was created
+ if (bufferedImage == null)
+ {
+ return TestResult.FAILED;
+ }
+ // BitBlt with 1:1 scaling
+ return BitBltOperations.performBitBlt(bufferedImage, image, graphics2d) ? TestResult.PASSED : TestResult.FAILED;
+ }
+
+ /**
+ * Create new buffered image containing vertical magenta gradient and then perform
+ * basic BitBlt test.
+ *
+ * @param image
+ * image to which another image is to be drawn
+ * @param graphics2d
+ * graphics canvas
+ * @param imageType
+ * type of the created image
+ * @param width
+ * width of a image after BitBlt operation is performed
+ * @param height
+ * height of a image after BitBlt operation is performed
+ */
+ public static TestResult doBitBltTestWithVerticalMagentaGradientImage(TestImage image, Graphics2D graphics2d, int imageType,
+ int width, int height)
+ {
+ // create new buffered bitmap with given type
+ BufferedImage bufferedImage = ImageFactory.createVerticalMagentaGradientImage(DEFAULT_TEST_IMAGE_WIDTH, DEFAULT_TEST_IMAGE_HEIGHT, imageType);
+ // basic check if buffered image was created
+ if (bufferedImage == null)
+ {
+ return TestResult.FAILED;
+ }
+ // BitBlt with custom scaling
+ return BitBltOperations.performBitBlt(bufferedImage, image, graphics2d, width, height) ? TestResult.PASSED : TestResult.FAILED;
+ }
+
+ /**
+ * Create new buffered image containing horizontal cyan gradient and then perform basic BitBlt test.
+ *
+ * @param image
+ * image to which another image is to be drawn
+ * @param graphics2d
+ * graphics canvas
+ * @param imageType
+ * type of the created image
+ */
+ public static TestResult doBitBltTestWithHorizontalCyanGradientImage(TestImage image, Graphics2D graphics2d, int imageType)
+ {
+ // create new buffered bitmap with given type
+ BufferedImage bufferedImage = ImageFactory.createHorizontalCyanGradientImage(DEFAULT_TEST_IMAGE_WIDTH, DEFAULT_TEST_IMAGE_HEIGHT, imageType);
+ // basic check if buffered image was created
+ if (bufferedImage == null)
+ {
+ return TestResult.FAILED;
+ }
+ // BitBlt with 1:1 scaling
+ return BitBltOperations.performBitBlt(bufferedImage, image, graphics2d) ? TestResult.PASSED : TestResult.FAILED;
+ }
+
+ /**
+ * Create new buffered image containing horizontal cyan gradient and then perform
+ * basic BitBlt test.
+ *
+ * @param image
+ * image to which another image is to be drawn
+ * @param graphics2d
+ * graphics canvas
+ * @param imageType
+ * type of the created image
+ * @param width
+ * width of a image after BitBlt operation is performed
+ * @param height
+ * height of a image after BitBlt operation is performed
+ */
+ public static TestResult doBitBltTestWithHorizontalCyanGradientImage(TestImage image, Graphics2D graphics2d, int imageType,
+ int width, int height)
+ {
+ // create new buffered bitmap with given type
+ BufferedImage bufferedImage = ImageFactory.createHorizontalCyanGradientImage(DEFAULT_TEST_IMAGE_WIDTH, DEFAULT_TEST_IMAGE_HEIGHT, imageType);
+ // basic check if buffered image was created
+ if (bufferedImage == null)
+ {
+ return TestResult.FAILED;
+ }
+ // BitBlt with custom scaling
+ return BitBltOperations.performBitBlt(bufferedImage, image, graphics2d, width, height) ? TestResult.PASSED : TestResult.FAILED;
+ }
+
+ /**
+ * Create new buffered image containing vertical cyan gradient and then perform basic BitBlt test.
+ *
+ * @param image
+ * image to which another image is to be drawn
+ * @param graphics2d
+ * graphics canvas
+ * @param imageType
+ * type of the created image
+ */
+ public static TestResult doBitBltTestWithVerticalCyanGradientImage(TestImage image, Graphics2D graphics2d, int imageType)
+ {
+ // create new buffered bitmap with given type
+ BufferedImage bufferedImage = ImageFactory.createVerticalCyanGradientImage(DEFAULT_TEST_IMAGE_WIDTH, DEFAULT_TEST_IMAGE_HEIGHT, imageType);
+ // basic check if buffered image was created
+ if (bufferedImage == null)
+ {
+ return TestResult.FAILED;
+ }
+ // BitBlt with 1:1 scaling
+ return BitBltOperations.performBitBlt(bufferedImage, image, graphics2d) ? TestResult.PASSED : TestResult.FAILED;
+ }
+
+ /**
+ * Create new buffered image containing vertical cyan gradient and then perform
+ * basic BitBlt test.
+ *
+ * @param image
+ * image to which another image is to be drawn
+ * @param graphics2d
+ * graphics canvas
+ * @param imageType
+ * type of the created image
+ * @param width
+ * width of a image after BitBlt operation is performed
+ * @param height
+ * height of a image after BitBlt operation is performed
+ */
+ public static TestResult doBitBltTestWithVerticalCyanGradientImage(TestImage image, Graphics2D graphics2d, int imageType,
+ int width, int height)
+ {
+ // create new buffered bitmap with given type
+ BufferedImage bufferedImage = ImageFactory.createVerticalCyanGradientImage(DEFAULT_TEST_IMAGE_WIDTH, DEFAULT_TEST_IMAGE_HEIGHT, imageType);
+ // basic check if buffered image was created
+ if (bufferedImage == null)
+ {
+ return TestResult.FAILED;
+ }
+ // BitBlt with custom scaling
+ return BitBltOperations.performBitBlt(bufferedImage, image, graphics2d, width, height) ? TestResult.PASSED : TestResult.FAILED;
+ }
+
}
More information about the distro-pkg-dev
mailing list