Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
b7cadbff
D
dragonwell8_jdk
项目概览
openanolis
/
dragonwell8_jdk
通知
4
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_jdk
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
b7cadbff
编写于
1月 23, 2009
作者:
B
bae
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
6793818: JpegImageReader is too greedy creating color profiles
Reviewed-by: igor, prr
上级
f7e52057
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
71 addition
and
37 deletion
+71
-37
src/share/classes/java/awt/color/ICC_Profile.java
src/share/classes/java/awt/color/ICC_Profile.java
+46
-32
src/share/classes/sun/java2d/cmm/ProfileActivator.java
src/share/classes/sun/java2d/cmm/ProfileActivator.java
+2
-1
src/share/classes/sun/java2d/cmm/ProfileDeferralMgr.java
src/share/classes/sun/java2d/cmm/ProfileDeferralMgr.java
+23
-4
未找到文件。
src/share/classes/java/awt/color/ICC_Profile.java
浏览文件 @
b7cadbff
...
...
@@ -737,7 +737,7 @@ public class ICC_Profile implements Serializable {
ICC_Profile
(
ProfileDeferralInfo
pdi
)
{
this
.
deferralInfo
=
pdi
;
this
.
profileActivator
=
new
ProfileActivator
()
{
public
void
activate
()
{
public
void
activate
()
throws
ProfileDataException
{
activateDeferredProfile
();
}
};
...
...
@@ -830,20 +830,16 @@ public class ICC_Profile implements Serializable {
case
ColorSpace
.
CS_sRGB
:
synchronized
(
ICC_Profile
.
class
)
{
if
(
sRGBprofile
==
null
)
{
try
{
/*
* Deferral is only used for standard profiles.
* Enabling the appropriate access privileges is handled
* at a lower level.
*/
sRGBprofile
=
getDeferredInstance
(
new
ProfileDeferralInfo
(
"sRGB.pf"
,
ColorSpace
.
TYPE_RGB
,
3
,
CLASS_DISPLAY
));
}
catch
(
IOException
e
)
{
throw
new
IllegalArgumentException
(
"Can't load standard profile: sRGB.pf"
);
}
/*
* Deferral is only used for standard profiles.
* Enabling the appropriate access privileges is handled
* at a lower level.
*/
ProfileDeferralInfo
pInfo
=
new
ProfileDeferralInfo
(
"sRGB.pf"
,
ColorSpace
.
TYPE_RGB
,
3
,
CLASS_DISPLAY
);
sRGBprofile
=
getDeferredInstance
(
pInfo
);
}
thisProfile
=
sRGBprofile
;
}
...
...
@@ -853,7 +849,11 @@ public class ICC_Profile implements Serializable {
case
ColorSpace
.
CS_CIEXYZ
:
synchronized
(
ICC_Profile
.
class
)
{
if
(
XYZprofile
==
null
)
{
XYZprofile
=
getStandardProfile
(
"CIEXYZ.pf"
);
ProfileDeferralInfo
pInfo
=
new
ProfileDeferralInfo
(
"CIEXYZ.pf"
,
ColorSpace
.
TYPE_XYZ
,
3
,
CLASS_DISPLAY
);
XYZprofile
=
getDeferredInstance
(
pInfo
);
}
thisProfile
=
XYZprofile
;
}
...
...
@@ -863,7 +863,11 @@ public class ICC_Profile implements Serializable {
case
ColorSpace
.
CS_PYCC
:
synchronized
(
ICC_Profile
.
class
)
{
if
(
PYCCprofile
==
null
)
{
PYCCprofile
=
getStandardProfile
(
"PYCC.pf"
);
ProfileDeferralInfo
pInfo
=
new
ProfileDeferralInfo
(
"PYCC.pf"
,
ColorSpace
.
TYPE_3CLR
,
3
,
CLASS_DISPLAY
);
PYCCprofile
=
getDeferredInstance
(
pInfo
);
}
thisProfile
=
PYCCprofile
;
}
...
...
@@ -873,7 +877,11 @@ public class ICC_Profile implements Serializable {
case
ColorSpace
.
CS_GRAY
:
synchronized
(
ICC_Profile
.
class
)
{
if
(
GRAYprofile
==
null
)
{
GRAYprofile
=
getStandardProfile
(
"GRAY.pf"
);
ProfileDeferralInfo
pInfo
=
new
ProfileDeferralInfo
(
"GRAY.pf"
,
ColorSpace
.
TYPE_GRAY
,
1
,
CLASS_DISPLAY
);
GRAYprofile
=
getDeferredInstance
(
pInfo
);
}
thisProfile
=
GRAYprofile
;
}
...
...
@@ -883,7 +891,11 @@ public class ICC_Profile implements Serializable {
case
ColorSpace
.
CS_LINEAR_RGB
:
synchronized
(
ICC_Profile
.
class
)
{
if
(
LINEAR_RGBprofile
==
null
)
{
LINEAR_RGBprofile
=
getStandardProfile
(
"LINEAR_RGB.pf"
);
ProfileDeferralInfo
pInfo
=
new
ProfileDeferralInfo
(
"LINEAR_RGB.pf"
,
ColorSpace
.
TYPE_RGB
,
3
,
CLASS_DISPLAY
);
LINEAR_RGBprofile
=
getDeferredInstance
(
pInfo
);
}
thisProfile
=
LINEAR_RGBprofile
;
}
...
...
@@ -1047,9 +1059,7 @@ public class ICC_Profile implements Serializable {
* code will take care of access privileges.
* @see activateDeferredProfile()
*/
static
ICC_Profile
getDeferredInstance
(
ProfileDeferralInfo
pdi
)
throws
IOException
{
static
ICC_Profile
getDeferredInstance
(
ProfileDeferralInfo
pdi
)
{
if
(!
ProfileDeferralMgr
.
deferring
)
{
return
getStandardProfile
(
pdi
.
filename
);
}
...
...
@@ -1063,33 +1073,37 @@ public class ICC_Profile implements Serializable {
}
void
activateDeferredProfile
()
{
byte
profileData
[];
FileInputStream
fis
;
String
fileName
=
deferralInfo
.
filename
;
void
activateDeferredProfile
()
throws
ProfileDataException
{
byte
profileData
[];
FileInputStream
fis
;
String
fileName
=
deferralInfo
.
filename
;
profileActivator
=
null
;
deferralInfo
=
null
;
if
((
fis
=
openProfile
(
fileName
))
==
null
)
{
throw
new
IllegalArgument
Exception
(
"Cannot open file "
+
fileName
);
throw
new
ProfileData
Exception
(
"Cannot open file "
+
fileName
);
}
try
{
profileData
=
getProfileDataFromStream
(
fis
);
fis
.
close
();
/* close the file */
}
catch
(
IOException
e
)
{
throw
new
IllegalArgumentException
(
"Invalid ICC Profile Data"
+
fileName
);
ProfileDataException
pde
=
new
ProfileDataException
(
"Invalid ICC Profile Data"
+
fileName
);
pde
.
initCause
(
e
);
throw
pde
;
}
if
(
profileData
==
null
)
{
throw
new
IllegalArgument
Exception
(
"Invalid ICC Profile Data"
+
throw
new
ProfileData
Exception
(
"Invalid ICC Profile Data"
+
fileName
);
}
try
{
ID
=
CMSManager
.
getModule
().
loadProfile
(
profileData
);
}
catch
(
CMMException
c
)
{
throw
new
IllegalArgumentException
(
"Invalid ICC Profile Data"
+
fileName
);
ProfileDataException
pde
=
new
ProfileDataException
(
"Invalid ICC Profile Data"
+
fileName
);
pde
.
initCause
(
c
);
throw
pde
;
}
}
...
...
src/share/classes/sun/java2d/cmm/ProfileActivator.java
浏览文件 @
b7cadbff
...
...
@@ -25,6 +25,7 @@
package
sun.java2d.cmm
;
import
java.awt.color.ProfileDataException
;
/**
* An interface to allow the ProfileDeferralMgr to activate a
...
...
@@ -35,6 +36,6 @@ public interface ProfileActivator {
/**
* Activate a previously deferred ICC_Profile object.
*/
public
void
activate
();
public
void
activate
()
throws
ProfileDataException
;
}
src/share/classes/sun/java2d/cmm/ProfileDeferralMgr.java
浏览文件 @
b7cadbff
...
...
@@ -25,6 +25,7 @@
package
sun.java2d.cmm
;
import
java.awt.color.ProfileDataException
;
import
java.util.Vector
;
...
...
@@ -39,7 +40,7 @@ import java.util.Vector;
public
class
ProfileDeferralMgr
{
public
static
boolean
deferring
=
true
;
private
static
Vector
aVector
;
private
static
Vector
<
ProfileActivator
>
aVector
;
/**
* Records a ProfileActivator object whose activate method will
...
...
@@ -51,7 +52,7 @@ public class ProfileDeferralMgr {
return
;
}
if
(
aVector
==
null
)
{
aVector
=
new
Vector
(
3
,
3
);
aVector
=
new
Vector
<
ProfileActivator
>
(
3
,
3
);
}
aVector
.
addElement
(
pa
);
return
;
...
...
@@ -89,8 +90,26 @@ public class ProfileDeferralMgr {
return
;
}
n
=
aVector
.
size
();
for
(
i
=
0
;
i
<
n
;
i
++)
{
((
ProfileActivator
)
aVector
.
get
(
i
)).
activate
();
for
(
ProfileActivator
pa
:
aVector
)
{
try
{
pa
.
activate
();
}
catch
(
ProfileDataException
e
)
{
/*
* Ignore profile activation error for now:
* such exception is pssible due to absence
* or corruption of standard color profile.
* As for now we expect all profiles should
* be shiped with jre and presence of this
* exception is indication of some configuration
* problem in jre installation.
*
* NB: we still are greedy loading deferred profiles
* and load them all if any of them is needed.
* Therefore broken profile (if any) might be never used.
* If there will be attempt to use broken profile then
* it will result in CMMException.
*/
}
}
aVector
.
removeAllElements
();
aVector
=
null
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录