/hg/gfx-test: Helper methods added into CommonBitmapOperations.j...
ptisnovs at icedtea.classpath.org
ptisnovs at icedtea.classpath.org
Fri Jan 11 03:16:43 PST 2013
changeset bad6e5f050f5 in /hg/gfx-test
details: http://icedtea.classpath.org/hg/gfx-test?cmd=changeset;node=bad6e5f050f5
author: Pavel Tisnovsky <ptisnovs at redhat.com>
date: Fri Jan 11 12:19:51 2013 +0100
Helper methods added into CommonBitmapOperations.java.
diffstat:
ChangeLog | 5 +
src/org/gfxtest/framework/CommonBitmapOperations.java | 104 ++++++++++++++++++
2 files changed, 109 insertions(+), 0 deletions(-)
diffs (124 lines):
diff -r 96a64caaddec -r bad6e5f050f5 ChangeLog
--- a/ChangeLog Thu Jan 10 09:57:59 2013 +0100
+++ b/ChangeLog Fri Jan 11 12:19:51 2013 +0100
@@ -1,3 +1,8 @@
+2013-01-11 Pavel Tisnovsky <ptisnovs at redhat.com>
+
+ * src/org/gfxtest/framework/CommonBitmapOperations.java:
+ Helper methods added into CommonBitmapOperations.java.
+
2013-01-10 Pavel Tisnovsky <ptisnovs at redhat.com>
* src/org/gfxtest/framework/ImageFactory.java:
diff -r 96a64caaddec -r bad6e5f050f5 src/org/gfxtest/framework/CommonBitmapOperations.java
--- a/src/org/gfxtest/framework/CommonBitmapOperations.java Thu Jan 10 09:57:59 2013 +0100
+++ b/src/org/gfxtest/framework/CommonBitmapOperations.java Fri Jan 11 12:19:51 2013 +0100
@@ -1514,4 +1514,108 @@
return performBitBlt(bufferedImage, image, graphics2d, width, height) ? TestResult.PASSED : TestResult.FAILED;
}
+ /**
+ * Create new buffered image containing horizontal red 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 doBitBltTestWithHorizontalRedGradientImage(TestImage image, Graphics2D graphics2d, int imageType)
+ {
+ // create new buffered bitmap with given type
+ BufferedImage bufferedImage = ImageFactory.createHorizontalRedGradientImage(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 performBitBlt(bufferedImage, image, graphics2d) ? TestResult.PASSED : TestResult.FAILED;
+ }
+
+ /**
+ * Create new buffered image containing horizontal red 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 doBitBltTestWithHorizontalredGradientImage(TestImage image, Graphics2D graphics2d, int imageType,
+ int width, int height)
+ {
+ // create new buffered bitmap with given type
+ BufferedImage bufferedImage = ImageFactory.createHorizontalRedGradientImage(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 performBitBlt(bufferedImage, image, graphics2d, width, height) ? TestResult.PASSED : TestResult.FAILED;
+ }
+
+ /**
+ * Create new buffered image containing vertical red 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 doBitBltTestWithVerticalRedGradientImage(TestImage image, Graphics2D graphics2d, int imageType)
+ {
+ // create new buffered bitmap with given type
+ BufferedImage bufferedImage = ImageFactory.createVerticalRedGradientImage(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 performBitBlt(bufferedImage, image, graphics2d) ? TestResult.PASSED : TestResult.FAILED;
+ }
+
+ /**
+ * Create new buffered image containing vertical red 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 doBitBltTestWithVerticalRedGradientImage(TestImage image, Graphics2D graphics2d, int imageType,
+ int width, int height)
+ {
+ // create new buffered bitmap with given type
+ BufferedImage bufferedImage = ImageFactory.createVerticalRedGradientImage(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 performBitBlt(bufferedImage, image, graphics2d, width, height) ? TestResult.PASSED : TestResult.FAILED;
+ }
+
}
More information about the distro-pkg-dev
mailing list