Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
2f327679
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看板
提交
2f327679
编写于
5月 15, 2019
作者:
P
prr
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8222690: Better Glyph Images
Reviewed-by: serb, psadhukhan, mschoene, rhalade
上级
8cfbc003
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
48 addition
and
5 deletion
+48
-5
src/share/classes/sun/font/GlyphList.java
src/share/classes/sun/font/GlyphList.java
+14
-0
src/share/native/sun/font/DrawGlyphList.c
src/share/native/sun/font/DrawGlyphList.c
+18
-0
src/share/native/sun/font/freetypeScaler.c
src/share/native/sun/font/freetypeScaler.c
+5
-4
src/solaris/classes/sun/font/XRGlyphCache.java
src/solaris/classes/sun/font/XRGlyphCache.java
+3
-0
src/solaris/classes/sun/font/XRTextRenderer.java
src/solaris/classes/sun/font/XRTextRenderer.java
+3
-0
src/solaris/native/sun/java2d/x11/X11FontScaler_md.c
src/solaris/native/sun/java2d/x11/X11FontScaler_md.c
+5
-1
未找到文件。
src/share/classes/sun/font/GlyphList.java
浏览文件 @
2f327679
...
@@ -323,6 +323,14 @@ public final class GlyphList {
...
@@ -323,6 +323,14 @@ public final class GlyphList {
*/
*/
public
void
setGlyphIndex
(
int
i
)
{
public
void
setGlyphIndex
(
int
i
)
{
glyphindex
=
i
;
glyphindex
=
i
;
if
(
images
[
i
]
==
0L
)
{
metrics
[
0
]
=
(
int
)
gposx
;
metrics
[
1
]
=
(
int
)
gposy
;
metrics
[
2
]
=
0
;
metrics
[
3
]
=
0
;
metrics
[
4
]
=
0
;
return
;
}
float
gx
=
float
gx
=
StrikeCache
.
unsafe
.
getFloat
(
images
[
i
]+
StrikeCache
.
topLeftXOffset
);
StrikeCache
.
unsafe
.
getFloat
(
images
[
i
]+
StrikeCache
.
topLeftXOffset
);
float
gy
=
float
gy
=
...
@@ -361,6 +369,9 @@ public final class GlyphList {
...
@@ -361,6 +369,9 @@ public final class GlyphList {
graybits
=
new
byte
[
len
];
graybits
=
new
byte
[
len
];
}
}
}
}
if
(
images
[
glyphindex
]
==
0L
)
{
return
graybits
;
}
long
pixelDataAddress
=
long
pixelDataAddress
=
StrikeCache
.
unsafe
.
getAddress
(
images
[
glyphindex
]
+
StrikeCache
.
unsafe
.
getAddress
(
images
[
glyphindex
]
+
StrikeCache
.
pixelDataOffset
);
StrikeCache
.
pixelDataOffset
);
...
@@ -468,6 +479,9 @@ public final class GlyphList {
...
@@ -468,6 +479,9 @@ public final class GlyphList {
char
gw
,
gh
;
char
gw
,
gh
;
float
gx
,
gy
,
gx0
,
gy0
,
gx1
,
gy1
;
float
gx
,
gy
,
gx0
,
gy0
,
gx1
,
gy1
;
for
(
int
i
=
0
;
i
<
len
;
i
++)
{
for
(
int
i
=
0
;
i
<
len
;
i
++)
{
if
(
images
[
i
]
==
0L
)
{
continue
;
}
gx
=
StrikeCache
.
unsafe
.
getFloat
(
images
[
i
]+
xOffset
);
gx
=
StrikeCache
.
unsafe
.
getFloat
(
images
[
i
]+
xOffset
);
gy
=
StrikeCache
.
unsafe
.
getFloat
(
images
[
i
]+
yOffset
);
gy
=
StrikeCache
.
unsafe
.
getFloat
(
images
[
i
]+
yOffset
);
gw
=
StrikeCache
.
unsafe
.
getChar
(
images
[
i
]+
wOffset
);
gw
=
StrikeCache
.
unsafe
.
getChar
(
images
[
i
]+
wOffset
);
...
...
src/share/native/sun/font/DrawGlyphList.c
浏览文件 @
2f327679
...
@@ -532,6 +532,12 @@ GlyphBlitVector* setupLCDBlitVector(JNIEnv *env, jobject glyphlist) {
...
@@ -532,6 +532,12 @@ GlyphBlitVector* setupLCDBlitVector(JNIEnv *env, jobject glyphlist) {
*/
*/
if
(
subPixPos
&&
len
>
0
)
{
if
(
subPixPos
&&
len
>
0
)
{
ginfo
=
(
GlyphInfo
*
)
imagePtrs
[
0
];
ginfo
=
(
GlyphInfo
*
)
imagePtrs
[
0
];
if
(
ginfo
==
NULL
)
{
(
*
env
)
->
ReleasePrimitiveArrayCritical
(
env
,
glyphImages
,
imagePtrs
,
JNI_ABORT
);
free
(
gbv
);
return
(
GlyphBlitVector
*
)
NULL
;
}
/* rowBytes==width tests if its a B&W or LCD glyph */
/* rowBytes==width tests if its a B&W or LCD glyph */
if
(
ginfo
->
width
==
ginfo
->
rowBytes
)
{
if
(
ginfo
->
width
==
ginfo
->
rowBytes
)
{
subPixPos
=
JNI_FALSE
;
subPixPos
=
JNI_FALSE
;
...
@@ -561,6 +567,12 @@ GlyphBlitVector* setupLCDBlitVector(JNIEnv *env, jobject glyphlist) {
...
@@ -561,6 +567,12 @@ GlyphBlitVector* setupLCDBlitVector(JNIEnv *env, jobject glyphlist) {
jfloat
px
,
py
;
jfloat
px
,
py
;
ginfo
=
(
GlyphInfo
*
)
imagePtrs
[
g
];
ginfo
=
(
GlyphInfo
*
)
imagePtrs
[
g
];
if
(
ginfo
==
NULL
)
{
(
*
env
)
->
ReleasePrimitiveArrayCritical
(
env
,
glyphImages
,
imagePtrs
,
JNI_ABORT
);
free
(
gbv
);
return
(
GlyphBlitVector
*
)
NULL
;
}
gbv
->
glyphs
[
g
].
glyphInfo
=
ginfo
;
gbv
->
glyphs
[
g
].
glyphInfo
=
ginfo
;
gbv
->
glyphs
[
g
].
pixels
=
ginfo
->
image
;
gbv
->
glyphs
[
g
].
pixels
=
ginfo
->
image
;
gbv
->
glyphs
[
g
].
width
=
ginfo
->
width
;
gbv
->
glyphs
[
g
].
width
=
ginfo
->
width
;
...
@@ -636,6 +648,12 @@ GlyphBlitVector* setupLCDBlitVector(JNIEnv *env, jobject glyphlist) {
...
@@ -636,6 +648,12 @@ GlyphBlitVector* setupLCDBlitVector(JNIEnv *env, jobject glyphlist) {
}
else
{
}
else
{
for
(
g
=
0
;
g
<
len
;
g
++
)
{
for
(
g
=
0
;
g
<
len
;
g
++
)
{
ginfo
=
(
GlyphInfo
*
)
imagePtrs
[
g
];
ginfo
=
(
GlyphInfo
*
)
imagePtrs
[
g
];
if
(
ginfo
==
NULL
)
{
(
*
env
)
->
ReleasePrimitiveArrayCritical
(
env
,
glyphImages
,
imagePtrs
,
JNI_ABORT
);
free
(
gbv
);
return
(
GlyphBlitVector
*
)
NULL
;
}
gbv
->
glyphs
[
g
].
glyphInfo
=
ginfo
;
gbv
->
glyphs
[
g
].
glyphInfo
=
ginfo
;
gbv
->
glyphs
[
g
].
pixels
=
ginfo
->
image
;
gbv
->
glyphs
[
g
].
pixels
=
ginfo
->
image
;
gbv
->
glyphs
[
g
].
width
=
ginfo
->
width
;
gbv
->
glyphs
[
g
].
width
=
ginfo
->
width
;
...
...
src/share/native/sun/font/freetypeScaler.c
浏览文件 @
2f327679
...
@@ -622,16 +622,17 @@ Java_sun_font_FreetypeFontScaler_getGlyphAdvanceNative(
...
@@ -622,16 +622,17 @@ Java_sun_font_FreetypeFontScaler_getGlyphAdvanceNative(
to avoid unnecesary work with bitmaps. */
to avoid unnecesary work with bitmaps. */
GlyphInfo
*
info
;
GlyphInfo
*
info
;
jfloat
advance
;
jfloat
advance
=
0
.
0
f
;
jlong
image
;
jlong
image
;
image
=
Java_sun_font_FreetypeFontScaler_getGlyphImageNative
(
image
=
Java_sun_font_FreetypeFontScaler_getGlyphImageNative
(
env
,
scaler
,
font2D
,
pScalerContext
,
pScaler
,
glyphCode
);
env
,
scaler
,
font2D
,
pScalerContext
,
pScaler
,
glyphCode
);
info
=
(
GlyphInfo
*
)
jlong_to_ptr
(
image
);
info
=
(
GlyphInfo
*
)
jlong_to_ptr
(
image
);
advance
=
info
->
advanceX
;
if
(
info
!=
NULL
)
{
advance
=
info
->
advanceX
;
free
(
info
);
free
(
info
);
}
return
advance
;
return
advance
;
}
}
...
...
src/solaris/classes/sun/font/XRGlyphCache.java
浏览文件 @
2f327679
...
@@ -114,6 +114,9 @@ public class XRGlyphCache implements GlyphDisposedListener {
...
@@ -114,6 +114,9 @@ public class XRGlyphCache implements GlyphDisposedListener {
for
(
int
i
=
0
;
i
<
glyphList
.
getNumGlyphs
();
i
++)
{
for
(
int
i
=
0
;
i
<
glyphList
.
getNumGlyphs
();
i
++)
{
XRGlyphCacheEntry
glyph
;
XRGlyphCacheEntry
glyph
;
if
(
imgPtrs
[
i
]
==
0L
)
{
continue
;
}
// Find uncached glyphs and queue them for upload
// Find uncached glyphs and queue them for upload
if
((
glyph
=
getEntryForPointer
(
imgPtrs
[
i
]))
==
null
)
{
if
((
glyph
=
getEntryForPointer
(
imgPtrs
[
i
]))
==
null
)
{
glyph
=
new
XRGlyphCacheEntry
(
imgPtrs
[
i
],
glyphList
);
glyph
=
new
XRGlyphCacheEntry
(
imgPtrs
[
i
],
glyphList
);
...
...
src/solaris/classes/sun/font/XRTextRenderer.java
浏览文件 @
2f327679
...
@@ -88,6 +88,9 @@ public class XRTextRenderer extends GlyphListPipe {
...
@@ -88,6 +88,9 @@ public class XRTextRenderer extends GlyphListPipe {
for
(
int
i
=
0
;
i
<
gl
.
getNumGlyphs
();
i
++)
{
for
(
int
i
=
0
;
i
<
gl
.
getNumGlyphs
();
i
++)
{
gl
.
setGlyphIndex
(
i
);
gl
.
setGlyphIndex
(
i
);
XRGlyphCacheEntry
cacheEntry
=
cachedGlyphs
[
i
];
XRGlyphCacheEntry
cacheEntry
=
cachedGlyphs
[
i
];
if
(
cacheEntry
==
null
)
{
continue
;
}
eltList
.
getGlyphs
().
addInt
(
cacheEntry
.
getGlyphID
());
eltList
.
getGlyphs
().
addInt
(
cacheEntry
.
getGlyphID
());
int
glyphSet
=
cacheEntry
.
getGlyphSet
();
int
glyphSet
=
cacheEntry
.
getGlyphSet
();
...
...
src/solaris/native/sun/java2d/x11/X11FontScaler_md.c
浏览文件 @
2f327679
...
@@ -273,6 +273,7 @@ JNIEXPORT jlong JNICALL AWTFontGenerateImage(AWTFont pFont, AWTChar2b* xChar) {
...
@@ -273,6 +273,7 @@ JNIEXPORT jlong JNICALL AWTFontGenerateImage(AWTFont pFont, AWTChar2b* xChar) {
unsigned
int
imageSize
;
unsigned
int
imageSize
;
JNIEnv
*
env
;
JNIEnv
*
env
;
FONT_AWT_LOCK
();
FONT_AWT_LOCK
();
/* XTextExtents16(xFont, xChar, 1, &direction, &ascent, &descent, &xcs); */
/* XTextExtents16(xFont, xChar, 1, &direction, &ascent, &descent, &xcs); */
XQueryTextExtents16
(
awt_display
,
xFont
->
fid
,
xChar
,
1
,
XQueryTextExtents16
(
awt_display
,
xFont
->
fid
,
xChar
,
1
,
...
@@ -280,8 +281,11 @@ JNIEXPORT jlong JNICALL AWTFontGenerateImage(AWTFont pFont, AWTChar2b* xChar) {
...
@@ -280,8 +281,11 @@ JNIEXPORT jlong JNICALL AWTFontGenerateImage(AWTFont pFont, AWTChar2b* xChar) {
width
=
xcs
.
rbearing
-
xcs
.
lbearing
;
width
=
xcs
.
rbearing
-
xcs
.
lbearing
;
height
=
xcs
.
ascent
+
xcs
.
descent
;
height
=
xcs
.
ascent
+
xcs
.
descent
;
imageSize
=
width
*
height
;
imageSize
=
width
*
height
;
glyphInfo
=
(
GlyphInfo
*
)
malloc
(
sizeof
(
GlyphInfo
)
+
imageSize
);
glyphInfo
=
(
GlyphInfo
*
)
malloc
(
sizeof
(
GlyphInfo
)
+
imageSize
);
if
(
glyphInfo
==
NULL
)
{
AWT_UNLOCK
();
return
(
jlong
)(
uintptr_t
)
NULL
;
}
glyphInfo
->
cellInfo
=
NULL
;
glyphInfo
->
cellInfo
=
NULL
;
glyphInfo
->
width
=
width
;
glyphInfo
->
width
=
width
;
glyphInfo
->
height
=
height
;
glyphInfo
->
height
=
height
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录