8042199: The build of J2DBench via makefile is broken after the JDK-8005402

Reviewed-by: flar, bae
This commit is contained in:
Sergey Bylokhov 2014-08-14 18:43:45 +04:00
parent 110fc8e47f
commit 531fc2cff0
8 changed files with 128 additions and 123 deletions

View File

@ -72,6 +72,7 @@ J2DANALYZER_CLASSES = \
J2DBENCH_RESOURCES = \ J2DBENCH_RESOURCES = \
$(CLASSES)/j2dbench/tests/iio/images \ $(CLASSES)/j2dbench/tests/iio/images \
$(CLASSES)/j2dbench/tests/cmm/images \
$(CLASSES)/j2dbench/tests/text/textdata $(CLASSES)/j2dbench/tests/text/textdata
SCM_DIRs = .hg .svn CVS RCS SCCS Codemgr_wsdata deleted_files SCM_DIRs = .hg .svn CVS RCS SCCS Codemgr_wsdata deleted_files
@ -101,6 +102,10 @@ $(CLASSES)/j2dbench/tests/text/textdata: $(RESOURCES)/textdata
cp -r $< $@ cp -r $< $@
cd $@ && rm -rf $(SCM_DIRs) cd $@ && rm -rf $(SCM_DIRs)
$(CLASSES)/j2dbench/tests/cmm/images: $(RESOURCES)/cmm_images
cp -r $< $@
cd $@ && rm -rf $(SCM_DIRs)
$(CLASSES)/j2dbench.manifest: $(CLASSES)/j2dbench.manifest:
echo "Main-Class: j2dbench.J2DBench" > $@ echo "Main-Class: j2dbench.J2DBench" > $@
@ -115,7 +120,7 @@ $(CLASSES):
mkdirs: $(DIST) $(CLASSES) mkdirs: $(DIST) $(CLASSES)
$(CLASSES)/j2dbench/%.class: $(SOURCEPATH)/j2dbench/%.java $(CLASSES)/j2dbench/%.class: $(SOURCEPATH)/j2dbench/%.java
javac -source 1.2 -target 1.2 -d $(CLASSES) -sourcepath $(SOURCEPATH) $< javac -g:none -source 1.6 -target 1.6 -d $(CLASSES) -sourcepath $(SOURCEPATH) $<
clean: clean:
rm -rf $(CLASSES) rm -rf $(CLASSES)

View File

@ -19,10 +19,9 @@ from the results files generated by the J2DBench runs.
Minimum requirements Minimum requirements
----------------------------------------------------------------------- -----------------------------------------------------------------------
The benchmark requires at least jdk1.4 to compile and The benchmark requires at least jdk1.4 to compile and run. Note that
at least jdk1.2** to run. source/target is set to 1.6 in the makefile and build.xml, because of
support in jdk 9 compiler.
** Note: the goal is to make the benchmark run on 1.1.x as well.
----------------------------------------------------------------------- -----------------------------------------------------------------------
How To Compile How To Compile
@ -125,7 +124,7 @@ choosing the options and benchmarks to run.
After the options file is created, start J2DBench in batch mode to run After the options file is created, start J2DBench in batch mode to run
the benchmarks for the default pipeline: the benchmarks for the default pipeline:
#> java -jar dest/J2DBench.jar -batch -loadopts options/default.opt \ #> java -jar dist/J2DBench.jar -batch -loadopts options/default.opt \
-saveres default.res -title "Rendering - Default ppl" \ -saveres default.res -title "Rendering - Default ppl" \
-desc "Rendering tests with the default pipeline" -desc "Rendering tests with the default pipeline"
@ -136,13 +135,13 @@ file and save the result in default.res file.
"Run Tests" in the J2DBench dialog) "Run Tests" in the J2DBench dialog)
Now run the benchmark with opengl pipeline: Now run the benchmark with opengl pipeline:
#> java -Dsun.java2d.opengl=True -jar dest/J2DBench.jar -batch \ #> java -Dsun.java2d.opengl=True -jar dist/J2DBench.jar -batch \
-loadopts options/default.opt \ -loadopts options/default.opt \
-saveres opengl.res -title "Rendering - OpenGL" \ -saveres opengl.res -title "Rendering - OpenGL" \
-desc "Rendering tests with OpenGL pipeline" -desc "Rendering tests with OpenGL pipeline"
Now let's analyze the results using J2DAnalyzer: Now let's analyze the results using J2DAnalyzer:
#> java -jar dest/J2DAnalyzer.jar default.res opengl.res #> java -jar dist/J2DAnalyzer.jar default.res opengl.res
Note that you can compare more than two sets of results, see Note that you can compare more than two sets of results, see
J2DAnalyzer's help page. J2DAnalyzer's help page.

