--- a/jdk/test/sun/java2d/cmm/ColorConvertOp/ColConvTest.java Thu Jun 06 13:57:25 2013 +0400
+++ b/jdk/test/sun/java2d/cmm/ColorConvertOp/ColConvTest.java Fri Jun 07 14:45:29 2013 +0400
@@ -22,6 +22,7 @@
*/
import java.awt.color.ColorSpace;
+import java.awt.color.ICC_Profile;
import java.awt.image.BufferedImage;
import java.awt.image.DataBuffer;
@@ -126,4 +127,33 @@
public boolean isPassed() {
return passed;
}
+
+ private static Boolean isOpenProfile = null;
+
+ public static boolean isOpenProfile() {
+ if (isOpenProfile == null) {
+ ICC_Profile p = ICC_Profile.getInstance(ColorSpace.CS_sRGB);
+
+ byte[] h = p.getData(ICC_Profile.icSigHead);
+
+ if (h == null || h.length < 128) {
+ throw new RuntimeException("Test failed: invalid sRGB header");
+ }
+
+ final byte[] lcmsID = new byte[] {
+ (byte)0x6c, // l
+ (byte)0x63, // c
+ (byte)0x6d, // m
+ (byte)0x73, // s
+ };
+
+ int off = ICC_Profile.icHdrCmmId;
+
+ isOpenProfile = ((h[off + 0] == lcmsID[0])
+ && (h[off + 1] == lcmsID[1])
+ && (h[off + 2] == lcmsID[2])
+ && (h[off + 3] == lcmsID[3]));
+ }
+ return isOpenProfile;
+ }
}