Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
44b0a4d2
T
Third Party Harfbuzz
项目概览
OpenHarmony
/
Third Party Harfbuzz
1 年多 前同步成功
通知
0
Star
18
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Third Party Harfbuzz
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
44b0a4d2
编写于
5月 05, 2011
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Replace fixed-size feature_infos array with hb_array_t
上级
b214ec3a
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
22 addition
and
8 deletion
+22
-8
src/hb-ot-map-private.hh
src/hb-ot-map-private.hh
+5
-4
src/hb-ot-map.cc
src/hb-ot-map.cc
+5
-4
src/hb-private.hh
src/hb-private.hh
+12
-0
未找到文件。
src/hb-ot-map-private.hh
浏览文件 @
44b0a4d2
...
...
@@ -36,7 +36,6 @@
HB_BEGIN_DECLS
#define MAX_FEATURES 100
/* FIXME */
#define MAX_LOOKUPS 1000
/* FIXME */
static
const
hb_tag_t
table_tags
[
2
]
=
{
HB_OT_TAG_GSUB
,
HB_OT_TAG_GPOS
};
...
...
@@ -87,9 +86,10 @@ struct hb_ot_map_t {
void
add_feature
(
hb_tag_t
tag
,
unsigned
int
value
,
bool
global
)
{
feature_info_t
*
info
=
&
feature_infos
[
feature_count
++
];
feature_info_t
*
info
=
feature_infos
.
push
();
if
(
unlikely
(
!
info
))
return
;
info
->
tag
=
tag
;
info
->
seq
=
feature_
count
;
info
->
seq
=
feature_
infos
.
len
;
info
->
max_value
=
value
;
info
->
global
=
global
;
info
->
default_value
=
global
?
value
:
0
;
...
...
@@ -129,7 +129,8 @@ struct hb_ot_map_t {
hb_mask_t
global_mask
;
unsigned
int
feature_count
;
feature_info_t
feature_infos
[
MAX_FEATURES
];
/* used before compile() only */
hb_prealloced_array_t
<
feature_info_t
,
16
>
feature_infos
;
/* used before compile() only */
#define MAX_FEATURES 100
feature_map_t
feature_maps
[
MAX_FEATURES
];
lookup_map_t
lookup_maps
[
2
][
MAX_LOOKUPS
];
/* GSUB/GPOS */
...
...
src/hb-ot-map.cc
浏览文件 @
44b0a4d2
...
...
@@ -66,7 +66,7 @@ hb_ot_map_t::compile (hb_face_t *face,
global_mask
=
1
;
lookup_count
[
0
]
=
lookup_count
[
1
]
=
0
;
if
(
!
feature_
count
)
if
(
!
feature_
infos
.
len
)
return
;
...
...
@@ -88,9 +88,9 @@ hb_ot_map_t::compile (hb_face_t *face,
/* Sort features and merge duplicates */
qsort
(
feature_infos
,
feature_count
,
sizeof
(
feature_infos
[
0
]),
(
hb_compare_func_t
)
feature_info_t
::
cmp
);
feature_infos
.
sort
(
);
unsigned
int
j
=
0
;
for
(
unsigned
int
i
=
1
;
i
<
feature_
count
;
i
++
)
for
(
unsigned
int
i
=
1
;
i
<
feature_
infos
.
len
;
i
++
)
if
(
feature_infos
[
i
].
tag
!=
feature_infos
[
j
].
tag
)
feature_infos
[
++
j
]
=
feature_infos
[
i
];
else
{
...
...
@@ -102,10 +102,11 @@ hb_ot_map_t::compile (hb_face_t *face,
/* Inherit default_value from j */
}
}
feature_
count
=
j
+
1
;
feature_
infos
.
shrink
(
j
+
1
)
;
/* Allocate bits now */
feature_count
=
feature_infos
.
len
;
unsigned
int
next_bit
=
1
;
j
=
0
;
for
(
unsigned
int
i
=
0
;
i
<
feature_count
;
i
++
)
{
...
...
src/hb-private.hh
浏览文件 @
44b0a4d2
...
...
@@ -277,6 +277,18 @@ struct hb_prealloced_array_t {
len
--
;
/* TODO: shrink array if needed */
}
inline
void
shrink
(
unsigned
int
l
)
{
if
(
l
<
len
)
len
=
l
;
/* TODO: shrink array if needed */
}
inline
void
sort
(
void
)
{
qsort
(
array
,
len
,
sizeof
(
Type
),
(
hb_compare_func_t
)
Type
::
cmp
);
}
};
template
<
typename
Type
>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录