Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
265ac614
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看板
提交
265ac614
编写于
5月 05, 2011
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Replace fixed-size lookup_maps array with hb_array_t
上级
6843569d
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
32 addition
and
34 deletion
+32
-34
src/hb-ot-map-private.hh
src/hb-ot-map-private.hh
+5
-8
src/hb-ot-map.cc
src/hb-ot-map.cc
+25
-22
src/hb-private.hh
src/hb-private.hh
+2
-4
未找到文件。
src/hb-ot-map-private.hh
浏览文件 @
265ac614
...
...
@@ -36,8 +36,6 @@
HB_BEGIN_DECLS
#define MAX_LOOKUPS 1000
/* FIXME */
static
const
hb_tag_t
table_tags
[
2
]
=
{
HB_OT_TAG_GSUB
,
HB_OT_TAG_GPOS
};
struct
hb_ot_map_t
{
...
...
@@ -113,12 +111,12 @@ struct hb_ot_map_t {
}
inline
void
substitute
(
hb_face_t
*
face
,
hb_buffer_t
*
buffer
)
const
{
for
(
unsigned
int
i
=
0
;
i
<
lookup_
count
[
0
]
;
i
++
)
for
(
unsigned
int
i
=
0
;
i
<
lookup_
maps
[
0
].
len
;
i
++
)
hb_ot_layout_substitute_lookup
(
face
,
buffer
,
lookup_maps
[
0
][
i
].
index
,
lookup_maps
[
0
][
i
].
mask
);
}
inline
void
position
(
hb_font_t
*
font
,
hb_face_t
*
face
,
hb_buffer_t
*
buffer
)
const
{
for
(
unsigned
int
i
=
0
;
i
<
lookup_
count
[
1
]
;
i
++
)
for
(
unsigned
int
i
=
0
;
i
<
lookup_
maps
[
1
].
len
;
i
++
)
hb_ot_layout_position_lookup
(
font
,
buffer
,
lookup_maps
[
1
][
i
].
index
,
lookup_maps
[
1
][
i
].
mask
);
}
...
...
@@ -126,11 +124,10 @@ struct hb_ot_map_t {
hb_mask_t
global_mask
;
hb_prealloced_array_t
<
feature_info_t
,
16
>
feature_infos
;
/* used before compile() only */
hb_prealloced_array_t
<
feature_map_t
,
16
>
feature_maps
;
hb_prealloced_array_t
<
feature_info_t
,
8
>
feature_infos
;
/* used before compile() only */
hb_prealloced_array_t
<
feature_map_t
,
8
>
feature_maps
;
lookup_map_t
lookup_maps
[
2
][
MAX_LOOKUPS
];
/* GSUB/GPOS */
unsigned
int
lookup_count
[
2
];
hb_prealloced_array_t
<
lookup_map_t
,
32
>
lookup_maps
[
2
];
/* GSUB/GPOS */
};
...
...
src/hb-ot-map.cc
浏览文件 @
265ac614
...
...
@@ -39,23 +39,28 @@ hb_ot_map_t::add_lookups (hb_face_t *face,
unsigned
int
feature_index
,
hb_mask_t
mask
)
{
unsigned
int
i
=
MAX_LOOKUPS
-
lookup_count
[
table_index
];
lookup_map_t
*
lookups
=
lookup_maps
[
table_index
]
+
lookup_count
[
table_index
];
unsigned
int
*
lookup_indices
=
(
unsigned
int
*
)
lookups
;
hb_ot_layout_feature_get_lookup_indexes
(
face
,
table_tags
[
table_index
],
feature_index
,
0
,
&
i
,
lookup_indices
);
lookup_count
[
table_index
]
+=
i
;
unsigned
int
lookup_indices
[
32
];
unsigned
int
offset
,
len
;
offset
=
0
;
do
{
len
=
ARRAY_LENGTH
(
lookup_indices
);
hb_ot_layout_feature_get_lookup_indexes
(
face
,
table_tags
[
table_index
],
feature_index
,
offset
,
&
len
,
lookup_indices
);
for
(
unsigned
int
i
=
0
;
i
<
len
;
i
++
)
{
lookup_map_t
*
lookup
=
lookup_maps
[
table_index
].
push
();
if
(
unlikely
(
!
lookup
))
return
;
lookup
->
mask
=
mask
;
lookup
->
index
=
lookup_indices
[
i
];
}
while
(
i
--
)
{
lookups
[
i
].
mask
=
mask
;
lookups
[
i
].
index
=
lookup_indices
[
i
];
}
offset
+=
len
;
}
while
(
len
==
ARRAY_LENGTH
(
lookup_indices
));
}
...
...
@@ -64,7 +69,6 @@ hb_ot_map_t::compile (hb_face_t *face,
const
hb_segment_properties_t
*
props
)
{
global_mask
=
1
;
lookup_count
[
0
]
=
lookup_count
[
1
]
=
0
;
if
(
!
feature_infos
.
len
)
return
;
...
...
@@ -176,17 +180,16 @@ hb_ot_map_t::compile (hb_face_t *face,
add_lookups
(
face
,
table_index
,
feature_maps
[
i
].
index
[
table_index
],
feature_maps
[
i
].
mask
);
/* Sort lookups and merge duplicates */
qsort
(
lookup_maps
[
table_index
],
lookup_count
[
table_index
],
sizeof
(
lookup_maps
[
table_index
][
0
]),
(
hb_compare_func_t
)
lookup_map_t
::
cmp
);
if
(
lookup_
count
[
table_index
]
)
lookup_maps
[
table_index
].
sort
(
);
if
(
lookup_
maps
[
table_index
].
len
)
{
unsigned
int
j
=
0
;
for
(
unsigned
int
i
=
1
;
i
<
lookup_
count
[
table_index
]
;
i
++
)
for
(
unsigned
int
i
=
1
;
i
<
lookup_
maps
[
table_index
].
len
;
i
++
)
if
(
lookup_maps
[
table_index
][
i
].
index
!=
lookup_maps
[
table_index
][
j
].
index
)
lookup_maps
[
table_index
][
++
j
]
=
lookup_maps
[
table_index
][
i
];
else
lookup_maps
[
table_index
][
j
].
mask
|=
lookup_maps
[
table_index
][
i
].
mask
;
j
++
;
lookup_count
[
table_index
]
=
j
;
lookup_maps
[
table_index
].
shrink
(
j
+
1
);
}
}
}
...
...
src/hb-private.hh
浏览文件 @
265ac614
...
...
@@ -235,10 +235,8 @@ struct hb_prealloced_array_t {
Type
*
array
;
Type
static_array
[
StaticSize
];
inline
Type
&
operator
[]
(
unsigned
int
i
)
{
return
array
[
i
];
}
inline
Type
&
operator
[]
(
unsigned
int
i
)
{
return
array
[
i
];
}
inline
const
Type
&
operator
[]
(
unsigned
int
i
)
const
{
return
array
[
i
];
}
inline
Type
*
push
(
void
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录