View File

@ -49,7 +49,7 @@
<target name="compile" depends="init" <target name="compile" depends="init"
description="compile the source " > description="compile the source " >
<!-- Compile the java code from ${src} into ${build} --> <!-- Compile the java code from ${src} into ${build} -->
<javac debug="flase" source="1.5" target="1.5" srcdir="${src}" destdir="${build}"/> <javac debug="off" source="1.6" target="1.6" srcdir="${src}" destdir="${build}"/>
</target> </target>
<target name="run" depends="dist" <target name="run" depends="dist"

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
@ -39,23 +39,24 @@
package j2dbench.tests.cmm; package j2dbench.tests.cmm;
import j2dbench.Group;
import j2dbench.Option;
import j2dbench.Result;
import j2dbench.Test;
import j2dbench.TestEnvironment;
import java.awt.color.ColorSpace; import java.awt.color.ColorSpace;
import java.awt.color.ICC_ColorSpace; import java.awt.color.ICC_ColorSpace;
import java.awt.color.ICC_Profile; import java.awt.color.ICC_Profile;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import j2dbench.Group;
import j2dbench.Option;
import j2dbench.Result;
import j2dbench.Test;
import j2dbench.TestEnvironment;
public class CMMTests extends Test { public class CMMTests extends Test {
protected static Group cmmRoot; protected static Group cmmRoot;
protected static Group cmmOptRoot; protected static Group cmmOptRoot;
protected static Option csList; protected static Option csList;
protected static Option usePlatfromProfiles; protected static Option usePlatformProfiles;
public static void init() { public static void init() {
cmmRoot = new Group("cmm", "Color Management Benchmarks"); cmmRoot = new Group("cmm", "Color Management Benchmarks");
@ -64,9 +65,9 @@ public class CMMTests extends Test {
cmmOptRoot = new Group(cmmRoot, "opts", "General Options"); cmmOptRoot = new Group(cmmRoot, "opts", "General Options");
/* /*
usePlatfromProfiles = usePlatformProfiles =
new Option.Enable(cmmOptRoot, "csPlatfrom", new Option.Enable(cmmOptRoot, "csPlatform",
"Use Platfrom Profiles", false); "Use Platform Profiles", false);
*/ */
int[] colorspaces = new int[] { int[] colorspaces = new int[] {
ColorSpace.CS_sRGB, ColorSpace.CS_sRGB,
@ -92,10 +93,10 @@ public class CMMTests extends Test {
protected static ColorSpace getColorSpace(TestEnvironment env) { protected static ColorSpace getColorSpace(TestEnvironment env) {
ColorSpace cs; ColorSpace cs;
Boolean usePlatfrom = true; //(Boolean)env.getModifier(usePlatfromProfiles); boolean usePlatform = true; //(Boolean)env.getModifier(usePlatformProfiles);
int cs_code = env.getIntValue(csList); int cs_code = env.getIntValue(csList);
if (usePlatfrom) { if (usePlatform) {
cs = ColorSpace.getInstance(cs_code); cs = ColorSpace.getInstance(cs_code);
} else { } else {
String resource = "profiles/"; String resource = "profiles/";
@ -136,17 +137,14 @@ public class CMMTests extends Test {
addDependencies(cmmOptRoot, true); addDependencies(cmmOptRoot, true);
} }
@Override
public Object initTest(TestEnvironment te, Result result) { public Object initTest(TestEnvironment te, Result result) {
throw new UnsupportedOperationException("Not supported yet."); throw new UnsupportedOperationException("Not supported yet.");
} }
@Override
public void runTest(Object o, int i) { public void runTest(Object o, int i) {
throw new UnsupportedOperationException("Not supported yet."); throw new UnsupportedOperationException("Not supported yet.");
} }
@Override
public void cleanupTest(TestEnvironment te, Object o) { public void cleanupTest(TestEnvironment te, Object o) {
throw new UnsupportedOperationException("Not supported yet."); throw new UnsupportedOperationException("Not supported yet.");
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
@ -39,11 +39,6 @@
package j2dbench.tests.cmm; package j2dbench.tests.cmm;
import j2dbench.Group;
import j2dbench.Option;
import j2dbench.Result;
import j2dbench.TestEnvironment;
import j2dbench.tests.iio.IIOTests;
import java.awt.AlphaComposite; import java.awt.AlphaComposite;
import java.awt.Color; import java.awt.Color;
import java.awt.Graphics2D; import java.awt.Graphics2D;
@ -53,15 +48,22 @@ import java.awt.image.BufferedImage;
import java.awt.image.ColorConvertOp; import java.awt.image.ColorConvertOp;
import java.awt.image.Raster; import java.awt.image.Raster;
import java.awt.image.WritableRaster; import java.awt.image.WritableRaster;
import javax.imageio.ImageIO; import javax.imageio.ImageIO;
import j2dbench.Group;
import j2dbench.Option;
import j2dbench.Result;
import j2dbench.TestEnvironment;
import j2dbench.tests.iio.IIOTests;
public class ColorConvertOpTests extends ColorConversionTests { public class ColorConvertOpTests extends ColorConversionTests {
private static enum ImageContent { private static class ImageContent {
BLANK("bank", "Blank (opaque black)"), static ImageContent BLANK = new ImageContent("bank", "Blank (opaque black)");
RANDOM("random", "Random"), static ImageContent RANDOM = new ImageContent("random", "Random");
VECTOR("vector", "Vector Art"), static ImageContent VECTOR = new ImageContent("vector", "Vector Art");
PHOTO("photo", "Photograph"); static ImageContent PHOTO= new ImageContent("photo", "Photograph");
public final String name; public final String name;
public final String descr; public final String descr;
@ -70,15 +72,19 @@ public class ColorConvertOpTests extends ColorConversionTests {
this.name = name; this.name = name;
this.descr = descr; this.descr = descr;
} }
public static ImageContent[] values() {
return new ImageContent[]{BLANK, RANDOM, VECTOR, PHOTO};
}
} }
private static enum ImageType { private static class ImageType {
INT_ARGB(BufferedImage.TYPE_INT_ARGB, "INT_ARGB", "TYPE_INT_ARGB"), static ImageType INT_ARGB = new ImageType(BufferedImage.TYPE_INT_ARGB, "INT_ARGB", "TYPE_INT_ARGB");
INT_RGB(BufferedImage.TYPE_INT_RGB, "INT_RGB", "TYPE_INT_RGB"), static ImageType INT_RGB = new ImageType(BufferedImage.TYPE_INT_RGB, "INT_RGB", "TYPE_INT_RGB");
INT_BGR(BufferedImage.TYPE_INT_BGR, "INT_BGR", "TYPE_INT_BGR"), static ImageType INT_BGR = new ImageType(BufferedImage.TYPE_INT_BGR, "INT_BGR", "TYPE_INT_BGR");
BYTE_3BYTE_BGR(BufferedImage.TYPE_3BYTE_BGR, "3BYTE_BGR", "TYPE_3BYTE_BGR"), static ImageType BYTE_3BYTE_BGR = new ImageType(BufferedImage.TYPE_3BYTE_BGR, "3BYTE_BGR", "TYPE_3BYTE_BGR");
BYTE_4BYTE_ABGR(BufferedImage.TYPE_4BYTE_ABGR, "4BYTE_BGR", "TYPE_4BYTE_BGR"), static ImageType BYTE_4BYTE_ABGR = new ImageType(BufferedImage.TYPE_4BYTE_ABGR, "4BYTE_BGR", "TYPE_4BYTE_BGR");
COMPATIBLE_DST(0, "Compatible", "Compatible destination"); static ImageType COMPATIBLE_DST = new ImageType(0, "Compatible", "Compatible destination");
private ImageType(int type, String abbr, String descr) { private ImageType(int type, String abbr, String descr) {
this.type = type; this.type = type;
@ -89,11 +95,16 @@ public class ColorConvertOpTests extends ColorConversionTests {
public final int type; public final int type;
public final String abbrev; public final String abbrev;
public final String descr; public final String descr;
public static ImageType[] values() {
return new ImageType[]{INT_ARGB, INT_RGB, INT_BGR,
BYTE_3BYTE_BGR, BYTE_4BYTE_ABGR, COMPATIBLE_DST};
}
} }
private static enum ListType { private static class ListType {
SRC("srcType", "Source Images"), static ListType SRC = new ListType("srcType", "Source Images");
DST("dstType", "Destination Images"); static ListType DST = new ListType("dstType", "Destination Images");
private ListType(String name, String description) { private ListType(String name, String description) {
this.name = name; this.name = name;
@ -320,20 +331,18 @@ public class ColorConvertOpTests extends ColorConversionTests {
BufferedImage image; BufferedImage image;
image = new BufferedImage(width, height, type); image = new BufferedImage(width, height, type);
boolean hasAlpha = image.getColorModel().hasAlpha(); boolean hasAlpha = image.getColorModel().hasAlpha();
switch (contentType) { if (contentType == ImageContent.RANDOM) {
case RANDOM:
for (int y = 0; y < height; y++) { for (int y = 0; y < height; y++) {
for (int x = 0; x < width; x++) { for (int x = 0; x < width; x++) {
int rgb = (int)(Math.random() * 0xffffff); int rgb = (int) (Math.random() * 0xffffff);
if (hasAlpha) { if (hasAlpha) {
rgb |= 0x7f000000; rgb |= 0x7f000000;
} }
image.setRGB(x, y, rgb); image.setRGB(x, y, rgb);
} }
} }
break; }
case VECTOR: if (contentType == ImageContent.VECTOR) {
{
Graphics2D g = image.createGraphics(); Graphics2D g = image.createGraphics();
if (hasAlpha) { if (hasAlpha) {
// fill background with a translucent color // fill background with a translucent color
@ -353,10 +362,8 @@ public class ColorConvertOpTests extends ColorConversionTests {
g.drawLine(0, 0, width, height); g.drawLine(0, 0, width, height);
g.drawLine(0, height, width, 0); g.drawLine(0, height, width, 0);
g.dispose(); g.dispose();
break;
} }
case PHOTO: if (contentType == ImageContent.PHOTO) {
{
Image photo = null; Image photo = null;
try { try {
photo = ImageIO.read( photo = ImageIO.read(
@ -372,12 +379,7 @@ public class ColorConvertOpTests extends ColorConversionTests {
} }
g.drawImage(photo, 0, 0, width, height, null); g.drawImage(photo, 0, 0, width, height, null);
g.dispose(); g.dispose();
break;
} }
default:
break;
}
return image; return image;
} }
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
@ -39,10 +39,11 @@
package j2dbench.tests.cmm; package j2dbench.tests.cmm;
import java.awt.color.ColorSpace;
import j2dbench.Group; import j2dbench.Group;
import j2dbench.Result; import j2dbench.Result;
import j2dbench.TestEnvironment; import j2dbench.TestEnvironment;
import java.awt.color.ColorSpace;
public class DataConversionTests extends ColorConversionTests { public class DataConversionTests extends ColorConversionTests {
@ -92,13 +93,11 @@ public class DataConversionTests extends ColorConversionTests {
} }
} }
@Override
public Object initTest(TestEnvironment env, Result result) { public Object initTest(TestEnvironment env, Result result) {
ColorSpace cs = getColorSpace(env); ColorSpace cs = getColorSpace(env);
return new Context(env, result, cs); return new Context(env, result, cs);
} }
@Override
public void cleanupTest(TestEnvironment te, Object o) { public void cleanupTest(TestEnvironment te, Object o) {
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
@ -39,16 +39,18 @@
package j2dbench.tests.cmm; package j2dbench.tests.cmm;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.net.URL;
import javax.imageio.ImageIO;
import javax.imageio.ImageReader;
import javax.imageio.stream.ImageInputStream;
import j2dbench.Group; import j2dbench.Group;
import j2dbench.Option; import j2dbench.Option;
import j2dbench.Result; import j2dbench.Result;
import j2dbench.TestEnvironment; import j2dbench.TestEnvironment;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.net.URL;
import javax.imageio.ImageIO;
import javax.imageio.ImageReader;
import javax.imageio.stream.ImageInputStream;
/* This benchmark verifies how changes in cmm library affects image decoding */ /* This benchmark verifies how changes in cmm library affects image decoding */
public class EmbeddedProfileTests extends ColorConversionTests { public class EmbeddedProfileTests extends ColorConversionTests {
@ -68,10 +70,10 @@ public class EmbeddedProfileTests extends ColorConversionTests {
new ReadImageTest(); new ReadImageTest();
} }
private static enum IccImageResource { private static class IccImageResource {
SMALL("images/img_icc_small.jpg", "512x512", "Small: 512x512"), static IccImageResource SMALL = new IccImageResource("images/img_icc_small.jpg", "512x512", "Small: 512x512");
MEDIUM("images/img_icc_medium.jpg", "2048x2048", "Medium: 2048x2048"), static IccImageResource MEDIUM = new IccImageResource("images/img_icc_medium.jpg", "2048x2048", "Medium: 2048x2048");
LARGE("images/img_icc_large.jpg", "4096x4096", "Large: 4096x4096"); static IccImageResource LARGE = new IccImageResource("images/img_icc_large.jpg", "4096x4096", "Large: 4096x4096");
private IccImageResource(String file, String name, String description) { private IccImageResource(String file, String name, String description) {
this.url = CMMTests.class.getResource(file); this.url = CMMTests.class.getResource(file);
@ -82,6 +84,10 @@ public class EmbeddedProfileTests extends ColorConversionTests {
public final URL url; public final URL url;
public final String abbrev; public final String abbrev;
public final String description; public final String description;
public static IccImageResource[] values() {
return new IccImageResource[]{SMALL, MEDIUM, LARGE};
}
} }
private static Option createImageList() { private static Option createImageList() {
@ -145,7 +151,7 @@ public class EmbeddedProfileTests extends ColorConversionTests {
try { try {
iis = ImageIO.createImageInputStream(url.openStream()); iis = ImageIO.createImageInputStream(url.openStream());
reader = ImageIO.getImageReaders(iis).next(); reader = (ImageReader) ImageIO.getImageReaders(iis).next();
} catch (IOException e) { } catch (IOException e) {
throw new RuntimeException("Unable to run the becnhmark", e); throw new RuntimeException("Unable to run the becnhmark", e);
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
@ -38,12 +38,12 @@
*/ */
package j2dbench.tests.cmm; package j2dbench.tests.cmm;
import java.awt.color.ICC_ColorSpace;
import java.awt.color.ICC_Profile;
import j2dbench.Group; import j2dbench.Group;
import j2dbench.Result; import j2dbench.Result;
import j2dbench.TestEnvironment; import j2dbench.TestEnvironment;
import java.awt.color.ColorSpace;
import java.awt.color.ICC_ColorSpace;
import java.awt.color.ICC_Profile;
public class ProfileTests extends CMMTests { public class ProfileTests extends CMMTests {
@ -73,13 +73,11 @@ public class ProfileTests extends CMMTests {
} }
} }
@Override
public Object initTest(TestEnvironment env, Result res) { public Object initTest(TestEnvironment env, Result res) {
ICC_ColorSpace cs = (ICC_ColorSpace) getColorSpace(env); ICC_ColorSpace cs = (ICC_ColorSpace) getColorSpace(env);
return new Context(cs.getProfile(), env, res); return new Context(cs.getProfile(), env, res);
} }
@Override
public void cleanupTest(TestEnvironment env, Object o) { public void cleanupTest(TestEnvironment env, Object o) {
} }
@ -91,7 +89,6 @@ public class ProfileTests extends CMMTests {
"getData(icSigHead)"); "getData(icSigHead)");
} }
@Override
public void runTest(Object ctx, int numReps) { public void runTest(Object ctx, int numReps) {
final Context ictx = (Context) ctx; final Context ictx = (Context) ctx;
final ICC_Profile profile = ictx.profile; final ICC_Profile profile = ictx.profile;
@ -115,7 +112,6 @@ public class ProfileTests extends CMMTests {
"getNumComponents"); "getNumComponents");
} }
@Override
public void runTest(Object ctx, int numReps) { public void runTest(Object ctx, int numReps) {
final Context ictx = (Context) ctx; final Context ictx = (Context) ctx;
final ICC_Profile profile = ictx.profile; final ICC_Profile profile = ictx.profile;