Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
8100f9f7
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看板
提交
8100f9f7
编写于
3月 31, 2014
作者:
P
prr
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8029008: [Parfait] warnings from b116 for jdk.src.share.native.sun.font: JNI exceptions pending
Reviewed-by: jgodinez, serb
上级
3d417773
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
99 addition
and
121 deletion
+99
-121
src/share/native/sun/font/FontInstanceAdapter.cpp
src/share/native/sun/font/FontInstanceAdapter.cpp
+6
-0
src/share/native/sun/font/layout/SunLayoutEngine.cpp
src/share/native/sun/font/layout/SunLayoutEngine.cpp
+9
-44
src/share/native/sun/font/sunFont.c
src/share/native/sun/font/sunFont.c
+84
-77
未找到文件。
src/share/native/sun/font/FontInstanceAdapter.cpp
浏览文件 @
8100f9f7
...
...
@@ -222,10 +222,16 @@ void FontInstanceAdapter::getKerningAdjustment(LEPoint &adjustment) const
jobject
pt
=
env
->
NewObject
(
sunFontIDs
.
pt2DFloatClass
,
sunFontIDs
.
pt2DFloatCtr
,
adjustment
.
fX
,
adjustment
.
fY
);
if
(
pt
==
NULL
)
{
env
->
ExceptionClear
();
adjustment
.
fX
=
0.0
f
;
adjustment
.
fY
=
0.0
f
;
}
else
{
env
->
CallObjectMethod
(
fontStrike
,
sunFontIDs
.
adjustPointMID
,
pt
);
adjustment
.
fX
=
env
->
GetFloatField
(
pt
,
sunFontIDs
.
xFID
);
adjustment
.
fY
=
env
->
GetFloatField
(
pt
,
sunFontIDs
.
yFID
);
}
}
void
FontInstanceAdapter
::
getWideGlyphAdvance
(
le_uint32
glyph
,
LEPoint
&
advance
)
const
{
...
...
src/share/native/sun/font/layout/SunLayoutEngine.cpp
浏览文件 @
8100f9f7
...
...
@@ -56,50 +56,13 @@ static jfieldID gvdIndicesFID = 0;
JNIEXPORT
void
JNICALL
Java_sun_font_SunLayoutEngine_initGVIDs
(
JNIEnv
*
env
,
jclass
cls
)
{
gvdClass
=
env
->
FindClass
(
gvdClassName
);
if
(
!
gvdClass
)
{
JNU_ThrowClassNotFoundException
(
env
,
gvdClassName
);
return
;
}
gvdClass
=
(
jclass
)
env
->
NewGlobalRef
(
gvdClass
);
if
(
!
gvdClass
)
{
JNU_ThrowInternalError
(
env
,
"could not create global ref"
);
return
;
}
gvdCountFID
=
env
->
GetFieldID
(
gvdClass
,
"_count"
,
"I"
);
if
(
!
gvdCountFID
)
{
gvdClass
=
0
;
JNU_ThrowNoSuchFieldException
(
env
,
"_count"
);
return
;
}
gvdFlagsFID
=
env
->
GetFieldID
(
gvdClass
,
"_flags"
,
"I"
);
if
(
!
gvdFlagsFID
)
{
gvdClass
=
0
;
JNU_ThrowNoSuchFieldException
(
env
,
"_flags"
);
return
;
}
gvdGlyphsFID
=
env
->
GetFieldID
(
gvdClass
,
"_glyphs"
,
"[I"
);
if
(
!
gvdGlyphsFID
)
{
gvdClass
=
0
;
JNU_ThrowNoSuchFieldException
(
env
,
"_glyphs"
);
return
;
}
gvdPositionsFID
=
env
->
GetFieldID
(
gvdClass
,
"_positions"
,
"[F"
);
if
(
!
gvdPositionsFID
)
{
gvdClass
=
0
;
JNU_ThrowNoSuchFieldException
(
env
,
"_positions"
);
return
;
}
CHECK_NULL
(
gvdClass
=
env
->
FindClass
(
gvdClassName
));
CHECK_NULL
(
gvdClass
=
(
jclass
)
env
->
NewGlobalRef
(
gvdClass
));
CHECK_NULL
(
gvdCountFID
=
env
->
GetFieldID
(
gvdClass
,
"_count"
,
"I"
));
CHECK_NULL
(
gvdFlagsFID
=
env
->
GetFieldID
(
gvdClass
,
"_flags"
,
"I"
));
CHECK_NULL
(
gvdGlyphsFID
=
env
->
GetFieldID
(
gvdClass
,
"_glyphs"
,
"[I"
));
CHECK_NULL
(
gvdPositionsFID
=
env
->
GetFieldID
(
gvdClass
,
"_positions"
,
"[F"
));
gvdIndicesFID
=
env
->
GetFieldID
(
gvdClass
,
"_indices"
,
"[I"
);
if
(
!
gvdIndicesFID
)
{
gvdClass
=
0
;
JNU_ThrowNoSuchFieldException
(
env
,
"_indices"
);
return
;
}
}
int
putGV
(
JNIEnv
*
env
,
jint
gmask
,
jint
baseIndex
,
jobject
gvdata
,
const
LayoutEngine
*
engine
,
int
glyphCount
)
{
...
...
@@ -195,7 +158,7 @@ JNIEXPORT void JNICALL Java_sun_font_SunLayoutEngine_nativeLayout
jchar
*
chars
=
buffer
;
if
(
len
>
256
)
{
size_t
size
=
len
*
sizeof
(
jchar
);
if
(
size
/
sizeof
(
jchar
)
!=
len
)
{
if
(
size
/
sizeof
(
jchar
)
!=
(
size_t
)
len
)
{
return
;
}
chars
=
(
jchar
*
)
malloc
(
size
);
...
...
@@ -220,10 +183,12 @@ JNIEXPORT void JNICALL Java_sun_font_SunLayoutEngine_nativeLayout
env
->
SetIntField
(
gvdata
,
gvdCountFID
,
-
1
);
// flag failure
}
else
{
if
(
putGV
(
env
,
gmask
,
baseIndex
,
gvdata
,
engine
,
glyphCount
))
{
if
(
!
(
env
->
ExceptionCheck
()))
{
// !!! hmmm, could use current value in positions array of GVData...
putFloat
(
env
,
pt
,
x
,
y
);
}
}
}
if
(
chars
!=
buffer
)
{
free
(
chars
);
...
...
src/share/native/sun/font/sunFont.c
浏览文件 @
8100f9f7
...
...
@@ -27,6 +27,7 @@
#include "string.h"
#include "gdefs.h"
#include "jlong.h"
#include "jni_util.h"
#include "sunfontids.h"
#include "fontscalerdefs.h"
#include "sun_font_SunFontManager.h"
...
...
@@ -81,100 +82,106 @@ static void initFontIDs(JNIEnv *env) {
if
(
initialisedFontIDs
)
{
return
;
}
tmpClass
=
(
*
env
)
->
FindClass
(
env
,
"sun/font/TrueTypeFont"
);
sunFontIDs
.
ttReadBlockMID
=
CHECK_NULL
(
tmpClass
=
(
*
env
)
->
FindClass
(
env
,
"sun/font/TrueTypeFont"
)
);
CHECK_NULL
(
sunFontIDs
.
ttReadBlockMID
=
(
*
env
)
->
GetMethodID
(
env
,
tmpClass
,
"readBlock"
,
"(Ljava/nio/ByteBuffer;II)I"
);
sunFontIDs
.
ttReadBytesMID
=
(
*
env
)
->
GetMethodID
(
env
,
tmpClass
,
"readBytes"
,
"(II)[B"
);
"(Ljava/nio/ByteBuffer;II)I"
)
)
;
CHECK_NULL
(
sunFontIDs
.
ttReadBytesMID
=
(
*
env
)
->
GetMethodID
(
env
,
tmpClass
,
"readBytes"
,
"(II)[B"
)
)
;
tmpClass
=
(
*
env
)
->
FindClass
(
env
,
"sun/font/Type1Font"
);
sunFontIDs
.
readFileMID
=
CHECK_NULL
(
tmpClass
=
(
*
env
)
->
FindClass
(
env
,
"sun/font/Type1Font"
)
);
CHECK_NULL
(
sunFontIDs
.
readFileMID
=
(
*
env
)
->
GetMethodID
(
env
,
tmpClass
,
"readFile"
,
"(Ljava/nio/ByteBuffer;)V"
);
"readFile"
,
"(Ljava/nio/ByteBuffer;)V"
)
)
;
tmpClass
=
(
*
env
)
->
FindClass
(
env
,
"java/awt/geom/Point2D$Float"
);
CHECK_NULL
(
tmpClass
=
(
*
env
)
->
FindClass
(
env
,
"java/awt/geom/Point2D$Float"
));
sunFontIDs
.
pt2DFloatClass
=
(
jclass
)(
*
env
)
->
NewGlobalRef
(
env
,
tmpClass
);
sunFontIDs
.
pt2DFloatCtr
=
(
*
env
)
->
GetMethodID
(
env
,
sunFontIDs
.
pt2DFloatClass
,
"<init>"
,
"(FF)V"
);
CHECK_NULL
(
sunFontIDs
.
pt2DFloatCtr
=
(
*
env
)
->
GetMethodID
(
env
,
sunFontIDs
.
pt2DFloatClass
,
"<init>"
,
"(FF)V"
)
)
;
sunFontIDs
.
xFID
=
(
*
env
)
->
GetFieldID
(
env
,
sunFontIDs
.
pt2DFloatClass
,
"x"
,
"F"
);
sunFontIDs
.
yFID
=
(
*
env
)
->
GetFieldID
(
env
,
sunFontIDs
.
pt2DFloatClass
,
"y"
,
"F"
);
CHECK_NULL
(
sunFontIDs
.
xFID
=
(
*
env
)
->
GetFieldID
(
env
,
sunFontIDs
.
pt2DFloatClass
,
"x"
,
"F"
)
)
;
CHECK_NULL
(
sunFontIDs
.
yFID
=
(
*
env
)
->
GetFieldID
(
env
,
sunFontIDs
.
pt2DFloatClass
,
"y"
,
"F"
)
)
;
tmpClass
=
(
*
env
)
->
FindClass
(
env
,
"sun/font/StrikeMetrics"
);
sunFontIDs
.
strikeMetricsClass
=
(
jclass
)(
*
env
)
->
NewGlobalRef
(
env
,
tmpClass
);
CHECK_NULL
(
tmpClass
=
(
*
env
)
->
FindClass
(
env
,
"sun/font/StrikeMetrics"
));
CHECK_NULL
(
sunFontIDs
.
strikeMetricsClass
=
(
jclass
)(
*
env
)
->
NewGlobalRef
(
env
,
tmpClass
));
sunFontIDs
.
strikeMetricsCtr
=
CHECK_NULL
(
sunFontIDs
.
strikeMetricsCtr
=
(
*
env
)
->
GetMethodID
(
env
,
sunFontIDs
.
strikeMetricsClass
,
"<init>"
,
"(FFFFFFFFFF)V"
);
"<init>"
,
"(FFFFFFFFFF)V"
)
)
;
tmpClass
=
(
*
env
)
->
FindClass
(
env
,
"java/awt/geom/Rectangle2D$Float"
);
CHECK_NULL
(
tmpClass
=
(
*
env
)
->
FindClass
(
env
,
"java/awt/geom/Rectangle2D$Float"
));
sunFontIDs
.
rect2DFloatClass
=
(
jclass
)(
*
env
)
->
NewGlobalRef
(
env
,
tmpClass
);
sunFontIDs
.
rect2DFloatCtr
=
(
*
env
)
->
GetMethodID
(
env
,
sunFontIDs
.
rect2DFloatClass
,
"<init>"
,
"()V"
);
sunFontIDs
.
rect2DFloatCtr4
=
CHECK_NULL
(
sunFontIDs
.
rect2DFloatCtr
=
(
*
env
)
->
GetMethodID
(
env
,
sunFontIDs
.
rect2DFloatClass
,
"<init>"
,
"()V"
)
);
CHECK_NULL
(
sunFontIDs
.
rect2DFloatCtr4
=
(
*
env
)
->
GetMethodID
(
env
,
sunFontIDs
.
rect2DFloatClass
,
"<init>"
,
"(FFFF)V"
);
sunFontIDs
.
rectF2DX
=
(
*
env
)
->
GetFieldID
(
env
,
sunFontIDs
.
rect2DFloatClass
,
"x"
,
"F"
);
sunFontIDs
.
rectF2DY
=
(
*
env
)
->
GetFieldID
(
env
,
sunFontIDs
.
rect2DFloatClass
,
"y"
,
"F"
);
sunFontIDs
.
rectF2DWidth
=
(
*
env
)
->
GetFieldID
(
env
,
sunFontIDs
.
rect2DFloatClass
,
"width"
,
"F"
);
sunFontIDs
.
rectF2DHeight
=
(
*
env
)
->
GetFieldID
(
env
,
sunFontIDs
.
rect2DFloatClass
,
"height"
,
"F"
);
tmpClass
=
(
*
env
)
->
FindClass
(
env
,
"java/awt/geom/GeneralPath"
);
"<init>"
,
"(FFFF)V"
)
);
CHECK_NULL
(
sunFontIDs
.
rectF2DX
=
(
*
env
)
->
GetFieldID
(
env
,
sunFontIDs
.
rect2DFloatClass
,
"x"
,
"F"
)
)
;
CHECK_NULL
(
sunFontIDs
.
rectF2DY
=
(
*
env
)
->
GetFieldID
(
env
,
sunFontIDs
.
rect2DFloatClass
,
"y"
,
"F"
)
)
;
CHECK_NULL
(
sunFontIDs
.
rectF2DWidth
=
(
*
env
)
->
GetFieldID
(
env
,
sunFontIDs
.
rect2DFloatClass
,
"width"
,
"F"
)
)
;
CHECK_NULL
(
sunFontIDs
.
rectF2DHeight
=
(
*
env
)
->
GetFieldID
(
env
,
sunFontIDs
.
rect2DFloatClass
,
"height"
,
"F"
)
)
;
CHECK_NULL
(
tmpClass
=
(
*
env
)
->
FindClass
(
env
,
"java/awt/geom/GeneralPath"
)
);
sunFontIDs
.
gpClass
=
(
jclass
)(
*
env
)
->
NewGlobalRef
(
env
,
tmpClass
);
sunFontIDs
.
gpCtr
=
(
*
env
)
->
GetMethodID
(
env
,
sunFontIDs
.
gpClass
,
"<init>"
,
"(I[BI[FI)V"
);
sunFontIDs
.
gpCtrEmpty
=
(
*
env
)
->
GetMethodID
(
env
,
sunFontIDs
.
gpClass
,
"<init>"
,
"()V"
);
tmpClass
=
(
*
env
)
->
FindClass
(
env
,
"sun/font/Font2D"
);
sunFontIDs
.
f2dCharToGlyphMID
=
(
*
env
)
->
GetMethodID
(
env
,
tmpClass
,
"charToGlyph"
,
"(I)I"
);
sunFontIDs
.
getMapperMID
=
CHECK_NULL
(
sunFontIDs
.
gpCtr
=
(
*
env
)
->
GetMethodID
(
env
,
sunFontIDs
.
gpClass
,
"<init>"
,
"(I[BI[FI)V"
)
);
CHECK_NULL
(
sunFontIDs
.
gpCtrEmpty
=
(
*
env
)
->
GetMethodID
(
env
,
sunFontIDs
.
gpClass
,
"<init>"
,
"()V"
)
);
CHECK_NULL
(
tmpClass
=
(
*
env
)
->
FindClass
(
env
,
"sun/font/Font2D"
)
);
CHECK_NULL
(
sunFontIDs
.
f2dCharToGlyphMID
=
(
*
env
)
->
GetMethodID
(
env
,
tmpClass
,
"charToGlyph"
,
"(I)I"
)
)
;
CHECK_NULL
(
sunFontIDs
.
getMapperMID
=
(
*
env
)
->
GetMethodID
(
env
,
tmpClass
,
"getMapper"
,
"()Lsun/font/CharToGlyphMapper;"
);
sunFontIDs
.
getTableBytesMID
=
(
*
env
)
->
GetMethodID
(
env
,
tmpClass
,
"getTableBytes"
,
"(I)[B"
);
sunFontIDs
.
canDisplayMID
=
(
*
env
)
->
GetMethodID
(
env
,
tmpClass
,
"canDisplay"
,
"(C)Z"
);
tmpClass
=
(
*
env
)
->
FindClass
(
env
,
"sun/font/CharToGlyphMapper"
);
sunFontIDs
.
charToGlyphMID
=
(
*
env
)
->
GetMethodID
(
env
,
tmpClass
,
"charToGlyph"
,
"(I)I"
);
tmpClass
=
(
*
env
)
->
FindClass
(
env
,
"sun/font/PhysicalStrike"
);
sunFontIDs
.
getGlyphMetricsMID
=
"()Lsun/font/CharToGlyphMapper;"
)
)
;
CHECK_NULL
(
sunFontIDs
.
getTableBytesMID
=
(
*
env
)
->
GetMethodID
(
env
,
tmpClass
,
"getTableBytes"
,
"(I)[B"
)
)
;
CHECK_NULL
(
sunFontIDs
.
canDisplayMID
=
(
*
env
)
->
GetMethodID
(
env
,
tmpClass
,
"canDisplay"
,
"(C)Z"
)
)
;
CHECK_NULL
(
tmpClass
=
(
*
env
)
->
FindClass
(
env
,
"sun/font/CharToGlyphMapper"
)
);
CHECK_NULL
(
sunFontIDs
.
charToGlyphMID
=
(
*
env
)
->
GetMethodID
(
env
,
tmpClass
,
"charToGlyph"
,
"(I)I"
)
)
;
CHECK_NULL
(
tmpClass
=
(
*
env
)
->
FindClass
(
env
,
"sun/font/PhysicalStrike"
)
);
CHECK_NULL
(
sunFontIDs
.
getGlyphMetricsMID
=
(
*
env
)
->
GetMethodID
(
env
,
tmpClass
,
"getGlyphMetrics"
,
"(I)Ljava/awt/geom/Point2D$Float;"
);
sunFontIDs
.
getGlyphPointMID
=
"(I)Ljava/awt/geom/Point2D$Float;"
)
)
;
CHECK_NULL
(
sunFontIDs
.
getGlyphPointMID
=
(
*
env
)
->
GetMethodID
(
env
,
tmpClass
,
"getGlyphPoint"
,
"(II)Ljava/awt/geom/Point2D$Float;"
);
sunFontIDs
.
adjustPointMID
=
"(II)Ljava/awt/geom/Point2D$Float;"
)
)
;
CHECK_NULL
(
sunFontIDs
.
adjustPointMID
=
(
*
env
)
->
GetMethodID
(
env
,
tmpClass
,
"adjustPoint"
,
"(Ljava/awt/geom/Point2D$Float;)V"
);
sunFontIDs
.
pScalerContextFID
=
(
*
env
)
->
GetFieldID
(
env
,
tmpClass
,
"pScalerContext"
,
"J"
);
tmpClass
=
(
*
env
)
->
FindClass
(
env
,
"sun/font/GlyphList"
);
sunFontIDs
.
glyphListX
=
(
*
env
)
->
GetFieldID
(
env
,
tmpClass
,
"x"
,
"F"
);
sunFontIDs
.
glyphListY
=
(
*
env
)
->
GetFieldID
(
env
,
tmpClass
,
"y"
,
"F"
);
sunFontIDs
.
glyphListLen
=
(
*
env
)
->
GetFieldID
(
env
,
tmpClass
,
"len"
,
"I"
);
sunFontIDs
.
glyphImages
=
(
*
env
)
->
GetFieldID
(
env
,
tmpClass
,
"images"
,
"[J"
);
sunFontIDs
.
glyphListUsePos
=
(
*
env
)
->
GetFieldID
(
env
,
tmpClass
,
"usePositions"
,
"Z"
);
sunFontIDs
.
glyphListPos
=
(
*
env
)
->
GetFieldID
(
env
,
tmpClass
,
"positions"
,
"[F"
);
sunFontIDs
.
lcdRGBOrder
=
(
*
env
)
->
GetFieldID
(
env
,
tmpClass
,
"lcdRGBOrder"
,
"Z"
);
sunFontIDs
.
lcdSubPixPos
=
(
*
env
)
->
GetFieldID
(
env
,
tmpClass
,
"lcdSubPixPos"
,
"Z"
);
"(Ljava/awt/geom/Point2D$Float;)V"
));
CHECK_NULL
(
sunFontIDs
.
pScalerContextFID
=
(
*
env
)
->
GetFieldID
(
env
,
tmpClass
,
"pScalerContext"
,
"J"
));
CHECK_NULL
(
tmpClass
=
(
*
env
)
->
FindClass
(
env
,
"sun/font/GlyphList"
));
CHECK_NULL
(
sunFontIDs
.
glyphListX
=
(
*
env
)
->
GetFieldID
(
env
,
tmpClass
,
"x"
,
"F"
));
CHECK_NULL
(
sunFontIDs
.
glyphListY
=
(
*
env
)
->
GetFieldID
(
env
,
tmpClass
,
"y"
,
"F"
));
CHECK_NULL
(
sunFontIDs
.
glyphListLen
=
(
*
env
)
->
GetFieldID
(
env
,
tmpClass
,
"len"
,
"I"
));
CHECK_NULL
(
sunFontIDs
.
glyphImages
=
(
*
env
)
->
GetFieldID
(
env
,
tmpClass
,
"images"
,
"[J"
));
CHECK_NULL
(
sunFontIDs
.
glyphListUsePos
=
(
*
env
)
->
GetFieldID
(
env
,
tmpClass
,
"usePositions"
,
"Z"
));
CHECK_NULL
(
sunFontIDs
.
glyphListPos
=
(
*
env
)
->
GetFieldID
(
env
,
tmpClass
,
"positions"
,
"[F"
));
CHECK_NULL
(
sunFontIDs
.
lcdRGBOrder
=
(
*
env
)
->
GetFieldID
(
env
,
tmpClass
,
"lcdRGBOrder"
,
"Z"
));
CHECK_NULL
(
sunFontIDs
.
lcdSubPixPos
=
(
*
env
)
->
GetFieldID
(
env
,
tmpClass
,
"lcdSubPixPos"
,
"Z"
));
initLCDGammaTables
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录