diff options
author | Dmitry Markov <dmitry.markov@oracle.com> | 2024-03-03 08:53:35 +0000 |
---|---|---|
committer | Dmitry Markov <dmitry.markov@oracle.com> | 2024-03-03 08:53:35 +0000 |
commit | 27d436fbd467edd6226d42585558a973a9a67ecd (patch) | |
tree | d2df342ef18e49eea0bf4c72ecc0f3ccea7b2526 | |
parent | 37e01efb7831e29068f834fe0629595cb721b90d (diff) |
8326661: sun/java2d/cmm/ColorConvertOp/ColConvTest.java assumes profiles were generated by LCMSpr/18097
3 files changed, 9 insertions, 39 deletions
diff --git a/test/jdk/sun/java2d/cmm/ColorConvertOp/ColConvCCMTest.java b/test/jdk/sun/java2d/cmm/ColorConvertOp/ColConvCCMTest.java index 22e055fbe8e..f6701525780 100644 --- a/test/jdk/sun/java2d/cmm/ColorConvertOp/ColConvCCMTest.java +++ b/test/jdk/sun/java2d/cmm/ColorConvertOp/ColConvCCMTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,7 +23,7 @@ /** * @test - * @bug 6476665 7033534 6830714 8052162 8196572 + * @bug 6476665 7033534 6830714 8052162 8196572 8326661 * @summary Verifies color conversion of Component Color Model based images * @run main ColConvCCMTest */ @@ -57,10 +57,10 @@ public class ColConvCCMTest extends ColConvTest { final static double [] ACCURACY = { // Accuracy for color conversions 2.5, // sRGB - (isOpenProfile() ? 45.0 : 10.1), // LINEAR_RGB + 45.0, // LINEAR_RGB 10.5, // GRAY - (isOpenProfile() ? 215.0 : 45.5), // PYCC - (isOpenProfile() ? 56.0 : 47.5) // CIEXYZ + 215.0, // PYCC + 56.0 // CIEXYZ }; final static String [] gldImgNames = { diff --git a/test/jdk/sun/java2d/cmm/ColorConvertOp/ColConvDCMTest.java b/test/jdk/sun/java2d/cmm/ColorConvertOp/ColConvDCMTest.java index 25d19e2ca64..d50a67e6504 100644 --- a/test/jdk/sun/java2d/cmm/ColorConvertOp/ColConvDCMTest.java +++ b/test/jdk/sun/java2d/cmm/ColorConvertOp/ColConvDCMTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,7 +23,7 @@ /** * @test - * @bug 6476665 + * @bug 6476665 8326661 * @summary Verifies color conversion of Direct Color Model based images * @run main ColConvDCMTest */ @@ -65,7 +65,7 @@ public class ColConvDCMTest extends ColConvTest { final static double [] ACCURACY = { // Accuracy for color conversions 2.5, // sRGB - (isOpenProfile() ? 45.0 : 2.5), // LINEAR_RGB + 45.0 // LINEAR_RGB }; final static String [] gldImgNames = { diff --git a/test/jdk/sun/java2d/cmm/ColorConvertOp/ColConvTest.java b/test/jdk/sun/java2d/cmm/ColorConvertOp/ColConvTest.java index f8042fcc25e..5ba7e05454f 100644 --- a/test/jdk/sun/java2d/cmm/ColorConvertOp/ColConvTest.java +++ b/test/jdk/sun/java2d/cmm/ColorConvertOp/ColConvTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -22,7 +22,6 @@ */ import java.awt.color.ColorSpace; -import java.awt.color.ICC_Profile; import java.awt.image.BufferedImage; import java.awt.image.DataBuffer; @@ -127,33 +126,4 @@ public abstract class ColConvTest implements Runnable { 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; - } } |