Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
f755e87f
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看板
提交
f755e87f
编写于
3月 03, 2011
作者:
C
ceisserer
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
7023589: Xrender : NullPointerException in sun.font.XRGlyphCache.freeGlyphs running Java 2D demo
Reviewed-by: prr
上级
d4aed30b
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
24 addition
and
21 deletion
+24
-21
src/share/classes/sun/font/StrikeCache.java
src/share/classes/sun/font/StrikeCache.java
+6
-4
src/solaris/classes/sun/font/XRGlyphCache.java
src/solaris/classes/sun/font/XRGlyphCache.java
+18
-17
未找到文件。
src/share/classes/sun/font/StrikeCache.java
浏览文件 @
f755e87f
...
...
@@ -319,8 +319,7 @@ public final class StrikeCache {
ArrayList
<
Long
>
gids
=
null
;
for
(
int
i
=
0
;
i
<
glyphPtrs
.
length
;
i
++)
{
if
(
glyphPtrs
[
i
]
!=
0
&&
unsafe
.
getByte
(
glyphPtrs
[
i
]
+
managedOffset
)
==
0
&&
unsafe
.
getInt
(
glyphPtrs
[
i
]
+
cacheCellOffset
)
!=
0
)
{
if
(
glyphPtrs
[
i
]
!=
0
&&
unsafe
.
getByte
(
glyphPtrs
[
i
]
+
managedOffset
)
==
0
)
{
if
(
gids
==
null
)
{
gids
=
new
ArrayList
<
Long
>();
...
...
@@ -330,6 +329,8 @@ public final class StrikeCache {
}
if
(
gids
!=
null
)
{
// Any reference by the disposers to the native glyph ptrs
// must be done before this returns.
notifyDisposeListeners
(
gids
);
}
}
...
...
@@ -345,8 +346,7 @@ public final class StrikeCache {
for
(
int
i
=
0
;
i
<
glyphPtrs
.
length
;
i
++)
{
if
(
glyphPtrs
[
i
]
!=
0
&&
unsafe
.
getByte
(
glyphPtrs
[
i
]
+
managedOffset
)
==
0
&&
unsafe
.
getInt
(
glyphPtrs
[
i
]
+
cacheCellOffset
)
!=
0
)
{
&&
unsafe
.
getByte
(
glyphPtrs
[
i
]
+
managedOffset
)
==
0
)
{
if
(
gids
==
null
)
{
gids
=
new
ArrayList
<
Long
>();
...
...
@@ -356,6 +356,8 @@ public final class StrikeCache {
}
if
(
gids
!=
null
)
{
// Any reference by the disposers to the native glyph ptrs
// must be done before this returns.
notifyDisposeListeners
(
gids
);
}
}
...
...
src/solaris/classes/sun/font/XRGlyphCache.java
浏览文件 @
f755e87f
...
...
@@ -70,9 +70,14 @@ public class XRGlyphCache implements GlyphDisposedListener {
try
{
SunToolkit
.
awtLock
();
ArrayList
<
Integer
>
glyphIDList
=
new
ArrayList
<
Integer
>(
glyphPtrList
.
size
());
GrowableIntArray
glyphIDList
=
new
GrowableIntArray
(
1
,
glyphPtrList
.
size
());
for
(
long
glyphPtr
:
glyphPtrList
)
{
glyphIDList
.
add
(
XRGlyphCacheEntry
.
getGlyphID
(
glyphPtr
));
int
glyphID
=
XRGlyphCacheEntry
.
getGlyphID
(
glyphPtr
);
//Check if glyph hasn't been freed already
if
(
glyphID
!=
0
)
{
glyphIDList
.
addInt
(
glyphID
);
}
}
freeGlyphs
(
glyphIDList
);
}
finally
{
...
...
@@ -83,7 +88,6 @@ public class XRGlyphCache implements GlyphDisposedListener {
protected
int
getFreeGlyphID
()
{
if
(
freeGlyphIDs
.
size
()
>
0
)
{
int
newID
=
freeGlyphIDs
.
remove
(
freeGlyphIDs
.
size
()
-
1
);
;
return
newID
;
}
return
nextID
++;
...
...
@@ -246,7 +250,7 @@ public class XRGlyphCache implements GlyphDisposedListener {
glyph
.
setPinned
();
}
ArrayList
<
Integer
>
deleteGlyphList
=
new
ArrayList
<
Integer
>(
);
GrowableIntArray
deleteGlyphList
=
new
GrowableIntArray
(
1
,
10
);
int
pixelsToRelease
=
cachedPixels
-
MAX_CACHED_PIXELS
;
for
(
int
i
=
cacheList
.
size
()
-
1
;
i
>=
0
&&
pixelsToRelease
>
0
;
i
--)
{
...
...
@@ -254,7 +258,7 @@ public class XRGlyphCache implements GlyphDisposedListener {
if
(!
entry
.
isPinned
())
{
pixelsToRelease
-=
entry
.
getPixelCnt
();
deleteGlyphList
.
add
(
new
Integer
(
entry
.
getGlyphID
()
));
deleteGlyphList
.
add
Int
(
entry
.
getGlyphID
(
));
}
}
...
...
@@ -265,26 +269,23 @@ public class XRGlyphCache implements GlyphDisposedListener {
freeGlyphs
(
deleteGlyphList
);
}
private
void
freeGlyphs
(
List
<
Integer
>
glyphIdList
)
{
private
void
freeGlyphs
(
GrowableIntArray
glyphIdList
)
{
GrowableIntArray
removedLCDGlyphs
=
new
GrowableIntArray
(
1
,
10
);
GrowableIntArray
removedGrayscaleGlyphs
=
new
GrowableIntArray
(
1
,
10
);
freeGlyphIDs
.
addAll
(
glyphIdList
);
for
(
int
i
=
0
;
i
<
glyphIdList
.
getSize
();
i
++)
{
int
glyphId
=
glyphIdList
.
getInt
(
i
);
freeGlyphIDs
.
add
(
glyphId
);
GrowableIntArray
removedLCDGlyphs
=
new
GrowableIntArray
(
1
,
1
);
GrowableIntArray
removedGrayscaleGlyphs
=
new
GrowableIntArray
(
1
,
1
);
for
(
Integer
glyphId
:
glyphIdList
)
{
tmp
.
setValue
(
glyphId
.
intValue
());
tmp
.
setValue
(
glyphId
);
XRGlyphCacheEntry
entry
=
cacheMap
.
get
(
tmp
);
cachedPixels
-=
entry
.
getPixelCnt
();
int
removedGlyphID
=
entry
.
getGlyphID
();
tmp
.
setValue
(
removedGlyphID
);
cacheMap
.
remove
(
tmp
);
if
(
entry
.
getGlyphSet
()
==
grayGlyphSet
)
{
removedGrayscaleGlyphs
.
addInt
(
removedGlyphID
);
removedGrayscaleGlyphs
.
addInt
(
glyphId
);
}
else
{
removedLCDGlyphs
.
addInt
(
removedGlyphID
);
removedLCDGlyphs
.
addInt
(
glyphId
);
}
entry
.
setGlyphID
(
0
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录