--- old/src/demo/share/java2d/J2DBench/options/default.opt 2014-11-05 21:45:49.000000000 +0300 +++ new/src/demo/share/java2d/J2DBench/options/default.opt 2014-11-05 21:45:48.000000000 +0300 @@ -5,33 +5,53 @@ global.env.runcount=5 global.env.repcount=0 global.env.testtime=2500 +global.results.workunits=units +global.results.timeunits=sec +global.results.ratio=unitspersec global.dest.screen=disabled global.dest.offscreen=disabled global.dest.compatimg.compatimg=disabled global.dest.compatimg.opqcompatimg=disabled global.dest.compatimg.bmcompatimg=disabled global.dest.compatimg.transcompatimg=disabled -global.dest.volimg=enabled +global.dest.volimg.volimg=enabled +global.dest.volimg.opqvolimg=disabled +global.dest.volimg.bmvolimg=disabled +global.dest.volimg.transvolimg=disabled global.dest.bufimg.IntXrgb=disabled global.dest.bufimg.IntArgb=disabled +global.dest.bufimg.IntArgbPre=disabled +global.dest.bufimg.3ByteBgr=disabled global.dest.bufimg.ByteIndexed=disabled global.dest.bufimg.ByteGray=disabled +global.dest.bufimg.4ByteAbgr=disabled +global.dest.bufimg.4ByteAbgrPre=disabled +global.dest.bufimg.custom=disabled graphics.opts.anim=2 graphics.opts.sizes=20,250 graphics.opts.alpharule=SrcOver +graphics.opts.transform=ident graphics.opts.extraalpha=Both graphics.opts.xormode=Off graphics.opts.clip=Both graphics.opts.renderhint=Default -graphics.render.opts.randomcolor=Both +graphics.render.opts.paint=single,random graphics.render.opts.alphacolor=Off graphics.render.opts.antialias=Both +graphics.render.opts.stroke=width1 graphics.render.tests.drawLine=enabled +graphics.render.tests.drawLineHoriz=disabled +graphics.render.tests.drawLineVert=disabled graphics.render.tests.fillRect=enabled +graphics.render.tests.drawRect=disabled graphics.render.tests.fillOval=enabled +graphics.render.tests.drawOval=disabled graphics.render.tests.fillPoly=disabled graphics.render.tests.drawPoly=disabled graphics.render.tests.shape.fillCubic=enabled +graphics.render.tests.shape.drawCubic=disabled +graphics.render.tests.shape.fillEllipse2D=disabled +graphics.render.tests.shape.drawEllipse2D=disabled graphics.imaging.src.offscr.opaque=disabled graphics.imaging.src.offscr.bitmask=disabled graphics.imaging.src.offscr.translucent=disabled @@ -44,33 +64,98 @@ graphics.imaging.src.transcompatimg.opaque=disabled graphics.imaging.src.transcompatimg.bitmask=disabled graphics.imaging.src.transcompatimg.translucent=enabled -graphics.imaging.src.volimg.opaque=disabled -graphics.imaging.src.volimg.bitmask=disabled -graphics.imaging.src.volimg.translucent=disabled +graphics.imaging.src.opqvolimg.opaque=disabled +graphics.imaging.src.opqvolimg.bitmask=disabled +graphics.imaging.src.opqvolimg.translucent=disabled +graphics.imaging.src.bmvolimg.opaque=disabled +graphics.imaging.src.bmvolimg.bitmask=disabled +graphics.imaging.src.bmvolimg.translucent=disabled +graphics.imaging.src.transvolimg.opaque=disabled +graphics.imaging.src.transvolimg.bitmask=disabled +graphics.imaging.src.transvolimg.translucent=disabled graphics.imaging.src.bufimg.IntXrgb.opaque=enabled graphics.imaging.src.bufimg.IntXrgb.bitmask=disabled graphics.imaging.src.bufimg.IntXrgb.translucent=disabled graphics.imaging.src.bufimg.IntArgb.opaque=disabled graphics.imaging.src.bufimg.IntArgb.bitmask=disabled graphics.imaging.src.bufimg.IntArgb.translucent=enabled +graphics.imaging.src.bufimg.IntArgbPre.opaque=disabled +graphics.imaging.src.bufimg.IntArgbPre.bitmask=disabled +graphics.imaging.src.bufimg.IntArgbPre.translucent=disabled graphics.imaging.src.bufimg.ByteGray.opaque=disabled graphics.imaging.src.bufimg.ByteGray.bitmask=disabled graphics.imaging.src.bufimg.ByteGray.translucent=disabled +graphics.imaging.src.bufimg.3ByteBgr.opaque=disabled +graphics.imaging.src.bufimg.3ByteBgr.bitmask=disabled +graphics.imaging.src.bufimg.3ByteBgr.translucent=disabled +graphics.imaging.src.bufimg.4ByteAbgr.opaque=disabled +graphics.imaging.src.bufimg.4ByteAbgr.bitmask=disabled +graphics.imaging.src.bufimg.4ByteAbgr.translucent=disabled +graphics.imaging.src.bufimg.4ByteAbgrPre.opaque=disabled +graphics.imaging.src.bufimg.4ByteAbgrPre.bitmask=disabled +graphics.imaging.src.bufimg.4ByteAbgrPre.translucent=disabled graphics.imaging.src.bufimg.ByteIndexedBm.opaque=disabled graphics.imaging.src.bufimg.ByteIndexedBm.bitmask=disabled graphics.imaging.src.bufimg.ByteIndexedBm.translucent=disabled -graphics.imaging.tests.drawimage=enabled -graphics.imaging.tests.drawimagebg=disabled -graphics.imaging.tests.drawimagescaleup=enabled -graphics.imaging.tests.drawimagescaledown=disabled -graphics.imaging.tests.drawimagetxform=enabled +graphics.imaging.src.bufimg.unmanagedIntXrgb.opaque=disabled +graphics.imaging.src.bufimg.unmanagedIntXrgb.bitmask=disabled +graphics.imaging.src.bufimg.unmanagedIntXrgb.translucent=disabled +graphics.imaging.src.bufimg.unmanagedIntArgb.opaque=disabled +graphics.imaging.src.bufimg.unmanagedIntArgb.bitmask=disabled +graphics.imaging.src.bufimg.unmanagedIntArgb.translucent=disabled +graphics.imaging.src.bufimg.unmanagedIntArgbPre.opaque=disabled +graphics.imaging.src.bufimg.unmanagedIntArgbPre.bitmask=disabled +graphics.imaging.src.bufimg.unmanagedIntArgbPre.translucent=disabled +graphics.imaging.src.bufimg.unmanaged3ByteBgr.opaque=disabled +graphics.imaging.src.bufimg.unmanaged3ByteBgr.bitmask=disabled +graphics.imaging.src.bufimg.unmanaged3ByteBgr.translucent=disabled +graphics.imaging.benchmarks.opts.interpolation=Nearest neighbor +graphics.imaging.benchmarks.opts.touchsrc=Off +graphics.imaging.benchmarks.tests.drawimage=enabled +graphics.imaging.benchmarks.tests.drawimagebg=disabled +graphics.imaging.benchmarks.tests.drawimagescaleup=enabled +graphics.imaging.benchmarks.tests.drawimagescaledown=disabled +graphics.imaging.benchmarks.tests.drawimagescalesplit=disabled +graphics.imaging.benchmarks.tests.drawimagetxform=enabled +graphics.imaging.imageops.opts.op=convolve3x3zero +graphics.imaging.imageops.tests.graphics2d.drawimageop=disabled +graphics.imaging.imageops.tests.bufimgop.filternull=disabled +graphics.imaging.imageops.tests.bufimgop.filtercached=disabled +graphics.imaging.imageops.tests.rasterop.filternull=disabled +graphics.imaging.imageops.tests.rasterop.filtercached=disabled +graphics.misc.copytests.copyAreaVert=disabled +graphics.misc.copytests.copyAreaHoriz=disabled +graphics.misc.copytests.copyAreaDiag=disabled +pixel.opts.renderto=Off +pixel.opts.renderfrom=Off +pixel.src.1BitBinary=disabled +pixel.src.2BitBinary=disabled +pixel.src.4BitBinary=disabled +pixel.src.ByteIndexed=disabled +pixel.src.ByteGray=disabled +pixel.src.Short555=disabled +pixel.src.Short565=disabled +pixel.src.ShortGray=disabled +pixel.src.3ByteBgr=disabled +pixel.src.4ByteAbgr=disabled +pixel.src.IntXrgb=disabled +pixel.src.IntXbgr=disabled +pixel.src.IntArgb=disabled +pixel.bimgtests.getrgb=disabled +pixel.bimgtests.setrgb=disabled +pixel.rastests.getdataelem=disabled +pixel.rastests.setdataelem=disabled +pixel.rastests.getpixel=disabled +pixel.rastests.setpixel=disabled +pixel.dbtests.getelem=disabled +pixel.dbtests.setelem=disabled text.opts.data.tlength=32 text.opts.data.tscript=english text.opts.font.fname=lucida text.opts.font.fstyle=0 text.opts.font.fsize=13.0 text.opts.font.ftx=Identity -text.opts.graphics.taa=Both +text.opts.graphics.textaa=Off,On text.opts.graphics.tfm=Off text.opts.graphics.gaa=Off text.opts.graphics.gtx=Identity @@ -114,3 +199,66 @@ text.construction.tests.gvfromfontlayout=disabled text.construction.tests.tlfromfont=disabled text.construction.tests.tlfrommap=disabled +imageio.opts.size=250 +imageio.opts.content=photo +imageio.input.opts.general.source.file=disabled +imageio.input.opts.general.source.url=disabled +imageio.input.opts.general.source.byteArray=disabled +imageio.input.opts.imageio.useCache=Off +imageio.input.image.toolkit.opts.format= +imageio.input.image.toolkit.tests.createImage=disabled +imageio.input.image.imageio.opts.format= +imageio.input.image.imageio.tests.imageioRead=disabled +imageio.input.image.imageio.reader.opts.seekForwardOnly=On +imageio.input.image.imageio.reader.opts.ignoreMetadata=On +imageio.input.image.imageio.reader.opts.installListener=Off +imageio.input.image.imageio.reader.tests.read=disabled +imageio.input.image.imageio.reader.tests.getImageMetadata=disabled +imageio.input.stream.tests.construct=disabled +imageio.input.stream.tests.read=disabled +imageio.input.stream.tests.readByteArray=disabled +imageio.input.stream.tests.readFullyByteArray=disabled +imageio.input.stream.tests.readBit=disabled +imageio.input.stream.tests.readByte=disabled +imageio.input.stream.tests.readUnsignedByte=disabled +imageio.input.stream.tests.readShort=disabled +imageio.input.stream.tests.readUnsignedShort=disabled +imageio.input.stream.tests.readInt=disabled +imageio.input.stream.tests.readUnsignedInt=disabled +imageio.input.stream.tests.readFloat=disabled +imageio.input.stream.tests.readLong=disabled +imageio.input.stream.tests.readDouble=disabled +imageio.input.stream.tests.skipBytes=disabled +imageio.output.opts.general.dest.file=disabled +imageio.output.opts.general.dest.byteArray=disabled +imageio.output.opts.imageio.useCache=Off +imageio.output.image.imageio.opts.format= +imageio.output.image.imageio.tests.imageioWrite=disabled +imageio.output.image.imageio.writer.opts.installListener=Off +imageio.output.image.imageio.writer.tests.write=disabled +imageio.output.stream.tests.construct=disabled +imageio.output.stream.tests.write=disabled +imageio.output.stream.tests.writeByteArray=disabled +imageio.output.stream.tests.writeBit=disabled +imageio.output.stream.tests.writeByte=disabled +imageio.output.stream.tests.writeShort=disabled +imageio.output.stream.tests.writeInt=disabled +imageio.output.stream.tests.writeFloat=disabled +imageio.output.stream.tests.writeLong=disabled +imageio.output.stream.tests.writeDouble=disabled +cmm.opts.profiles=1001 +cmm.colorconv.data.fromRGB=disabled +cmm.colorconv.data.toRGB=disabled +cmm.colorconv.data.fromCIEXYZ=disabled +cmm.colorconv.data.toCIEXYZ=disabled +cmm.colorconv.ccop.ccopOptions.size=250 +cmm.colorconv.ccop.ccopOptions.content=photo +cmm.colorconv.ccop.ccopOptions.srcType=INT_ARGB +cmm.colorconv.ccop.ccopOptions.dstType=INT_ARGB +cmm.colorconv.ccop.op_img=disabled +cmm.colorconv.ccop.op_rst=disabled +cmm.colorconv.ccop.op_draw=disabled +cmm.colorconv.embed.embedOptions.Images=512x512 +cmm.colorconv.embed.embd_img_read=disabled +cmm.profiles.getHeader=disabled +cmm.profiles.getNumComponents=disabled --- old/src/demo/share/java2d/J2DBench/src/j2dbench/Destinations.java 2014-11-05 21:45:49.000000000 +0300 +++ new/src/demo/share/java2d/J2DBench/src/j2dbench/Destinations.java 2014-11-05 21:45:49.000000000 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -57,6 +57,7 @@ public static Group.EnableSet destroot; public static Group bufimgdestroot; public static Group compatimgdestroot; + public static Group volimgdestroot; public static void init() { destroot = new Group.EnableSet(TestEnvironment.globaloptroot, @@ -79,7 +80,22 @@ } if (ImageTests.hasVolatileImage) { - new VolatileImg(); + if(ImageTests.hasTransparentVolatileImage) { + volimgdestroot = new Group.EnableSet(destroot, "volimg", + "Output to Volatile Image"); + + volimgdestroot.setHorizontal(); + new VolatileImg(); + new VolatileImg(Transparency.OPAQUE); + new VolatileImg(Transparency.BITMASK); + new VolatileImg(Transparency.TRANSLUCENT); + } else if (ImageTests.hasVolatileImage){ + volimgdestroot = new Group.EnableSet(destroot, "volimg", + "Output to Volatile Image"); + + volimgdestroot.setHorizontal(); + new VolatileImg(); + } } bufimgdestroot = new Group.EnableSet(destroot, "bufimg", @@ -91,6 +107,8 @@ new BufImg(BufferedImage.TYPE_3BYTE_BGR); new BufImg(BufferedImage.TYPE_BYTE_INDEXED); new BufImg(BufferedImage.TYPE_BYTE_GRAY); + new BufImg(BufferedImage.TYPE_4BYTE_ABGR); + new BufImg(BufferedImage.TYPE_4BYTE_ABGR_PRE); new CustomImg(); } } @@ -206,18 +224,62 @@ } public static class VolatileImg extends Destinations { + private final int transparency; + + public static final String[] ShortNames = { + "volimg", + "opqvolimg", + "bmvolimg", + "transvolimg", + }; + + public static final String[] ShortDescriptions = { + "Default", + "Opaque", + "Bitmask", + "Translucent", + }; + + public static final String[] LongDescriptions = { + "Default VolatileImg Image", + "Opaque VolatileImg Image", + "Bitmask VolatileImg Image", + "Translucent VolatileImg Image", + }; + + public static final String[] ModifierNames = { + "VolatileImg()", + "VolatileImg(Opaque)", + "VolatileImg(Bitmask)", + "VolatileImg(Translucent)", + }; + public VolatileImg() { - super(destroot, "volimg", "Output to Volatile Image", false); + this(0); } - public String getModifierValueName(Object val) { - return "VolatileImg"; + public VolatileImg(final int transparency) { + super(volimgdestroot, + ShortNames[transparency], + ShortDescriptions[transparency], + false); + this.transparency = transparency; } - public void setDestination(TestEnvironment env) { + public String getModifierValueName(final Object val) { + return ModifierNames[transparency]; + } + + public void setDestination(final TestEnvironment env) { Component c = env.getCanvas(); - env.setTestImage(c.createVolatileImage(env.getWidth(), - env.getHeight())); + GraphicsConfiguration gc = c.getGraphicsConfiguration(); + int w = env.getWidth(); + int h = env.getHeight(); + if (transparency == 0) { + env.setTestImage(gc.createCompatibleVolatileImage(w, h)); + } else { + env.setTestImage(gc.createCompatibleVolatileImage(w, h, transparency)); + } } } --- old/src/demo/share/java2d/J2DBench/src/j2dbench/Group.java 2014-11-05 21:45:50.000000000 +0300 +++ new/src/demo/share/java2d/J2DBench/src/j2dbench/Group.java 2014-11-05 21:45:50.000000000 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -44,6 +44,7 @@ import javax.swing.BoxLayout; import javax.swing.JComponent; import javax.swing.JPanel; +import javax.swing.JScrollPane; import javax.swing.JTabbedPane; import javax.swing.border.TitledBorder; import java.util.NoSuchElementException; @@ -199,7 +200,7 @@ p.add(comp); } } - return p; + return new JScrollPane(p); } } --- old/src/demo/share/java2d/J2DBench/src/j2dbench/J2DBench.java 2014-11-05 21:45:51.000000000 +0300 +++ new/src/demo/share/java2d/J2DBench/src/j2dbench/J2DBench.java 2014-11-05 21:45:51.000000000 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -60,6 +60,8 @@ import javax.swing.BoxLayout; import javax.swing.JFileChooser; import javax.swing.JOptionPane; +import javax.swing.SwingUtilities; + import java.text.SimpleDateFormat; import java.util.Date; @@ -376,7 +378,11 @@ } if (gui) { - startGUI(); + SwingUtilities.invokeLater(new Runnable() { + public void run() { + startGUI(); + } + }); } else { long start = System.currentTimeMillis(); @@ -772,6 +778,7 @@ f.getContentPane().add(p, BorderLayout.SOUTH); f.pack(); + f.setLocationRelativeTo(null); f.show(); } --- old/src/demo/share/java2d/J2DBench/src/j2dbench/tests/GraphicsTests.java 2014-11-05 21:45:52.000000000 +0300 +++ new/src/demo/share/java2d/J2DBench/src/j2dbench/tests/GraphicsTests.java 2014-11-05 21:45:52.000000000 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -112,10 +112,10 @@ sizeList = new Option.IntList(groptroot, "sizes", "Size of Operations to perform", - new int[] {1, 20, 100, 250, 1000}, + new int[] {1, 20, 100, 250, 1000, 4000}, new String[] { "1x1", "20x20", "100x100", "250x250", - "1000x1000", + "1000x1000", "4000x4000", }, new String[] { "Tiny Shapes (1x1)", @@ -123,6 +123,7 @@ "Medium Shapes (100x100)", "Large Shapes (250x250)", "X-Large Shapes (1000x1000)", + "Huge Shapes (4000x4000)", }, 0xa); if (hasGraphics2D) { String rulenames[] = { --- old/src/demo/share/java2d/J2DBench/src/j2dbench/tests/ImageTests.java 2014-11-05 21:45:52.000000000 +0300 +++ new/src/demo/share/java2d/J2DBench/src/j2dbench/tests/ImageTests.java 2014-11-05 21:45:52.000000000 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -53,6 +53,7 @@ import java.awt.AlphaComposite; import java.awt.Dimension; import java.awt.GraphicsConfiguration; +import java.awt.RenderingHints; import java.awt.image.BufferedImage; import java.awt.image.BufferedImageOp; import java.awt.image.ByteLookupTable; @@ -77,6 +78,7 @@ public abstract class ImageTests extends GraphicsTests { public static boolean hasVolatileImage; + public static boolean hasTransparentVolatileImage; public static boolean hasCompatImage; static { @@ -89,14 +91,20 @@ hasCompatImage = true; } catch (NoSuchMethodError e) { } + try { + new Canvas().getMousePosition(); + hasTransparentVolatileImage = true; + } catch (NoSuchMethodError e) { + } } static Group imageroot; static Group.EnableSet imgsrcroot; static Group.EnableSet bufimgsrcroot; + static Group imgbenchroot; static Group imgtestroot; - static Group imgoptionsroot; + static Group imgtestOptRoot; static Group imageOpRoot; static Group imageOpOptRoot; @@ -106,6 +114,7 @@ static Group rasterOpTestRoot; static Option opList; static Option doTouchSrc; + static Option interpolation; static String transNodeNames[] = { null, "opaque", "bitmask", "translucent", @@ -122,19 +131,9 @@ imgsrcroot = new Group.EnableSet(imageroot, "src", "Image Rendering Sources"); - imgsrcroot.setBordered(true); - - imgoptionsroot = new Group(imgsrcroot, "options", - "Image Source Options"); - imgoptionsroot.setBordered(true); - doTouchSrc = - new Option.Toggle(imgoptionsroot, "touchsrc", - "Touch src image before every operation", - Option.Toggle.Off); - - imgtestroot = new Group(imageroot, "tests", - "Image Rendering Tests"); - imgtestroot.setBordered(true); + imgbenchroot = new Group(imageroot, "benchmarks", + "Image Rendering Benchmarks"); + imgtestOptRoot = new Group(imgbenchroot, "opts", "Options"); new OffScreen(); @@ -144,9 +143,14 @@ new CompatImg(Transparency.BITMASK); new CompatImg(Transparency.TRANSLUCENT); } - if (hasVolatileImage) { - new VolatileImg(); + if (hasTransparentVolatileImage) { + new VolatileImg(Transparency.OPAQUE); + new VolatileImg(Transparency.BITMASK); + new VolatileImg(Transparency.TRANSLUCENT); + } else { + new VolatileImg(); + } } bufimgsrcroot = @@ -154,11 +158,15 @@ "BufferedImage Rendering Sources"); new BufImg(BufferedImage.TYPE_INT_RGB); new BufImg(BufferedImage.TYPE_INT_ARGB); + new BufImg(BufferedImage.TYPE_INT_ARGB_PRE); new BufImg(BufferedImage.TYPE_BYTE_GRAY); new BufImg(BufferedImage.TYPE_3BYTE_BGR); + new BufImg(BufferedImage.TYPE_4BYTE_ABGR); + new BufImg(BufferedImage.TYPE_4BYTE_ABGR_PRE); new BmByteIndexBufImg(); new BufImg(BufferedImage.TYPE_INT_RGB, true); new BufImg(BufferedImage.TYPE_INT_ARGB, true); + new BufImg(BufferedImage.TYPE_INT_ARGB_PRE, true); new BufImg(BufferedImage.TYPE_3BYTE_BGR, true); imageOpRoot = new Group(imageroot, "imageops", @@ -211,12 +219,31 @@ new BufImgOpFilter(true); new RasterOpFilter(false); new RasterOpFilter(true); + + String interpolationnames[] = {"Nearest neighbor", "Bilinear", + "Bicubic",}; + interpolation = + new ObjectList(imgtestOptRoot, "interpolation", + "Interpolation", + interpolationnames, new Object[] { + RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR, + RenderingHints.VALUE_INTERPOLATION_BILINEAR, + RenderingHints.VALUE_INTERPOLATION_BICUBIC, + }, interpolationnames, interpolationnames, 1); } + doTouchSrc = + new Option.Toggle(imgtestOptRoot, "touchsrc", + "Touch source image before every operation", + Option.Toggle.Off); + + imgtestroot = new Group(imgbenchroot, "tests", "Image Rendering Tests"); + new DrawImage(); new DrawImageBg(); new DrawImageScale("up", 1.5f); new DrawImageScale("down", .75f); + new DrawImageScale("split", .5f); new DrawImageTransform(); } @@ -236,6 +263,7 @@ super(parent, nodeName, description); addDependency(imgsrcroot, srcFilter); addDependency(doTouchSrc); + addDependency(interpolation); } public GraphicsTests.Context createContext() { @@ -248,6 +276,11 @@ ictx.src = env.getSrcImage(); ictx.touchSrc = env.isEnabled(doTouchSrc); + if (hasGraphics2D) { + Graphics2D g2d = (Graphics2D) ctx.graphics; + final Object modifier = env.getModifier(interpolation); + g2d.setRenderingHint(RenderingHints.KEY_INTERPOLATION, modifier); + } } public abstract static class TriStateImageType extends Group { @@ -290,13 +323,27 @@ } public static class VolatileImg extends TriStateImageType { + private final int transparency; + public VolatileImg() { - super(imgsrcroot, "volimg", "Volatile Image", Transparency.OPAQUE); + this(0); + } + + public VolatileImg(int transparency) { + super(imgsrcroot, Destinations.VolatileImg.ShortNames[transparency], + Destinations.VolatileImg.LongDescriptions[transparency], + transparency); + this.transparency = transparency; } public Image makeImage(TestEnvironment env, int w, int h) { Canvas c = env.getCanvas(); - return c.createVolatileImage(w, h); + GraphicsConfiguration gc = c.getGraphicsConfiguration(); + if (transparency == 0) { + return gc.createCompatibleVolatileImage(w, h); + } else { + return gc.createCompatibleVolatileImage(w, h, transparency); + } } } --- old/src/demo/share/java2d/J2DBench/src/j2dbench/tests/cmm/ColorConvertOpTests.java 2014-11-05 21:45:53.000000000 +0300 +++ new/src/demo/share/java2d/J2DBench/src/j2dbench/tests/cmm/ColorConvertOpTests.java 2014-11-05 21:45:53.000000000 +0300 @@ -60,7 +60,7 @@ public class ColorConvertOpTests extends ColorConversionTests { private static class ImageContent { - static ImageContent BLANK = new ImageContent("bank", "Blank (opaque black)"); + static ImageContent BLANK = new ImageContent("blank", "Blank (opaque black)"); static ImageContent RANDOM = new ImageContent("random", "Random"); static ImageContent VECTOR = new ImageContent("vector", "Vector Art"); static ImageContent PHOTO= new ImageContent("photo", "Photograph"); @@ -83,7 +83,7 @@ static ImageType INT_RGB = new ImageType(BufferedImage.TYPE_INT_RGB, "INT_RGB", "TYPE_INT_RGB"); static ImageType INT_BGR = new ImageType(BufferedImage.TYPE_INT_BGR, "INT_BGR", "TYPE_INT_BGR"); static ImageType BYTE_3BYTE_BGR = new ImageType(BufferedImage.TYPE_3BYTE_BGR, "3BYTE_BGR", "TYPE_3BYTE_BGR"); - static ImageType BYTE_4BYTE_ABGR = new ImageType(BufferedImage.TYPE_4BYTE_ABGR, "4BYTE_BGR", "TYPE_4BYTE_BGR"); + static ImageType BYTE_4BYTE_ABGR = new ImageType(BufferedImage.TYPE_4BYTE_ABGR, "4BYTE_ABGR", "TYPE_4BYTE_ABGR"); static ImageType COMPATIBLE_DST = new ImageType(0, "Compatible", "Compatible destination"); private ImageType(int type, String abbr, String descr) { @@ -130,7 +130,7 @@ for (int i = 0; i < num; i++) { t[i] = allTypes[i]; - names[i] = t[i].toString(); + names[i] = t[i].abbrev; abbrev[i] = t[i].abbrev; descr[i] = t[i].descr; } --- old/src/demo/share/java2d/J2DBench/src/j2dbench/tests/cmm/EmbeddedProfileTests.java 2014-11-05 21:45:54.000000000 +0300 +++ new/src/demo/share/java2d/J2DBench/src/j2dbench/tests/cmm/EmbeddedProfileTests.java 2014-11-05 21:45:54.000000000 +0300 @@ -100,7 +100,7 @@ String[] descr = new String[num]; for (int i = 0; i < num; i++) { - names[i] = images[i].toString(); + names[i] = images[i].abbrev; abbrev[i] = images[i].abbrev; descr[i] = images[i].description; } @@ -153,7 +153,7 @@ iis = ImageIO.createImageInputStream(url.openStream()); reader = (ImageReader) ImageIO.getImageReaders(iis).next(); } catch (IOException e) { - throw new RuntimeException("Unable to run the becnhmark", e); + throw new RuntimeException("Unable to run the benchmark", e); } do {