Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
a043c99f
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
a043c99f
编写于
5月 04, 2016
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[unsafe-to-break] Simplify logic
Always use the algorithm for non-monotone case. It's more robust.
上级
40bd7e9a
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
13 addition
and
44 deletion
+13
-44
src/hb-buffer.cc
src/hb-buffer.cc
+13
-44
未找到文件。
src/hb-buffer.cc
浏览文件 @
a043c99f
...
...
@@ -637,31 +637,17 @@ done:
skip_glyph
();
}
static
inline
void
unsafe_to_break_two_infos
(
hb_glyph_info_t
&
info1
,
hb_glyph_info_t
&
info2
)
{
if
(
info1
.
cluster
==
info2
.
cluster
)
return
;
hb_glyph_info_t
&
unsafe
=
info1
.
cluster
>
info2
.
cluster
?
info1
:
info2
;
unsafe
.
mask
|=
HB_GLYPH_FLAG_UNSAFE_TO_BREAK
;
}
static
void
unsafe_to_break_infos_monotone
(
hb_glyph_info_t
*
info
,
unsigned
int
start
,
unsigned
int
end
)
{
for
(
unsigned
int
i
=
start
+
1
;
i
<
end
;
i
++
)
unsafe_to_break_two_infos
(
info
[
i
-
1
],
info
[
i
]);
}
static
unsigned
int
infos_min_cluster
(
const
hb_glyph_info_t
*
info
,
unsigned
int
start
,
unsigned
int
end
,
unsigned
int
cluster
)
static
int
unsafe_to_break_find_min
(
const
hb_glyph_info_t
*
info
,
unsigned
int
start
,
unsigned
int
end
,
unsigned
int
cluster
)
{
for
(
unsigned
int
i
=
start
;
i
<
end
;
i
++
)
cluster
=
MIN
(
cluster
,
info
[
i
].
cluster
);
return
cluster
;
}
static
void
infos_unsafe_to_break_cluster
(
hb_glyph_info_t
*
info
,
unsigned
int
start
,
unsigned
int
end
,
unsigned
int
cluster
)
unsafe_to_break_set_mask
(
hb_glyph_info_t
*
info
,
unsigned
int
start
,
unsigned
int
end
,
unsigned
int
cluster
)
{
for
(
unsigned
int
i
=
start
;
i
<
end
;
i
++
)
if
(
cluster
!=
info
[
i
].
cluster
)
...
...
@@ -670,16 +656,9 @@ infos_unsafe_to_break_cluster (hb_glyph_info_t *info, unsigned int start, unsign
void
hb_buffer_t
::
unsafe_to_break_impl
(
unsigned
int
start
,
unsigned
int
end
)
{
if
(
cluster_level
==
HB_BUFFER_CLUSTER_LEVEL_CHARACTERS
)
{
unsigned
int
cluster
=
(
unsigned
int
)
-
1
;
cluster
=
infos_min_cluster
(
info
,
start
,
end
,
cluster
);
infos_unsafe_to_break_cluster
(
info
,
start
,
end
,
cluster
);
return
;
}
/* The case of monotone clusters can be done faster. */
unsafe_to_break_infos_monotone
(
info
,
start
,
end
);
unsigned
int
cluster
=
(
unsigned
int
)
-
1
;
cluster
=
unsafe_to_break_find_min
(
info
,
start
,
end
,
cluster
);
unsafe_to_break_set_mask
(
info
,
start
,
end
,
cluster
);
}
void
hb_buffer_t
::
unsafe_to_break_from_outbuffer
(
unsigned
int
start
,
unsigned
int
end
)
...
...
@@ -687,21 +666,11 @@ hb_buffer_t::unsafe_to_break_from_outbuffer (unsigned int start, unsigned int en
assert
(
start
<=
out_len
);
assert
(
idx
<=
end
);
if
(
cluster_level
==
HB_BUFFER_CLUSTER_LEVEL_CHARACTERS
)
{
unsigned
int
cluster
=
(
unsigned
int
)
-
1
;
cluster
=
infos_min_cluster
(
out_info
,
start
,
out_len
,
cluster
);
cluster
=
infos_min_cluster
(
info
,
idx
,
end
,
cluster
);
infos_unsafe_to_break_cluster
(
out_info
,
start
,
out_len
,
cluster
);
infos_unsafe_to_break_cluster
(
info
,
idx
,
end
,
cluster
);
return
;
}
/* The case of monotone clusters can be done faster. */
unsafe_to_break_infos_monotone
(
out_info
,
start
,
out_len
);
if
(
start
<
out_len
&&
idx
<
end
)
unsafe_to_break_two_infos
(
out_info
[
out_len
-
1
],
info
[
idx
]);
unsafe_to_break_infos_monotone
(
info
,
idx
,
end
);
unsigned
int
cluster
=
(
unsigned
int
)
-
1
;
cluster
=
unsafe_to_break_find_min
(
out_info
,
start
,
out_len
,
cluster
);
cluster
=
unsafe_to_break_find_min
(
info
,
idx
,
end
,
cluster
);
unsafe_to_break_set_mask
(
out_info
,
start
,
out_len
,
cluster
);
unsafe_to_break_set_mask
(
info
,
idx
,
end
,
cluster
);
}
void
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录