author | erikj |
Tue, 12 Sep 2017 19:03:39 +0200 | |
changeset 47216 | 71c04702a3d5 |
parent 33653 | jdk/src/java.desktop/share/native/liblcms/LCMS.c@c1ee09fe3274 |
child 48566 | 6c986cf7299a |
permissions | -rw-r--r-- |
2 | 1 |
/* |
33653
c1ee09fe3274
8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents:
28059
diff
changeset
|
2 |
* Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved. |
2 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
5506 | 7 |
* published by the Free Software Foundation. Oracle designates this |
2 | 8 |
* particular file as subject to the "Classpath" exception as provided |
5506 | 9 |
* by Oracle in the LICENSE file that accompanied this code. |
2 | 10 |
* |
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
* accompanied this code). |
|
16 |
* |
|
17 |
* You should have received a copy of the GNU General Public License version |
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
* |
|
5506 | 21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
22 |
* or visit www.oracle.com if you need additional information or have any |
|
23 |
* questions. |
|
2 | 24 |
*/ |
25 |
||
26 |
#include <stdio.h> |
|
6482
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
27 |
#include <stdlib.h> |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
28 |
#include <memory.h> |
2 | 29 |
#include "sun_java2d_cmm_lcms_LCMS.h" |
30 |
#include "jni_util.h" |
|
31 |
#include "Trace.h" |
|
32 |
#include "Disposer.h" |
|
24540 | 33 |
#include <lcms2.h> |
21232
049cc21737df
8026780: Crash on PPC and PPC v2 for Java_awt test suit
bae
parents:
21228
diff
changeset
|
34 |
#include "jlong.h" |
2 | 35 |
|
2392 | 36 |
|
37 |
#define ALIGNLONG(x) (((x)+3) & ~(3)) // Aligns to DWORD boundary |
|
38 |
||
39 |
#ifdef USE_BIG_ENDIAN |
|
40 |
#define AdjustEndianess32(a) |
|
41 |
#else |
|
42 |
||
43 |
static |
|
6482
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
44 |
void AdjustEndianess32(cmsUInt8Number *pByte) |
2392 | 45 |
{ |
6482
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
46 |
cmsUInt8Number temp1; |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
47 |
cmsUInt8Number temp2; |
2392 | 48 |
|
49 |
temp1 = *pByte++; |
|
50 |
temp2 = *pByte++; |
|
51 |
*(pByte-1) = *pByte; |
|
52 |
*pByte++ = temp2; |
|
53 |
*(pByte-3) = *pByte; |
|
54 |
*pByte = temp1; |
|
55 |
} |
|
56 |
||
57 |
#endif |
|
58 |
||
59 |
// Transports to properly encoded values - note that icc profiles does use |
|
60 |
// big endian notation. |
|
61 |
||
62 |
static |
|
6482
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
63 |
cmsInt32Number TransportValue32(cmsInt32Number Value) |
2392 | 64 |
{ |
6482
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
65 |
cmsInt32Number Temp = Value; |
2392 | 66 |
|
6482
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
67 |
AdjustEndianess32((cmsUInt8Number*) &Temp); |
2392 | 68 |
return Temp; |
69 |
} |
|
70 |
||
2 | 71 |
#define SigMake(a,b,c,d) \ |
72 |
( ( ((int) ((unsigned char) (a))) << 24) | \ |
|
73 |
( ((int) ((unsigned char) (b))) << 16) | \ |
|
74 |
( ((int) ((unsigned char) (c))) << 8) | \ |
|
75 |
(int) ((unsigned char) (d))) |
|
76 |
||
77 |
#define TagIdConst(a, b, c, d) \ |
|
78 |
((int) SigMake ((a), (b), (c), (d))) |
|
79 |
||
80 |
#define SigHead TagIdConst('h','e','a','d') |
|
81 |
||
82 |
#define DT_BYTE 0 |
|
83 |
#define DT_SHORT 1 |
|
84 |
#define DT_INT 2 |
|
85 |
#define DT_DOUBLE 3 |
|
86 |
||
87 |
/* Default temp profile list size */ |
|
88 |
#define DF_ICC_BUF_SIZE 32 |
|
89 |
||
6482
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
90 |
#define ERR_MSG_SIZE 256 |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
91 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
92 |
#ifdef _MSC_VER |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
93 |
# ifndef snprintf |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
94 |
# define snprintf _snprintf |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
95 |
# endif |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
96 |
#endif |
2 | 97 |
|
19783
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
98 |
typedef struct lcmsProfile_s { |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
99 |
cmsHPROFILE pf; |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
100 |
} lcmsProfile_t, *lcmsProfile_p; |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
101 |
|
6482
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
102 |
typedef union { |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
103 |
cmsTagSignature cms; |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
104 |
jint j; |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
105 |
} TagSignature_t, *TagSignature_p; |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
106 |
|
2 | 107 |
static jfieldID Trans_renderType_fID; |
108 |
static jfieldID Trans_ID_fID; |
|
109 |
static jfieldID IL_isIntPacked_fID; |
|
110 |
static jfieldID IL_dataType_fID; |
|
111 |
static jfieldID IL_pixelType_fID; |
|
112 |
static jfieldID IL_dataArray_fID; |
|
113 |
static jfieldID IL_offset_fID; |
|
114 |
static jfieldID IL_nextRowOffset_fID; |
|
115 |
static jfieldID IL_width_fID; |
|
116 |
static jfieldID IL_height_fID; |
|
15974
91b0e63e6e83
8005530: [lcms] Improve performance of ColorConverOp for default destinations
bae
parents:
14884
diff
changeset
|
117 |
static jfieldID IL_imageAtOnce_fID; |
2 | 118 |
|
119 |
JavaVM *javaVM; |
|
120 |
||
6482
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
121 |
void errorHandler(cmsContext ContextID, cmsUInt32Number errorCode, |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
122 |
const char *errorText) { |
2 | 123 |
JNIEnv *env; |
124 |
char errMsg[ERR_MSG_SIZE]; |
|
6482
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
125 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
126 |
int count = snprintf(errMsg, ERR_MSG_SIZE, |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
127 |
"LCMS error %d: %s", errorCode, errorText); |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
128 |
if (count < 0 || count >= ERR_MSG_SIZE) { |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
129 |
count = ERR_MSG_SIZE - 1; |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
130 |
} |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
131 |
errMsg[count] = 0; |
2 | 132 |
|
133 |
(*javaVM)->AttachCurrentThread(javaVM, (void**)&env, NULL); |
|
134 |
JNU_ThrowByName(env, "java/awt/color/CMMException", errMsg); |
|
135 |
} |
|
136 |
||
33653
c1ee09fe3274
8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents:
28059
diff
changeset
|
137 |
JNIEXPORT jint JNICALL DEF_JNI_OnLoad(JavaVM *jvm, void *reserved) { |
2 | 138 |
javaVM = jvm; |
139 |
||
6482
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
140 |
cmsSetLogErrorHandler(errorHandler); |
2 | 141 |
return JNI_VERSION_1_6; |
142 |
} |
|
143 |
||
19783
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
144 |
void LCMS_freeProfile(JNIEnv *env, jlong ptr) { |
21232
049cc21737df
8026780: Crash on PPC and PPC v2 for Java_awt test suit
bae
parents:
21228
diff
changeset
|
145 |
lcmsProfile_p p = (lcmsProfile_p)jlong_to_ptr(ptr); |
19783
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
146 |
|
21232
049cc21737df
8026780: Crash on PPC and PPC v2 for Java_awt test suit
bae
parents:
21228
diff
changeset
|
147 |
if (p != NULL) { |
049cc21737df
8026780: Crash on PPC and PPC v2 for Java_awt test suit
bae
parents:
21228
diff
changeset
|
148 |
if (p->pf != NULL) { |
049cc21737df
8026780: Crash on PPC and PPC v2 for Java_awt test suit
bae
parents:
21228
diff
changeset
|
149 |
cmsCloseProfile(p->pf); |
19783
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
150 |
} |
21232
049cc21737df
8026780: Crash on PPC and PPC v2 for Java_awt test suit
bae
parents:
21228
diff
changeset
|
151 |
free(p); |
19783
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
152 |
} |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
153 |
} |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
154 |
|
2 | 155 |
void LCMS_freeTransform(JNIEnv *env, jlong ID) |
156 |
{ |
|
21232
049cc21737df
8026780: Crash on PPC and PPC v2 for Java_awt test suit
bae
parents:
21228
diff
changeset
|
157 |
cmsHTRANSFORM sTrans = jlong_to_ptr(ID); |
2 | 158 |
/* Passed ID is always valid native ref so there is no check for zero */ |
21232
049cc21737df
8026780: Crash on PPC and PPC v2 for Java_awt test suit
bae
parents:
21228
diff
changeset
|
159 |
cmsDeleteTransform(sTrans); |
2 | 160 |
} |
161 |
||
162 |
/* |
|
163 |
* Class: sun_java2d_cmm_lcms_LCMS |
|
164 |
* Method: createNativeTransform |
|
165 |
* Signature: ([JI)J |
|
166 |
*/ |
|
167 |
JNIEXPORT jlong JNICALL Java_sun_java2d_cmm_lcms_LCMS_createNativeTransform |
|
168 |
(JNIEnv *env, jclass cls, jlongArray profileIDs, jint renderType, |
|
14884
74d1acdb7ee4
7124245: [lcms] ColorConvertOp to color space CS_GRAY apparently converts orange to 244,244,0
bae
parents:
14154
diff
changeset
|
169 |
jint inFormatter, jboolean isInIntPacked, |
74d1acdb7ee4
7124245: [lcms] ColorConvertOp to color space CS_GRAY apparently converts orange to 244,244,0
bae
parents:
14154
diff
changeset
|
170 |
jint outFormatter, jboolean isOutIntPacked, jobject disposerRef) |
2 | 171 |
{ |
6482
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
172 |
cmsHPROFILE _iccArray[DF_ICC_BUF_SIZE]; |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
173 |
cmsHPROFILE *iccArray = &_iccArray[0]; |
21232
049cc21737df
8026780: Crash on PPC and PPC v2 for Java_awt test suit
bae
parents:
21228
diff
changeset
|
174 |
cmsHTRANSFORM sTrans = NULL; |
2 | 175 |
int i, j, size; |
176 |
jlong* ids; |
|
177 |
||
178 |
size = (*env)->GetArrayLength (env, profileIDs); |
|
19783
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
179 |
ids = (*env)->GetLongArrayElements(env, profileIDs, 0); |
21226
51ad6a10c2d4
8025429: [parfait] warnings from b107 for sun.java2d.cmm: JNI exception pending
jchen
parents:
19787
diff
changeset
|
180 |
if (ids == NULL) { |
51ad6a10c2d4
8025429: [parfait] warnings from b107 for sun.java2d.cmm: JNI exception pending
jchen
parents:
19787
diff
changeset
|
181 |
// An exception should have already been thrown. |
51ad6a10c2d4
8025429: [parfait] warnings from b107 for sun.java2d.cmm: JNI exception pending
jchen
parents:
19787
diff
changeset
|
182 |
return 0L; |
51ad6a10c2d4
8025429: [parfait] warnings from b107 for sun.java2d.cmm: JNI exception pending
jchen
parents:
19787
diff
changeset
|
183 |
} |
2 | 184 |
|
14884
74d1acdb7ee4
7124245: [lcms] ColorConvertOp to color space CS_GRAY apparently converts orange to 244,244,0
bae
parents:
14154
diff
changeset
|
185 |
#ifdef _LITTLE_ENDIAN |
74d1acdb7ee4
7124245: [lcms] ColorConvertOp to color space CS_GRAY apparently converts orange to 244,244,0
bae
parents:
14154
diff
changeset
|
186 |
/* Reversing data packed into int for LE archs */ |
74d1acdb7ee4
7124245: [lcms] ColorConvertOp to color space CS_GRAY apparently converts orange to 244,244,0
bae
parents:
14154
diff
changeset
|
187 |
if (isInIntPacked) { |
74d1acdb7ee4
7124245: [lcms] ColorConvertOp to color space CS_GRAY apparently converts orange to 244,244,0
bae
parents:
14154
diff
changeset
|
188 |
inFormatter ^= DOSWAP_SH(1); |
74d1acdb7ee4
7124245: [lcms] ColorConvertOp to color space CS_GRAY apparently converts orange to 244,244,0
bae
parents:
14154
diff
changeset
|
189 |
} |
74d1acdb7ee4
7124245: [lcms] ColorConvertOp to color space CS_GRAY apparently converts orange to 244,244,0
bae
parents:
14154
diff
changeset
|
190 |
if (isOutIntPacked) { |
74d1acdb7ee4
7124245: [lcms] ColorConvertOp to color space CS_GRAY apparently converts orange to 244,244,0
bae
parents:
14154
diff
changeset
|
191 |
outFormatter ^= DOSWAP_SH(1); |
74d1acdb7ee4
7124245: [lcms] ColorConvertOp to color space CS_GRAY apparently converts orange to 244,244,0
bae
parents:
14154
diff
changeset
|
192 |
} |
74d1acdb7ee4
7124245: [lcms] ColorConvertOp to color space CS_GRAY apparently converts orange to 244,244,0
bae
parents:
14154
diff
changeset
|
193 |
#endif |
74d1acdb7ee4
7124245: [lcms] ColorConvertOp to color space CS_GRAY apparently converts orange to 244,244,0
bae
parents:
14154
diff
changeset
|
194 |
|
2 | 195 |
if (DF_ICC_BUF_SIZE < size*2) { |
6482
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
196 |
iccArray = (cmsHPROFILE*) malloc( |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
197 |
size*2*sizeof(cmsHPROFILE)); |
2 | 198 |
if (iccArray == NULL) { |
19783
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
199 |
(*env)->ReleaseLongArrayElements(env, profileIDs, ids, 0); |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
200 |
|
2 | 201 |
J2dRlsTraceLn(J2D_TRACE_ERROR, "getXForm: iccArray == NULL"); |
6482
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
202 |
return 0L; |
2 | 203 |
} |
204 |
} |
|
205 |
||
206 |
j = 0; |
|
207 |
for (i = 0; i < size; i++) { |
|
6482
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
208 |
cmsColorSpaceSignature cs; |
21232
049cc21737df
8026780: Crash on PPC and PPC v2 for Java_awt test suit
bae
parents:
21228
diff
changeset
|
209 |
lcmsProfile_p profilePtr = (lcmsProfile_p)jlong_to_ptr(ids[i]); |
049cc21737df
8026780: Crash on PPC and PPC v2 for Java_awt test suit
bae
parents:
21228
diff
changeset
|
210 |
cmsHPROFILE icc = profilePtr->pf; |
6482
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
211 |
|
2 | 212 |
iccArray[j++] = icc; |
213 |
||
214 |
/* Middle non-abstract profiles should be doubled before passing to |
|
215 |
* the cmsCreateMultiprofileTransform function |
|
216 |
*/ |
|
6482
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
217 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
218 |
cs = cmsGetColorSpace(icc); |
2 | 219 |
if (size > 2 && i != 0 && i != size - 1 && |
6482
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
220 |
cs != cmsSigXYZData && cs != cmsSigLabData) |
2 | 221 |
{ |
222 |
iccArray[j++] = icc; |
|
223 |
} |
|
224 |
} |
|
225 |
||
21232
049cc21737df
8026780: Crash on PPC and PPC v2 for Java_awt test suit
bae
parents:
21228
diff
changeset
|
226 |
sTrans = cmsCreateMultiprofileTransform(iccArray, j, |
6482
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
227 |
inFormatter, outFormatter, renderType, 0); |
2 | 228 |
|
19783
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
229 |
(*env)->ReleaseLongArrayElements(env, profileIDs, ids, 0); |
2 | 230 |
|
21232
049cc21737df
8026780: Crash on PPC and PPC v2 for Java_awt test suit
bae
parents:
21228
diff
changeset
|
231 |
if (sTrans == NULL) { |
2 | 232 |
J2dRlsTraceLn(J2D_TRACE_ERROR, "LCMS_createNativeTransform: " |
21232
049cc21737df
8026780: Crash on PPC and PPC v2 for Java_awt test suit
bae
parents:
21228
diff
changeset
|
233 |
"sTrans == NULL"); |
19783
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
234 |
if ((*env)->ExceptionOccurred(env) == NULL) { |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
235 |
JNU_ThrowByName(env, "java/awt/color/CMMException", |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
236 |
"Cannot get color transform"); |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
237 |
} |
6868
f9131565859e
6963489: ZDI-CAN-803: Sun JRE ICC Profile Device Information Tag Remote Code Execution Vulnerability
bae
parents:
5506
diff
changeset
|
238 |
} else { |
21232
049cc21737df
8026780: Crash on PPC and PPC v2 for Java_awt test suit
bae
parents:
21228
diff
changeset
|
239 |
Disposer_AddRecord(env, disposerRef, LCMS_freeTransform, ptr_to_jlong(sTrans)); |
2 | 240 |
} |
241 |
||
242 |
if (iccArray != &_iccArray[0]) { |
|
243 |
free(iccArray); |
|
244 |
} |
|
21232
049cc21737df
8026780: Crash on PPC and PPC v2 for Java_awt test suit
bae
parents:
21228
diff
changeset
|
245 |
return ptr_to_jlong(sTrans); |
2 | 246 |
} |
247 |
||
248 |
||
249 |
/* |
|
250 |
* Class: sun_java2d_cmm_lcms_LCMS |
|
251 |
* Method: loadProfile |
|
19783
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
252 |
* Signature: ([B,Lsun/java2d/cmm/lcms/LCMSProfile;)V |
2 | 253 |
*/ |
15974
91b0e63e6e83
8005530: [lcms] Improve performance of ColorConverOp for default destinations
bae
parents:
14884
diff
changeset
|
254 |
JNIEXPORT jlong JNICALL Java_sun_java2d_cmm_lcms_LCMS_loadProfileNative |
19783
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
255 |
(JNIEnv *env, jobject obj, jbyteArray data, jobject disposerRef) |
2 | 256 |
{ |
257 |
jbyte* dataArray; |
|
258 |
jint dataSize; |
|
21232
049cc21737df
8026780: Crash on PPC and PPC v2 for Java_awt test suit
bae
parents:
21228
diff
changeset
|
259 |
lcmsProfile_p sProf = NULL; |
19783
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
260 |
cmsHPROFILE pf; |
2 | 261 |
|
9784
3a0ebf0b855d
7042594: 3 testis api/java_awt/Color/ICC_ProfileRGB/index.html fail against RI b138 OEL6x64.
bae
parents:
9035
diff
changeset
|
262 |
if (JNU_IsNull(env, data)) { |
3a0ebf0b855d
7042594: 3 testis api/java_awt/Color/ICC_ProfileRGB/index.html fail against RI b138 OEL6x64.
bae
parents:
9035
diff
changeset
|
263 |
JNU_ThrowIllegalArgumentException(env, "Invalid profile data"); |
3a0ebf0b855d
7042594: 3 testis api/java_awt/Color/ICC_ProfileRGB/index.html fail against RI b138 OEL6x64.
bae
parents:
9035
diff
changeset
|
264 |
return 0L; |
3a0ebf0b855d
7042594: 3 testis api/java_awt/Color/ICC_ProfileRGB/index.html fail against RI b138 OEL6x64.
bae
parents:
9035
diff
changeset
|
265 |
} |
3a0ebf0b855d
7042594: 3 testis api/java_awt/Color/ICC_ProfileRGB/index.html fail against RI b138 OEL6x64.
bae
parents:
9035
diff
changeset
|
266 |
|
2 | 267 |
dataArray = (*env)->GetByteArrayElements (env, data, 0); |
9784
3a0ebf0b855d
7042594: 3 testis api/java_awt/Color/ICC_ProfileRGB/index.html fail against RI b138 OEL6x64.
bae
parents:
9035
diff
changeset
|
268 |
if (dataArray == NULL) { |
21226
51ad6a10c2d4
8025429: [parfait] warnings from b107 for sun.java2d.cmm: JNI exception pending
jchen
parents:
19787
diff
changeset
|
269 |
// An exception should have already been thrown. |
9784
3a0ebf0b855d
7042594: 3 testis api/java_awt/Color/ICC_ProfileRGB/index.html fail against RI b138 OEL6x64.
bae
parents:
9035
diff
changeset
|
270 |
return 0L; |
3a0ebf0b855d
7042594: 3 testis api/java_awt/Color/ICC_ProfileRGB/index.html fail against RI b138 OEL6x64.
bae
parents:
9035
diff
changeset
|
271 |
} |
3a0ebf0b855d
7042594: 3 testis api/java_awt/Color/ICC_ProfileRGB/index.html fail against RI b138 OEL6x64.
bae
parents:
9035
diff
changeset
|
272 |
|
21226
51ad6a10c2d4
8025429: [parfait] warnings from b107 for sun.java2d.cmm: JNI exception pending
jchen
parents:
19787
diff
changeset
|
273 |
dataSize = (*env)->GetArrayLength (env, data); |
51ad6a10c2d4
8025429: [parfait] warnings from b107 for sun.java2d.cmm: JNI exception pending
jchen
parents:
19787
diff
changeset
|
274 |
|
19783
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
275 |
pf = cmsOpenProfileFromMem((const void *)dataArray, |
6482
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
276 |
(cmsUInt32Number) dataSize); |
2 | 277 |
|
2392 | 278 |
(*env)->ReleaseByteArrayElements (env, data, dataArray, 0); |
279 |
||
19783
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
280 |
if (pf == NULL) { |
2 | 281 |
JNU_ThrowIllegalArgumentException(env, "Invalid profile data"); |
14154
9acc7f86a458
7051394: NullPointerException when running regression tests LoadProfileTest by using openjdk-7-b144
bae
parents:
9784
diff
changeset
|
282 |
} else { |
9acc7f86a458
7051394: NullPointerException when running regression tests LoadProfileTest by using openjdk-7-b144
bae
parents:
9784
diff
changeset
|
283 |
/* Sanity check: try to save the profile in order |
9acc7f86a458
7051394: NullPointerException when running regression tests LoadProfileTest by using openjdk-7-b144
bae
parents:
9784
diff
changeset
|
284 |
* to force basic validation. |
9acc7f86a458
7051394: NullPointerException when running regression tests LoadProfileTest by using openjdk-7-b144
bae
parents:
9784
diff
changeset
|
285 |
*/ |
9acc7f86a458
7051394: NullPointerException when running regression tests LoadProfileTest by using openjdk-7-b144
bae
parents:
9784
diff
changeset
|
286 |
cmsUInt32Number pfSize = 0; |
19783
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
287 |
if (!cmsSaveProfileToMem(pf, NULL, &pfSize) || |
14154
9acc7f86a458
7051394: NullPointerException when running regression tests LoadProfileTest by using openjdk-7-b144
bae
parents:
9784
diff
changeset
|
288 |
pfSize < sizeof(cmsICCHeader)) |
9acc7f86a458
7051394: NullPointerException when running regression tests LoadProfileTest by using openjdk-7-b144
bae
parents:
9784
diff
changeset
|
289 |
{ |
9acc7f86a458
7051394: NullPointerException when running regression tests LoadProfileTest by using openjdk-7-b144
bae
parents:
9784
diff
changeset
|
290 |
JNU_ThrowIllegalArgumentException(env, "Invalid profile data"); |
19783
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
291 |
|
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
292 |
cmsCloseProfile(pf); |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
293 |
pf = NULL; |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
294 |
} |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
295 |
} |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
296 |
|
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
297 |
if (pf != NULL) { |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
298 |
// create profile holder |
21232
049cc21737df
8026780: Crash on PPC and PPC v2 for Java_awt test suit
bae
parents:
21228
diff
changeset
|
299 |
sProf = (lcmsProfile_p)malloc(sizeof(lcmsProfile_t)); |
049cc21737df
8026780: Crash on PPC and PPC v2 for Java_awt test suit
bae
parents:
21228
diff
changeset
|
300 |
if (sProf != NULL) { |
19783
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
301 |
// register the disposer record |
21232
049cc21737df
8026780: Crash on PPC and PPC v2 for Java_awt test suit
bae
parents:
21228
diff
changeset
|
302 |
sProf->pf = pf; |
049cc21737df
8026780: Crash on PPC and PPC v2 for Java_awt test suit
bae
parents:
21228
diff
changeset
|
303 |
Disposer_AddRecord(env, disposerRef, LCMS_freeProfile, ptr_to_jlong(sProf)); |
19783
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
304 |
} else { |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
305 |
cmsCloseProfile(pf); |
14154
9acc7f86a458
7051394: NullPointerException when running regression tests LoadProfileTest by using openjdk-7-b144
bae
parents:
9784
diff
changeset
|
306 |
} |
2 | 307 |
} |
308 |
||
21232
049cc21737df
8026780: Crash on PPC and PPC v2 for Java_awt test suit
bae
parents:
21228
diff
changeset
|
309 |
return ptr_to_jlong(sProf); |
2 | 310 |
} |
311 |
||
312 |
/* |
|
313 |
* Class: sun_java2d_cmm_lcms_LCMS |
|
19783
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
314 |
* Method: getProfileSizeNative |
2 | 315 |
* Signature: (J)I |
316 |
*/ |
|
19783
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
317 |
JNIEXPORT jint JNICALL Java_sun_java2d_cmm_lcms_LCMS_getProfileSizeNative |
2 | 318 |
(JNIEnv *env, jobject obj, jlong id) |
319 |
{ |
|
21232
049cc21737df
8026780: Crash on PPC and PPC v2 for Java_awt test suit
bae
parents:
21228
diff
changeset
|
320 |
lcmsProfile_p sProf = (lcmsProfile_p)jlong_to_ptr(id); |
6482
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
321 |
cmsUInt32Number pfSize = 0; |
2 | 322 |
|
21232
049cc21737df
8026780: Crash on PPC and PPC v2 for Java_awt test suit
bae
parents:
21228
diff
changeset
|
323 |
if (cmsSaveProfileToMem(sProf->pf, NULL, &pfSize) && ((jint)pfSize > 0)) { |
6482
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
324 |
return (jint)pfSize; |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
325 |
} else { |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
326 |
JNU_ThrowByName(env, "java/awt/color/CMMException", |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
327 |
"Can not access specified profile."); |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
328 |
return -1; |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
329 |
} |
2 | 330 |
} |
331 |
||
332 |
/* |
|
333 |
* Class: sun_java2d_cmm_lcms_LCMS |
|
19783
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
334 |
* Method: getProfileDataNative |
2 | 335 |
* Signature: (J[B)V |
336 |
*/ |
|
19783
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
337 |
JNIEXPORT void JNICALL Java_sun_java2d_cmm_lcms_LCMS_getProfileDataNative |
2 | 338 |
(JNIEnv *env, jobject obj, jlong id, jbyteArray data) |
339 |
{ |
|
21232
049cc21737df
8026780: Crash on PPC and PPC v2 for Java_awt test suit
bae
parents:
21228
diff
changeset
|
340 |
lcmsProfile_p sProf = (lcmsProfile_p)jlong_to_ptr(id); |
2 | 341 |
jint size; |
342 |
jbyte* dataArray; |
|
6482
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
343 |
cmsUInt32Number pfSize = 0; |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
344 |
cmsBool status; |
2 | 345 |
|
6482
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
346 |
// determine actual profile size |
21232
049cc21737df
8026780: Crash on PPC and PPC v2 for Java_awt test suit
bae
parents:
21228
diff
changeset
|
347 |
if (!cmsSaveProfileToMem(sProf->pf, NULL, &pfSize)) { |
6482
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
348 |
JNU_ThrowByName(env, "java/awt/color/CMMException", |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
349 |
"Can not access specified profile."); |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
350 |
return; |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
351 |
} |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
352 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
353 |
// verify java buffer capacity |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
354 |
size = (*env)->GetArrayLength(env, data); |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
355 |
if (0 >= size || pfSize > (cmsUInt32Number)size) { |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
356 |
JNU_ThrowByName(env, "java/awt/color/CMMException", |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
357 |
"Insufficient buffer capacity."); |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
358 |
return; |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
359 |
} |
2 | 360 |
|
361 |
dataArray = (*env)->GetByteArrayElements (env, data, 0); |
|
21226
51ad6a10c2d4
8025429: [parfait] warnings from b107 for sun.java2d.cmm: JNI exception pending
jchen
parents:
19787
diff
changeset
|
362 |
if (dataArray == NULL) { |
51ad6a10c2d4
8025429: [parfait] warnings from b107 for sun.java2d.cmm: JNI exception pending
jchen
parents:
19787
diff
changeset
|
363 |
// An exception should have already been thrown. |
51ad6a10c2d4
8025429: [parfait] warnings from b107 for sun.java2d.cmm: JNI exception pending
jchen
parents:
19787
diff
changeset
|
364 |
return; |
51ad6a10c2d4
8025429: [parfait] warnings from b107 for sun.java2d.cmm: JNI exception pending
jchen
parents:
19787
diff
changeset
|
365 |
} |
6482
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
366 |
|
21232
049cc21737df
8026780: Crash on PPC and PPC v2 for Java_awt test suit
bae
parents:
21228
diff
changeset
|
367 |
status = cmsSaveProfileToMem(sProf->pf, dataArray, &pfSize); |
6482
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
368 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
369 |
(*env)->ReleaseByteArrayElements (env, data, dataArray, 0); |
2 | 370 |
|
6482
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
371 |
if (!status) { |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
372 |
JNU_ThrowByName(env, "java/awt/color/CMMException", |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
373 |
"Can not access specified profile."); |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
374 |
return; |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
375 |
} |
2 | 376 |
} |
377 |
||
6482
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
378 |
/* Get profile header info */ |
9784
3a0ebf0b855d
7042594: 3 testis api/java_awt/Color/ICC_ProfileRGB/index.html fail against RI b138 OEL6x64.
bae
parents:
9035
diff
changeset
|
379 |
static cmsBool _getHeaderInfo(cmsHPROFILE pf, jbyte* pBuffer, jint bufferSize); |
3a0ebf0b855d
7042594: 3 testis api/java_awt/Color/ICC_ProfileRGB/index.html fail against RI b138 OEL6x64.
bae
parents:
9035
diff
changeset
|
380 |
static cmsBool _setHeaderInfo(cmsHPROFILE pf, jbyte* pBuffer, jint bufferSize); |
19783
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
381 |
static cmsHPROFILE _writeCookedTag(cmsHPROFILE pfTarget, cmsTagSignature sig, jbyte *pData, jint size); |
6482
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
382 |
|
2 | 383 |
|
384 |
/* |
|
385 |
* Class: sun_java2d_cmm_lcms_LCMS |
|
386 |
* Method: getTagData |
|
387 |
* Signature: (JI[B)V |
|
388 |
*/ |
|
15974
91b0e63e6e83
8005530: [lcms] Improve performance of ColorConverOp for default destinations
bae
parents:
14884
diff
changeset
|
389 |
JNIEXPORT jbyteArray JNICALL Java_sun_java2d_cmm_lcms_LCMS_getTagNative |
91b0e63e6e83
8005530: [lcms] Improve performance of ColorConverOp for default destinations
bae
parents:
14884
diff
changeset
|
390 |
(JNIEnv *env, jobject obj, jlong id, jint tagSig) |
2 | 391 |
{ |
21232
049cc21737df
8026780: Crash on PPC and PPC v2 for Java_awt test suit
bae
parents:
21228
diff
changeset
|
392 |
lcmsProfile_p sProf = (lcmsProfile_p)jlong_to_ptr(id); |
6482
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
393 |
TagSignature_t sig; |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
394 |
cmsInt32Number tagSize; |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
395 |
|
15974
91b0e63e6e83
8005530: [lcms] Improve performance of ColorConverOp for default destinations
bae
parents:
14884
diff
changeset
|
396 |
jbyte* dataArray = NULL; |
91b0e63e6e83
8005530: [lcms] Improve performance of ColorConverOp for default destinations
bae
parents:
14884
diff
changeset
|
397 |
jbyteArray data = NULL; |
91b0e63e6e83
8005530: [lcms] Improve performance of ColorConverOp for default destinations
bae
parents:
14884
diff
changeset
|
398 |
|
6482
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
399 |
jint bufSize; |
2 | 400 |
|
6482
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
401 |
sig.j = tagSig; |
2 | 402 |
|
403 |
if (tagSig == SigHead) { |
|
6482
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
404 |
cmsBool status; |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
405 |
|
15974
91b0e63e6e83
8005530: [lcms] Improve performance of ColorConverOp for default destinations
bae
parents:
14884
diff
changeset
|
406 |
// allocate java array |
91b0e63e6e83
8005530: [lcms] Improve performance of ColorConverOp for default destinations
bae
parents:
14884
diff
changeset
|
407 |
bufSize = sizeof(cmsICCHeader); |
91b0e63e6e83
8005530: [lcms] Improve performance of ColorConverOp for default destinations
bae
parents:
14884
diff
changeset
|
408 |
data = (*env)->NewByteArray(env, bufSize); |
6482
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
409 |
|
15974
91b0e63e6e83
8005530: [lcms] Improve performance of ColorConverOp for default destinations
bae
parents:
14884
diff
changeset
|
410 |
if (data == NULL) { |
21226
51ad6a10c2d4
8025429: [parfait] warnings from b107 for sun.java2d.cmm: JNI exception pending
jchen
parents:
19787
diff
changeset
|
411 |
// An exception should have already been thrown. |
15974
91b0e63e6e83
8005530: [lcms] Improve performance of ColorConverOp for default destinations
bae
parents:
14884
diff
changeset
|
412 |
return NULL; |
6482
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
413 |
} |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
414 |
|
2 | 415 |
dataArray = (*env)->GetByteArrayElements (env, data, 0); |
6482
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
416 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
417 |
if (dataArray == NULL) { |
21226
51ad6a10c2d4
8025429: [parfait] warnings from b107 for sun.java2d.cmm: JNI exception pending
jchen
parents:
19787
diff
changeset
|
418 |
// An exception should have already been thrown. |
51ad6a10c2d4
8025429: [parfait] warnings from b107 for sun.java2d.cmm: JNI exception pending
jchen
parents:
19787
diff
changeset
|
419 |
return NULL; |
6482
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
420 |
} |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
421 |
|
21232
049cc21737df
8026780: Crash on PPC and PPC v2 for Java_awt test suit
bae
parents:
21228
diff
changeset
|
422 |
status = _getHeaderInfo(sProf->pf, dataArray, bufSize); |
6482
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
423 |
|
2 | 424 |
(*env)->ReleaseByteArrayElements (env, data, dataArray, 0); |
6482
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
425 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
426 |
if (!status) { |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
427 |
JNU_ThrowByName(env, "java/awt/color/CMMException", |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
428 |
"ICC Profile header not found"); |
15974
91b0e63e6e83
8005530: [lcms] Improve performance of ColorConverOp for default destinations
bae
parents:
14884
diff
changeset
|
429 |
return NULL; |
6482
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
430 |
} |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
431 |
|
15974
91b0e63e6e83
8005530: [lcms] Improve performance of ColorConverOp for default destinations
bae
parents:
14884
diff
changeset
|
432 |
return data; |
2 | 433 |
} |
434 |
||
21232
049cc21737df
8026780: Crash on PPC and PPC v2 for Java_awt test suit
bae
parents:
21228
diff
changeset
|
435 |
if (cmsIsTag(sProf->pf, sig.cms)) { |
049cc21737df
8026780: Crash on PPC and PPC v2 for Java_awt test suit
bae
parents:
21228
diff
changeset
|
436 |
tagSize = cmsReadRawTag(sProf->pf, sig.cms, NULL, 0); |
6482
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
437 |
} else { |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
438 |
JNU_ThrowByName(env, "java/awt/color/CMMException", |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
439 |
"ICC profile tag not found"); |
15974
91b0e63e6e83
8005530: [lcms] Improve performance of ColorConverOp for default destinations
bae
parents:
14884
diff
changeset
|
440 |
return NULL; |
6482
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
441 |
} |
2 | 442 |
|
15974
91b0e63e6e83
8005530: [lcms] Improve performance of ColorConverOp for default destinations
bae
parents:
14884
diff
changeset
|
443 |
// allocate java array |
91b0e63e6e83
8005530: [lcms] Improve performance of ColorConverOp for default destinations
bae
parents:
14884
diff
changeset
|
444 |
data = (*env)->NewByteArray(env, tagSize); |
91b0e63e6e83
8005530: [lcms] Improve performance of ColorConverOp for default destinations
bae
parents:
14884
diff
changeset
|
445 |
if (data == NULL) { |
21226
51ad6a10c2d4
8025429: [parfait] warnings from b107 for sun.java2d.cmm: JNI exception pending
jchen
parents:
19787
diff
changeset
|
446 |
// An exception should have already been thrown. |
15974
91b0e63e6e83
8005530: [lcms] Improve performance of ColorConverOp for default destinations
bae
parents:
14884
diff
changeset
|
447 |
return NULL; |
2 | 448 |
} |
449 |
||
6482
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
450 |
dataArray = (*env)->GetByteArrayElements (env, data, 0); |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
451 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
452 |
if (dataArray == NULL) { |
21226
51ad6a10c2d4
8025429: [parfait] warnings from b107 for sun.java2d.cmm: JNI exception pending
jchen
parents:
19787
diff
changeset
|
453 |
// An exception should have already been thrown. |
15974
91b0e63e6e83
8005530: [lcms] Improve performance of ColorConverOp for default destinations
bae
parents:
14884
diff
changeset
|
454 |
return NULL; |
6482
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
455 |
} |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
456 |
|
21232
049cc21737df
8026780: Crash on PPC and PPC v2 for Java_awt test suit
bae
parents:
21228
diff
changeset
|
457 |
bufSize = cmsReadRawTag(sProf->pf, sig.cms, dataArray, tagSize); |
6482
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
458 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
459 |
(*env)->ReleaseByteArrayElements (env, data, dataArray, 0); |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
460 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
461 |
if (bufSize != tagSize) { |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
462 |
JNU_ThrowByName(env, "java/awt/color/CMMException", |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
463 |
"Can not get tag data."); |
15974
91b0e63e6e83
8005530: [lcms] Improve performance of ColorConverOp for default destinations
bae
parents:
14884
diff
changeset
|
464 |
return NULL; |
6482
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
465 |
} |
15974
91b0e63e6e83
8005530: [lcms] Improve performance of ColorConverOp for default destinations
bae
parents:
14884
diff
changeset
|
466 |
return data; |
2 | 467 |
} |
468 |
||
469 |
/* |
|
470 |
* Class: sun_java2d_cmm_lcms_LCMS |
|
471 |
* Method: setTagData |
|
472 |
* Signature: (JI[B)V |
|
473 |
*/ |
|
15974
91b0e63e6e83
8005530: [lcms] Improve performance of ColorConverOp for default destinations
bae
parents:
14884
diff
changeset
|
474 |
JNIEXPORT void JNICALL Java_sun_java2d_cmm_lcms_LCMS_setTagDataNative |
2 | 475 |
(JNIEnv *env, jobject obj, jlong id, jint tagSig, jbyteArray data) |
476 |
{ |
|
21232
049cc21737df
8026780: Crash on PPC and PPC v2 for Java_awt test suit
bae
parents:
21228
diff
changeset
|
477 |
lcmsProfile_p sProf = (lcmsProfile_p)jlong_to_ptr(id); |
19783
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
478 |
cmsHPROFILE pfReplace = NULL; |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
479 |
|
6482
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
480 |
TagSignature_t sig; |
19783
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
481 |
cmsBool status = FALSE; |
2392 | 482 |
jbyte* dataArray; |
483 |
int tagSize; |
|
484 |
||
6482
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
485 |
sig.j = tagSig; |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
486 |
|
9784
3a0ebf0b855d
7042594: 3 testis api/java_awt/Color/ICC_ProfileRGB/index.html fail against RI b138 OEL6x64.
bae
parents:
9035
diff
changeset
|
487 |
if (JNU_IsNull(env, data)) { |
3a0ebf0b855d
7042594: 3 testis api/java_awt/Color/ICC_ProfileRGB/index.html fail against RI b138 OEL6x64.
bae
parents:
9035
diff
changeset
|
488 |
JNU_ThrowIllegalArgumentException(env, "Can not write tag data."); |
3a0ebf0b855d
7042594: 3 testis api/java_awt/Color/ICC_ProfileRGB/index.html fail against RI b138 OEL6x64.
bae
parents:
9035
diff
changeset
|
489 |
return; |
3a0ebf0b855d
7042594: 3 testis api/java_awt/Color/ICC_ProfileRGB/index.html fail against RI b138 OEL6x64.
bae
parents:
9035
diff
changeset
|
490 |
} |
6482
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
491 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
492 |
tagSize =(*env)->GetArrayLength(env, data); |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
493 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
494 |
dataArray = (*env)->GetByteArrayElements(env, data, 0); |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
495 |
|
9784
3a0ebf0b855d
7042594: 3 testis api/java_awt/Color/ICC_ProfileRGB/index.html fail against RI b138 OEL6x64.
bae
parents:
9035
diff
changeset
|
496 |
if (dataArray == NULL) { |
21226
51ad6a10c2d4
8025429: [parfait] warnings from b107 for sun.java2d.cmm: JNI exception pending
jchen
parents:
19787
diff
changeset
|
497 |
// An exception should have already been thrown. |
9784
3a0ebf0b855d
7042594: 3 testis api/java_awt/Color/ICC_ProfileRGB/index.html fail against RI b138 OEL6x64.
bae
parents:
9035
diff
changeset
|
498 |
return; |
3a0ebf0b855d
7042594: 3 testis api/java_awt/Color/ICC_ProfileRGB/index.html fail against RI b138 OEL6x64.
bae
parents:
9035
diff
changeset
|
499 |
} |
3a0ebf0b855d
7042594: 3 testis api/java_awt/Color/ICC_ProfileRGB/index.html fail against RI b138 OEL6x64.
bae
parents:
9035
diff
changeset
|
500 |
|
2392 | 501 |
if (tagSig == SigHead) { |
21232
049cc21737df
8026780: Crash on PPC and PPC v2 for Java_awt test suit
bae
parents:
21228
diff
changeset
|
502 |
status = _setHeaderInfo(sProf->pf, dataArray, tagSize); |
6482
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
503 |
} else { |
19783
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
504 |
/* |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
505 |
* New strategy for generic tags: create a place holder, |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
506 |
* dump all existing tags there, dump externally supplied |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
507 |
* tag, and return the new profile to the java. |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
508 |
*/ |
21232
049cc21737df
8026780: Crash on PPC and PPC v2 for Java_awt test suit
bae
parents:
21228
diff
changeset
|
509 |
pfReplace = _writeCookedTag(sProf->pf, sig.cms, dataArray, tagSize); |
19783
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
510 |
status = (pfReplace != NULL); |
2392 | 511 |
} |
512 |
||
513 |
(*env)->ReleaseByteArrayElements(env, data, dataArray, 0); |
|
6482
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
514 |
|
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
515 |
if (!status) { |
9784
3a0ebf0b855d
7042594: 3 testis api/java_awt/Color/ICC_ProfileRGB/index.html fail against RI b138 OEL6x64.
bae
parents:
9035
diff
changeset
|
516 |
JNU_ThrowIllegalArgumentException(env, "Can not write tag data."); |
19783
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
517 |
} else if (pfReplace != NULL) { |
21232
049cc21737df
8026780: Crash on PPC and PPC v2 for Java_awt test suit
bae
parents:
21228
diff
changeset
|
518 |
cmsCloseProfile(sProf->pf); |
049cc21737df
8026780: Crash on PPC and PPC v2 for Java_awt test suit
bae
parents:
21228
diff
changeset
|
519 |
sProf->pf = pfReplace; |
6482
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
520 |
} |
2 | 521 |
} |
522 |
||
523 |
void* getILData (JNIEnv *env, jobject img, jint* pDataType, |
|
524 |
jobject* pDataObject) { |
|
525 |
void* result = NULL; |
|
526 |
*pDataType = (*env)->GetIntField (env, img, IL_dataType_fID); |
|
527 |
*pDataObject = (*env)->GetObjectField(env, img, IL_dataArray_fID); |
|
528 |
switch (*pDataType) { |
|
529 |
case DT_BYTE: |
|
530 |
result = (*env)->GetByteArrayElements (env, *pDataObject, 0); |
|
531 |
break; |
|
532 |
case DT_SHORT: |
|
533 |
result = (*env)->GetShortArrayElements (env, *pDataObject, 0); |
|
534 |
break; |
|
535 |
case DT_INT: |
|
536 |
result = (*env)->GetIntArrayElements (env, *pDataObject, 0); |
|
537 |
break; |
|
538 |
case DT_DOUBLE: |
|
539 |
result = (*env)->GetDoubleArrayElements (env, *pDataObject, 0); |
|
540 |
break; |
|
541 |
} |
|
542 |
||
543 |
return result; |
|
544 |
} |
|
545 |
||
546 |
void releaseILData (JNIEnv *env, void* pData, jint dataType, |
|
547 |
jobject dataObject) { |
|
548 |
switch (dataType) { |
|
549 |
case DT_BYTE: |
|
550 |
(*env)->ReleaseByteArrayElements(env,dataObject,(jbyte*)pData,0); |
|
551 |
break; |
|
552 |
case DT_SHORT: |
|
553 |
(*env)->ReleaseShortArrayElements(env,dataObject,(jshort*)pData, 0); |
|
554 |
break; |
|
555 |
case DT_INT: |
|
556 |
(*env)->ReleaseIntArrayElements(env,dataObject,(jint*)pData,0); |
|
557 |
break; |
|
558 |
case DT_DOUBLE: |
|
559 |
(*env)->ReleaseDoubleArrayElements(env,dataObject,(jdouble*)pData, |
|
560 |
0); |
|
561 |
break; |
|
562 |
} |
|
563 |
} |
|
564 |
||
565 |
/* |
|
566 |
* Class: sun_java2d_cmm_lcms_LCMS |
|
567 |
* Method: colorConvert |
|
568 |
* Signature: (Lsun/java2d/cmm/lcms/LCMSTransform;Lsun/java2d/cmm/lcms/LCMSImageLayout;Lsun/java2d/cmm/lcms/LCMSImageLayout;)V |
|
569 |
*/ |
|
570 |
JNIEXPORT void JNICALL Java_sun_java2d_cmm_lcms_LCMS_colorConvert |
|
571 |
(JNIEnv *env, jclass obj, jobject trans, jobject src, jobject dst) |
|
572 |
{ |
|
21232
049cc21737df
8026780: Crash on PPC and PPC v2 for Java_awt test suit
bae
parents:
21228
diff
changeset
|
573 |
cmsHTRANSFORM sTrans = NULL; |
14884
74d1acdb7ee4
7124245: [lcms] ColorConvertOp to color space CS_GRAY apparently converts orange to 244,244,0
bae
parents:
14154
diff
changeset
|
574 |
int srcDType, dstDType; |
2 | 575 |
int srcOffset, srcNextRowOffset, dstOffset, dstNextRowOffset; |
576 |
int width, height, i; |
|
577 |
void* inputBuffer; |
|
578 |
void* outputBuffer; |
|
579 |
char* inputRow; |
|
580 |
char* outputRow; |
|
581 |
jobject srcData, dstData; |
|
15974
91b0e63e6e83
8005530: [lcms] Improve performance of ColorConverOp for default destinations
bae
parents:
14884
diff
changeset
|
582 |
jboolean srcAtOnce = JNI_FALSE, dstAtOnce = JNI_FALSE; |
2 | 583 |
|
584 |
srcOffset = (*env)->GetIntField (env, src, IL_offset_fID); |
|
585 |
srcNextRowOffset = (*env)->GetIntField (env, src, IL_nextRowOffset_fID); |
|
586 |
dstOffset = (*env)->GetIntField (env, dst, IL_offset_fID); |
|
587 |
dstNextRowOffset = (*env)->GetIntField (env, dst, IL_nextRowOffset_fID); |
|
588 |
width = (*env)->GetIntField (env, src, IL_width_fID); |
|
589 |
height = (*env)->GetIntField (env, src, IL_height_fID); |
|
14884
74d1acdb7ee4
7124245: [lcms] ColorConvertOp to color space CS_GRAY apparently converts orange to 244,244,0
bae
parents:
14154
diff
changeset
|
590 |
|
15974
91b0e63e6e83
8005530: [lcms] Improve performance of ColorConverOp for default destinations
bae
parents:
14884
diff
changeset
|
591 |
srcAtOnce = (*env)->GetBooleanField(env, src, IL_imageAtOnce_fID); |
91b0e63e6e83
8005530: [lcms] Improve performance of ColorConverOp for default destinations
bae
parents:
14884
diff
changeset
|
592 |
dstAtOnce = (*env)->GetBooleanField(env, dst, IL_imageAtOnce_fID); |
91b0e63e6e83
8005530: [lcms] Improve performance of ColorConverOp for default destinations
bae
parents:
14884
diff
changeset
|
593 |
|
21232
049cc21737df
8026780: Crash on PPC and PPC v2 for Java_awt test suit
bae
parents:
21228
diff
changeset
|
594 |
sTrans = jlong_to_ptr((*env)->GetLongField (env, trans, Trans_ID_fID)); |
2 | 595 |
|
21232
049cc21737df
8026780: Crash on PPC and PPC v2 for Java_awt test suit
bae
parents:
21228
diff
changeset
|
596 |
if (sTrans == NULL) { |
2 | 597 |
J2dRlsTraceLn(J2D_TRACE_ERROR, "LCMS_colorConvert: transform == NULL"); |
598 |
JNU_ThrowByName(env, "java/awt/color/CMMException", |
|
599 |
"Cannot get color transform"); |
|
600 |
return; |
|
601 |
} |
|
602 |
||
603 |
||
604 |
inputBuffer = getILData (env, src, &srcDType, &srcData); |
|
605 |
||
606 |
if (inputBuffer == NULL) { |
|
607 |
J2dRlsTraceLn(J2D_TRACE_ERROR, ""); |
|
21226
51ad6a10c2d4
8025429: [parfait] warnings from b107 for sun.java2d.cmm: JNI exception pending
jchen
parents:
19787
diff
changeset
|
608 |
// An exception should have already been thrown. |
2 | 609 |
return; |
610 |
} |
|
611 |
||
612 |
outputBuffer = getILData (env, dst, &dstDType, &dstData); |
|
613 |
||
614 |
if (outputBuffer == NULL) { |
|
615 |
releaseILData(env, inputBuffer, srcDType, srcData); |
|
21226
51ad6a10c2d4
8025429: [parfait] warnings from b107 for sun.java2d.cmm: JNI exception pending
jchen
parents:
19787
diff
changeset
|
616 |
// An exception should have already been thrown. |
2 | 617 |
return; |
618 |
} |
|
619 |
||
620 |
inputRow = (char*)inputBuffer + srcOffset; |
|
621 |
outputRow = (char*)outputBuffer + dstOffset; |
|
622 |
||
15974
91b0e63e6e83
8005530: [lcms] Improve performance of ColorConverOp for default destinations
bae
parents:
14884
diff
changeset
|
623 |
if (srcAtOnce && dstAtOnce) { |
21232
049cc21737df
8026780: Crash on PPC and PPC v2 for Java_awt test suit
bae
parents:
21228
diff
changeset
|
624 |
cmsDoTransform(sTrans, inputRow, outputRow, width * height); |
15974
91b0e63e6e83
8005530: [lcms] Improve performance of ColorConverOp for default destinations
bae
parents:
14884
diff
changeset
|
625 |
} else { |
91b0e63e6e83
8005530: [lcms] Improve performance of ColorConverOp for default destinations
bae
parents:
14884
diff
changeset
|
626 |
for (i = 0; i < height; i++) { |
21232
049cc21737df
8026780: Crash on PPC and PPC v2 for Java_awt test suit
bae
parents:
21228
diff
changeset
|
627 |
cmsDoTransform(sTrans, inputRow, outputRow, width); |
15974
91b0e63e6e83
8005530: [lcms] Improve performance of ColorConverOp for default destinations
bae
parents:
14884
diff
changeset
|
628 |
inputRow += srcNextRowOffset; |
91b0e63e6e83
8005530: [lcms] Improve performance of ColorConverOp for default destinations
bae
parents:
14884
diff
changeset
|
629 |
outputRow += dstNextRowOffset; |
91b0e63e6e83
8005530: [lcms] Improve performance of ColorConverOp for default destinations
bae
parents:
14884
diff
changeset
|
630 |
} |
2 | 631 |
} |
632 |
||
633 |
releaseILData(env, inputBuffer, srcDType, srcData); |
|
634 |
releaseILData(env, outputBuffer, dstDType, dstData); |
|
635 |
} |
|
636 |
||
637 |
/* |
|
638 |
* Class: sun_java2d_cmm_lcms_LCMS |
|
639 |
* Method: getProfileID |
|
19783
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
640 |
* Signature: (Ljava/awt/color/ICC_Profile;)Lsun/java2d/cmm/lcms/LCMSProfile |
2 | 641 |
*/ |
19783
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
642 |
JNIEXPORT jobject JNICALL Java_sun_java2d_cmm_lcms_LCMS_getProfileID |
2 | 643 |
(JNIEnv *env, jclass cls, jobject pf) |
644 |
{ |
|
21228 | 645 |
jclass clsLcmsProfile; |
646 |
jobject cmmProfile; |
|
19783
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
647 |
jfieldID fid = (*env)->GetFieldID (env, |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
648 |
(*env)->GetObjectClass(env, pf), |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
649 |
"cmmProfile", "Lsun/java2d/cmm/Profile;"); |
21226
51ad6a10c2d4
8025429: [parfait] warnings from b107 for sun.java2d.cmm: JNI exception pending
jchen
parents:
19787
diff
changeset
|
650 |
if (fid == NULL) { |
51ad6a10c2d4
8025429: [parfait] warnings from b107 for sun.java2d.cmm: JNI exception pending
jchen
parents:
19787
diff
changeset
|
651 |
return NULL; |
51ad6a10c2d4
8025429: [parfait] warnings from b107 for sun.java2d.cmm: JNI exception pending
jchen
parents:
19787
diff
changeset
|
652 |
} |
19783
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
653 |
|
21228 | 654 |
clsLcmsProfile = (*env)->FindClass(env, |
19783
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
655 |
"sun/java2d/cmm/lcms/LCMSProfile"); |
21226
51ad6a10c2d4
8025429: [parfait] warnings from b107 for sun.java2d.cmm: JNI exception pending
jchen
parents:
19787
diff
changeset
|
656 |
if (clsLcmsProfile == NULL) { |
51ad6a10c2d4
8025429: [parfait] warnings from b107 for sun.java2d.cmm: JNI exception pending
jchen
parents:
19787
diff
changeset
|
657 |
return NULL; |
51ad6a10c2d4
8025429: [parfait] warnings from b107 for sun.java2d.cmm: JNI exception pending
jchen
parents:
19787
diff
changeset
|
658 |
} |
19783
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
659 |
|
21228 | 660 |
cmmProfile = (*env)->GetObjectField (env, pf, fid); |
19783
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
661 |
|
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
662 |
if (JNU_IsNull(env, cmmProfile)) { |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
663 |
return NULL; |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
664 |
} |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
665 |
if ((*env)->IsInstanceOf(env, cmmProfile, clsLcmsProfile)) { |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
666 |
return cmmProfile; |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
667 |
} |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
668 |
return NULL; |
2 | 669 |
} |
670 |
||
671 |
/* |
|
672 |
* Class: sun_java2d_cmm_lcms_LCMS |
|
673 |
* Method: initLCMS |
|
674 |
* Signature: (Ljava/lang/Class;Ljava/lang/Class;Ljava/lang/Class;)V |
|
675 |
*/ |
|
676 |
JNIEXPORT void JNICALL Java_sun_java2d_cmm_lcms_LCMS_initLCMS |
|
677 |
(JNIEnv *env, jclass cls, jclass Trans, jclass IL, jclass Pf) |
|
678 |
{ |
|
679 |
/* TODO: move initialization of the IDs to the static blocks of |
|
680 |
* corresponding classes to avoid problems with invalidating ids by class |
|
681 |
* unloading |
|
682 |
*/ |
|
683 |
Trans_renderType_fID = (*env)->GetFieldID (env, Trans, "renderType", "I"); |
|
21226
51ad6a10c2d4
8025429: [parfait] warnings from b107 for sun.java2d.cmm: JNI exception pending
jchen
parents:
19787
diff
changeset
|
684 |
if (Trans_renderType_fID == NULL) { |
51ad6a10c2d4
8025429: [parfait] warnings from b107 for sun.java2d.cmm: JNI exception pending
jchen
parents:
19787
diff
changeset
|
685 |
return; |
51ad6a10c2d4
8025429: [parfait] warnings from b107 for sun.java2d.cmm: JNI exception pending
jchen
parents:
19787
diff
changeset
|
686 |
} |
2 | 687 |
Trans_ID_fID = (*env)->GetFieldID (env, Trans, "ID", "J"); |
21226
51ad6a10c2d4
8025429: [parfait] warnings from b107 for sun.java2d.cmm: JNI exception pending
jchen
parents:
19787
diff
changeset
|
688 |
if (Trans_ID_fID == NULL) { |
51ad6a10c2d4
8025429: [parfait] warnings from b107 for sun.java2d.cmm: JNI exception pending
jchen
parents:
19787
diff
changeset
|
689 |
return; |
51ad6a10c2d4
8025429: [parfait] warnings from b107 for sun.java2d.cmm: JNI exception pending
jchen
parents:
19787
diff
changeset
|
690 |
} |
2 | 691 |
|
692 |
IL_isIntPacked_fID = (*env)->GetFieldID (env, IL, "isIntPacked", "Z"); |
|
21226
51ad6a10c2d4
8025429: [parfait] warnings from b107 for sun.java2d.cmm: JNI exception pending
jchen
parents:
19787
diff
changeset
|
693 |
if (IL_isIntPacked_fID == NULL) { |
51ad6a10c2d4
8025429: [parfait] warnings from b107 for sun.java2d.cmm: JNI exception pending
jchen
parents:
19787
diff
changeset
|
694 |
return; |
51ad6a10c2d4
8025429: [parfait] warnings from b107 for sun.java2d.cmm: JNI exception pending
jchen
parents:
19787
diff
changeset
|
695 |
} |
2 | 696 |
IL_dataType_fID = (*env)->GetFieldID (env, IL, "dataType", "I"); |
21226
51ad6a10c2d4
8025429: [parfait] warnings from b107 for sun.java2d.cmm: JNI exception pending
jchen
parents:
19787
diff
changeset
|
697 |
if (IL_dataType_fID == NULL) { |
51ad6a10c2d4
8025429: [parfait] warnings from b107 for sun.java2d.cmm: JNI exception pending
jchen
parents:
19787
diff
changeset
|
698 |
return; |
51ad6a10c2d4
8025429: [parfait] warnings from b107 for sun.java2d.cmm: JNI exception pending
jchen
parents:
19787
diff
changeset
|
699 |
} |
2 | 700 |
IL_pixelType_fID = (*env)->GetFieldID (env, IL, "pixelType", "I"); |
21226
51ad6a10c2d4
8025429: [parfait] warnings from b107 for sun.java2d.cmm: JNI exception pending
jchen
parents:
19787
diff
changeset
|
701 |
if (IL_pixelType_fID == NULL) { |
51ad6a10c2d4
8025429: [parfait] warnings from b107 for sun.java2d.cmm: JNI exception pending
jchen
parents:
19787
diff
changeset
|
702 |
return; |
51ad6a10c2d4
8025429: [parfait] warnings from b107 for sun.java2d.cmm: JNI exception pending
jchen
parents:
19787
diff
changeset
|
703 |
} |
2 | 704 |
IL_dataArray_fID = (*env)->GetFieldID(env, IL, "dataArray", |
705 |
"Ljava/lang/Object;"); |
|
21226
51ad6a10c2d4
8025429: [parfait] warnings from b107 for sun.java2d.cmm: JNI exception pending
jchen
parents:
19787
diff
changeset
|
706 |
if (IL_dataArray_fID == NULL) { |
51ad6a10c2d4
8025429: [parfait] warnings from b107 for sun.java2d.cmm: JNI exception pending
jchen
parents:
19787
diff
changeset
|
707 |
return; |
51ad6a10c2d4
8025429: [parfait] warnings from b107 for sun.java2d.cmm: JNI exception pending
jchen
parents:
19787
diff
changeset
|
708 |
} |
2 | 709 |
IL_width_fID = (*env)->GetFieldID (env, IL, "width", "I"); |
21226
51ad6a10c2d4
8025429: [parfait] warnings from b107 for sun.java2d.cmm: JNI exception pending
jchen
parents:
19787
diff
changeset
|
710 |
if (IL_width_fID == NULL) { |
51ad6a10c2d4
8025429: [parfait] warnings from b107 for sun.java2d.cmm: JNI exception pending
jchen
parents:
19787
diff
changeset
|
711 |
return; |
51ad6a10c2d4
8025429: [parfait] warnings from b107 for sun.java2d.cmm: JNI exception pending
jchen
parents:
19787
diff
changeset
|
712 |
} |
2 | 713 |
IL_height_fID = (*env)->GetFieldID (env, IL, "height", "I"); |
21226
51ad6a10c2d4
8025429: [parfait] warnings from b107 for sun.java2d.cmm: JNI exception pending
jchen
parents:
19787
diff
changeset
|
714 |
if (IL_height_fID == NULL) { |
51ad6a10c2d4
8025429: [parfait] warnings from b107 for sun.java2d.cmm: JNI exception pending
jchen
parents:
19787
diff
changeset
|
715 |
return; |
51ad6a10c2d4
8025429: [parfait] warnings from b107 for sun.java2d.cmm: JNI exception pending
jchen
parents:
19787
diff
changeset
|
716 |
} |
2 | 717 |
IL_offset_fID = (*env)->GetFieldID (env, IL, "offset", "I"); |
21226
51ad6a10c2d4
8025429: [parfait] warnings from b107 for sun.java2d.cmm: JNI exception pending
jchen
parents:
19787
diff
changeset
|
718 |
if (IL_offset_fID == NULL) { |
51ad6a10c2d4
8025429: [parfait] warnings from b107 for sun.java2d.cmm: JNI exception pending
jchen
parents:
19787
diff
changeset
|
719 |
return; |
51ad6a10c2d4
8025429: [parfait] warnings from b107 for sun.java2d.cmm: JNI exception pending
jchen
parents:
19787
diff
changeset
|
720 |
} |
15974
91b0e63e6e83
8005530: [lcms] Improve performance of ColorConverOp for default destinations
bae
parents:
14884
diff
changeset
|
721 |
IL_imageAtOnce_fID = (*env)->GetFieldID (env, IL, "imageAtOnce", "Z"); |
21226
51ad6a10c2d4
8025429: [parfait] warnings from b107 for sun.java2d.cmm: JNI exception pending
jchen
parents:
19787
diff
changeset
|
722 |
if (IL_imageAtOnce_fID == NULL) { |
51ad6a10c2d4
8025429: [parfait] warnings from b107 for sun.java2d.cmm: JNI exception pending
jchen
parents:
19787
diff
changeset
|
723 |
return; |
51ad6a10c2d4
8025429: [parfait] warnings from b107 for sun.java2d.cmm: JNI exception pending
jchen
parents:
19787
diff
changeset
|
724 |
} |
2 | 725 |
IL_nextRowOffset_fID = (*env)->GetFieldID (env, IL, "nextRowOffset", "I"); |
21226
51ad6a10c2d4
8025429: [parfait] warnings from b107 for sun.java2d.cmm: JNI exception pending
jchen
parents:
19787
diff
changeset
|
726 |
if (IL_nextRowOffset_fID == NULL) { |
51ad6a10c2d4
8025429: [parfait] warnings from b107 for sun.java2d.cmm: JNI exception pending
jchen
parents:
19787
diff
changeset
|
727 |
return; |
51ad6a10c2d4
8025429: [parfait] warnings from b107 for sun.java2d.cmm: JNI exception pending
jchen
parents:
19787
diff
changeset
|
728 |
} |
2 | 729 |
} |
2392 | 730 |
|
9784
3a0ebf0b855d
7042594: 3 testis api/java_awt/Color/ICC_ProfileRGB/index.html fail against RI b138 OEL6x64.
bae
parents:
9035
diff
changeset
|
731 |
static cmsBool _getHeaderInfo(cmsHPROFILE pf, jbyte* pBuffer, jint bufferSize) |
2392 | 732 |
{ |
6482
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
733 |
cmsUInt32Number pfSize = 0; |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
734 |
cmsUInt8Number* pfBuffer = NULL; |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
735 |
cmsBool status = FALSE; |
2392 | 736 |
|
6482
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
737 |
if (!cmsSaveProfileToMem(pf, NULL, &pfSize) || |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
738 |
pfSize < sizeof(cmsICCHeader) || |
21232
049cc21737df
8026780: Crash on PPC and PPC v2 for Java_awt test suit
bae
parents:
21228
diff
changeset
|
739 |
bufferSize < (jint)sizeof(cmsICCHeader)) |
6482
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
740 |
{ |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
741 |
return FALSE; |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
742 |
} |
2392 | 743 |
|
6482
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
744 |
pfBuffer = malloc(pfSize); |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
745 |
if (pfBuffer == NULL) { |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
746 |
return FALSE; |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
747 |
} |
2392 | 748 |
|
6482
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
749 |
// load raw profile data into the buffer |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
750 |
if (cmsSaveProfileToMem(pf, pfBuffer, &pfSize)) { |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
751 |
memcpy(pBuffer, pfBuffer, sizeof(cmsICCHeader)); |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
752 |
status = TRUE; |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
753 |
} |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
754 |
free(pfBuffer); |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
755 |
return status; |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
756 |
} |
2392 | 757 |
|
9784
3a0ebf0b855d
7042594: 3 testis api/java_awt/Color/ICC_ProfileRGB/index.html fail against RI b138 OEL6x64.
bae
parents:
9035
diff
changeset
|
758 |
static cmsBool _setHeaderInfo(cmsHPROFILE pf, jbyte* pBuffer, jint bufferSize) |
6482
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
759 |
{ |
21232
049cc21737df
8026780: Crash on PPC and PPC v2 for Java_awt test suit
bae
parents:
21228
diff
changeset
|
760 |
cmsICCHeader pfHeader; |
2392 | 761 |
|
21232
049cc21737df
8026780: Crash on PPC and PPC v2 for Java_awt test suit
bae
parents:
21228
diff
changeset
|
762 |
if (pBuffer == NULL || bufferSize < (jint)sizeof(cmsICCHeader)) { |
6482
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
763 |
return FALSE; |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
764 |
} |
2392 | 765 |
|
6482
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
766 |
memcpy(&pfHeader, pBuffer, sizeof(cmsICCHeader)); |
2392 | 767 |
|
6482
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
768 |
// now set header fields, which we can access using the lcms2 public API |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
769 |
cmsSetHeaderFlags(pf, pfHeader.flags); |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
770 |
cmsSetHeaderManufacturer(pf, pfHeader.manufacturer); |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
771 |
cmsSetHeaderModel(pf, pfHeader.model); |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
772 |
cmsSetHeaderAttributes(pf, pfHeader.attributes); |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
773 |
cmsSetHeaderProfileID(pf, (cmsUInt8Number*)&(pfHeader.profileID)); |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
774 |
cmsSetHeaderRenderingIntent(pf, pfHeader.renderingIntent); |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
775 |
cmsSetPCS(pf, pfHeader.pcs); |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
776 |
cmsSetColorSpace(pf, pfHeader.colorSpace); |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
777 |
cmsSetDeviceClass(pf, pfHeader.deviceClass); |
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
778 |
cmsSetEncodedICCversion(pf, pfHeader.version); |
2392 | 779 |
|
6482
0f6a4442b29e
6523398: OSS CMM: Need to implement writing ICC profile tags in new lcms library
bae
parents:
5506
diff
changeset
|
780 |
return TRUE; |
2392 | 781 |
} |
9784
3a0ebf0b855d
7042594: 3 testis api/java_awt/Color/ICC_ProfileRGB/index.html fail against RI b138 OEL6x64.
bae
parents:
9035
diff
changeset
|
782 |
|
19783
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
783 |
/* Returns new profile handler, if it was created successfully, |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
784 |
NULL otherwise. |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
785 |
*/ |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
786 |
static cmsHPROFILE _writeCookedTag(const cmsHPROFILE pfTarget, |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
787 |
const cmsTagSignature sig, |
9784
3a0ebf0b855d
7042594: 3 testis api/java_awt/Color/ICC_ProfileRGB/index.html fail against RI b138 OEL6x64.
bae
parents:
9035
diff
changeset
|
788 |
jbyte *pData, jint size) |
3a0ebf0b855d
7042594: 3 testis api/java_awt/Color/ICC_ProfileRGB/index.html fail against RI b138 OEL6x64.
bae
parents:
9035
diff
changeset
|
789 |
{ |
3a0ebf0b855d
7042594: 3 testis api/java_awt/Color/ICC_ProfileRGB/index.html fail against RI b138 OEL6x64.
bae
parents:
9035
diff
changeset
|
790 |
cmsUInt32Number pfSize = 0; |
19783
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
791 |
const cmsInt32Number tagCount = cmsGetTagCount(pfTarget); |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
792 |
cmsInt32Number i; |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
793 |
cmsHPROFILE pfSanity = NULL; |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
794 |
|
21232
049cc21737df
8026780: Crash on PPC and PPC v2 for Java_awt test suit
bae
parents:
21228
diff
changeset
|
795 |
cmsICCHeader hdr; |
9784
3a0ebf0b855d
7042594: 3 testis api/java_awt/Color/ICC_ProfileRGB/index.html fail against RI b138 OEL6x64.
bae
parents:
9035
diff
changeset
|
796 |
|
3a0ebf0b855d
7042594: 3 testis api/java_awt/Color/ICC_ProfileRGB/index.html fail against RI b138 OEL6x64.
bae
parents:
9035
diff
changeset
|
797 |
cmsHPROFILE p = cmsCreateProfilePlaceholder(NULL); |
19783
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
798 |
|
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
799 |
if (NULL == p) { |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
800 |
return NULL; |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
801 |
} |
21232
049cc21737df
8026780: Crash on PPC and PPC v2 for Java_awt test suit
bae
parents:
21228
diff
changeset
|
802 |
memset(&hdr, 0, sizeof(cmsICCHeader)); |
9784
3a0ebf0b855d
7042594: 3 testis api/java_awt/Color/ICC_ProfileRGB/index.html fail against RI b138 OEL6x64.
bae
parents:
9035
diff
changeset
|
803 |
|
19783
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
804 |
// Populate the placeholder's header according to target profile |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
805 |
hdr.flags = cmsGetHeaderFlags(pfTarget); |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
806 |
hdr.renderingIntent = cmsGetHeaderRenderingIntent(pfTarget); |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
807 |
hdr.manufacturer = cmsGetHeaderManufacturer(pfTarget); |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
808 |
hdr.model = cmsGetHeaderModel(pfTarget); |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
809 |
hdr.pcs = cmsGetPCS(pfTarget); |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
810 |
hdr.colorSpace = cmsGetColorSpace(pfTarget); |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
811 |
hdr.deviceClass = cmsGetDeviceClass(pfTarget); |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
812 |
hdr.version = cmsGetEncodedICCversion(pfTarget); |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
813 |
cmsGetHeaderAttributes(pfTarget, &hdr.attributes); |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
814 |
cmsGetHeaderProfileID(pfTarget, (cmsUInt8Number*)&hdr.profileID); |
9784
3a0ebf0b855d
7042594: 3 testis api/java_awt/Color/ICC_ProfileRGB/index.html fail against RI b138 OEL6x64.
bae
parents:
9035
diff
changeset
|
815 |
|
19783
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
816 |
cmsSetHeaderFlags(p, hdr.flags); |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
817 |
cmsSetHeaderManufacturer(p, hdr.manufacturer); |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
818 |
cmsSetHeaderModel(p, hdr.model); |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
819 |
cmsSetHeaderAttributes(p, hdr.attributes); |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
820 |
cmsSetHeaderProfileID(p, (cmsUInt8Number*)&(hdr.profileID)); |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
821 |
cmsSetHeaderRenderingIntent(p, hdr.renderingIntent); |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
822 |
cmsSetPCS(p, hdr.pcs); |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
823 |
cmsSetColorSpace(p, hdr.colorSpace); |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
824 |
cmsSetDeviceClass(p, hdr.deviceClass); |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
825 |
cmsSetEncodedICCversion(p, hdr.version); |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
826 |
|
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
827 |
// now write the user supplied tag |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
828 |
if (size <= 0 || !cmsWriteRawTag(p, sig, pData, size)) { |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
829 |
cmsCloseProfile(p); |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
830 |
return NULL; |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
831 |
} |
9784
3a0ebf0b855d
7042594: 3 testis api/java_awt/Color/ICC_ProfileRGB/index.html fail against RI b138 OEL6x64.
bae
parents:
9035
diff
changeset
|
832 |
|
19783
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
833 |
// copy tags from the original profile |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
834 |
for (i = 0; i < tagCount; i++) { |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
835 |
cmsBool isTagReady = FALSE; |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
836 |
const cmsTagSignature s = cmsGetTagSignature(pfTarget, i); |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
837 |
const cmsInt32Number tagSize = cmsReadRawTag(pfTarget, s, NULL, 0); |
9784
3a0ebf0b855d
7042594: 3 testis api/java_awt/Color/ICC_ProfileRGB/index.html fail against RI b138 OEL6x64.
bae
parents:
9035
diff
changeset
|
838 |
|
19783
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
839 |
if (s == sig) { |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
840 |
// skip the user supplied tag |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
841 |
continue; |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
842 |
} |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
843 |
|
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
844 |
// read raw tag from the original profile |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
845 |
if (tagSize > 0) { |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
846 |
cmsUInt8Number* buf = (cmsUInt8Number*)malloc(tagSize); |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
847 |
if (buf != NULL) { |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
848 |
if (tagSize == cmsReadRawTag(pfTarget, s, buf, tagSize)) { |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
849 |
// now we are ready to write the tag |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
850 |
isTagReady = cmsWriteRawTag(p, s, buf, tagSize); |
9784
3a0ebf0b855d
7042594: 3 testis api/java_awt/Color/ICC_ProfileRGB/index.html fail against RI b138 OEL6x64.
bae
parents:
9035
diff
changeset
|
851 |
} |
19783
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
852 |
free(buf); |
9784
3a0ebf0b855d
7042594: 3 testis api/java_awt/Color/ICC_ProfileRGB/index.html fail against RI b138 OEL6x64.
bae
parents:
9035
diff
changeset
|
853 |
} |
3a0ebf0b855d
7042594: 3 testis api/java_awt/Color/ICC_ProfileRGB/index.html fail against RI b138 OEL6x64.
bae
parents:
9035
diff
changeset
|
854 |
} |
19783
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
855 |
|
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
856 |
if (!isTagReady) { |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
857 |
cmsCloseProfile(p); |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
858 |
return NULL; |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
859 |
} |
9784
3a0ebf0b855d
7042594: 3 testis api/java_awt/Color/ICC_ProfileRGB/index.html fail against RI b138 OEL6x64.
bae
parents:
9035
diff
changeset
|
860 |
} |
3a0ebf0b855d
7042594: 3 testis api/java_awt/Color/ICC_ProfileRGB/index.html fail against RI b138 OEL6x64.
bae
parents:
9035
diff
changeset
|
861 |
|
19783
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
862 |
// now we have all tags moved to the new profile. |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
863 |
// do some sanity checks: write it to a memory buffer and read again. |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
864 |
if (cmsSaveProfileToMem(p, NULL, &pfSize)) { |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
865 |
void* buf = malloc(pfSize); |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
866 |
if (buf != NULL) { |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
867 |
// load raw profile data into the buffer |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
868 |
if (cmsSaveProfileToMem(p, buf, &pfSize)) { |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
869 |
pfSanity = cmsOpenProfileFromMem(buf, pfSize); |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
870 |
} |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
871 |
free(buf); |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
872 |
} |
9784
3a0ebf0b855d
7042594: 3 testis api/java_awt/Color/ICC_ProfileRGB/index.html fail against RI b138 OEL6x64.
bae
parents:
9035
diff
changeset
|
873 |
} |
3a0ebf0b855d
7042594: 3 testis api/java_awt/Color/ICC_ProfileRGB/index.html fail against RI b138 OEL6x64.
bae
parents:
9035
diff
changeset
|
874 |
|
19783
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
875 |
if (pfSanity == NULL) { |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
876 |
// for some reason, we failed to save and read the updated profile |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
877 |
// It likely indicates that the profile is not correct, so we report |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
878 |
// a failure here. |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
879 |
cmsCloseProfile(p); |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
880 |
p = NULL; |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
881 |
} else { |
28059
e576535359cc
8067377: My hobby: caning, then then canning, the the can-can
martin
parents:
25859
diff
changeset
|
882 |
// do final check whether we can read and handle the target tag. |
19783
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
883 |
const void* pTag = cmsReadTag(pfSanity, sig); |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
884 |
if (pTag == NULL) { |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
885 |
// the tag can not be cooked |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
886 |
cmsCloseProfile(p); |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
887 |
p = NULL; |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
888 |
} |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
889 |
cmsCloseProfile(pfSanity); |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
890 |
pfSanity = NULL; |
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
891 |
} |
9784
3a0ebf0b855d
7042594: 3 testis api/java_awt/Color/ICC_ProfileRGB/index.html fail against RI b138 OEL6x64.
bae
parents:
9035
diff
changeset
|
892 |
|
19783
88ce9a76c992
7043064: sun/java2d/cmm/ tests failed against RI b141 & b138-nightly
bae
parents:
15974
diff
changeset
|
893 |
return p; |
9784
3a0ebf0b855d
7042594: 3 testis api/java_awt/Color/ICC_ProfileRGB/index.html fail against RI b138 OEL6x64.
bae
parents:
9035
diff
changeset
|
894 |
} |