Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
65ac2dae
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看板
提交
65ac2dae
编写于
6月 20, 2014
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[indic-table] Speed up lookup
上级
64442a3f
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
59 addition
and
24 deletion
+59
-24
src/gen-indic-table.py
src/gen-indic-table.py
+17
-5
src/hb-ot-shape-complex-indic-table.cc
src/hb-ot-shape-complex-indic-table.cc
+42
-19
未找到文件。
src/gen-indic-table.py
浏览文件 @
65ac2dae
...
...
@@ -194,11 +194,23 @@ print
print
"INDIC_TABLE_ELEMENT_TYPE"
print
"hb_indic_get_categories (hb_codepoint_t u)"
print
"{"
for
(
start
,
end
)
in
zip
(
starts
,
ends
):
offset
=
"indic_offset_0x%04x"
%
start
print
" if (0x%04X <= u && u <= 0x%04X) return indic_table[u - 0x%04X + %s];"
%
(
start
,
end
,
start
,
offset
)
for
u
,
d
in
singles
.
items
():
print
" if (unlikely (u == 0x%04X)) return _(%s,%s);"
%
(
u
,
short
[
0
][
d
[
0
]],
short
[
1
][
d
[
1
]])
print
" switch (u >> 12)"
print
" {"
pages
=
set
([
u
>>
12
for
u
in
starts
+
ends
+
singles
.
keys
()])
for
p
in
pages
:
print
" case 0x%0X:"
%
p
for
(
start
,
end
)
in
zip
(
starts
,
ends
):
if
p
not
in
[
start
>>
12
,
end
>>
12
]:
continue
offset
=
"indic_offset_0x%04x"
%
start
print
" if (0x%04X <= u && u <= 0x%04X) return indic_table[u - 0x%04X + %s];"
%
(
start
,
end
,
start
,
offset
)
for
u
,
d
in
singles
.
items
():
if
p
!=
u
>>
12
:
continue
print
" if (unlikely (u == 0x%04X)) return _(%s,%s);"
%
(
u
,
short
[
0
][
d
[
0
]],
short
[
1
][
d
[
1
]])
print
" break;"
print
""
print
" default:"
print
" break;"
print
" }"
print
" return _(x,x);"
print
"}"
print
...
...
src/hb-ot-shape-complex-indic-table.cc
浏览文件 @
65ac2dae
...
...
@@ -732,25 +732,48 @@ static const INDIC_TABLE_ELEMENT_TYPE indic_table[] = {
INDIC_TABLE_ELEMENT_TYPE
hb_indic_get_categories
(
hb_codepoint_t
u
)
{
if
(
0x0900
<=
u
&&
u
<=
0x0EE0
)
return
indic_table
[
u
-
0x0900
+
indic_offset_0x0900
];
if
(
0x0F40
<=
u
&&
u
<=
0x0FC0
)
return
indic_table
[
u
-
0x0F40
+
indic_offset_0x0f40
];
if
(
0x1000
<=
u
&&
u
<=
0x10A0
)
return
indic_table
[
u
-
0x1000
+
indic_offset_0x1000
];
if
(
0x1700
<=
u
&&
u
<=
0x17E0
)
return
indic_table
[
u
-
0x1700
+
indic_offset_0x1700
];
if
(
0x1900
<=
u
&&
u
<=
0x1A80
)
return
indic_table
[
u
-
0x1900
+
indic_offset_0x1900
];
if
(
0x1B00
<=
u
&&
u
<=
0x1C50
)
return
indic_table
[
u
-
0x1B00
+
indic_offset_0x1b00
];
if
(
0x1CF0
<=
u
&&
u
<=
0x1CF8
)
return
indic_table
[
u
-
0x1CF0
+
indic_offset_0x1cf0
];
if
(
0xA800
<=
u
&&
u
<=
0xA8C8
)
return
indic_table
[
u
-
0xA800
+
indic_offset_0xa800
];
if
(
0xA908
<=
u
&&
u
<=
0xA9C8
)
return
indic_table
[
u
-
0xA908
+
indic_offset_0xa908
];
if
(
0xAA00
<=
u
&&
u
<=
0xAAF8
)
return
indic_table
[
u
-
0xAA00
+
indic_offset_0xaa00
];
if
(
0xABC0
<=
u
&&
u
<=
0xABF0
)
return
indic_table
[
u
-
0xABC0
+
indic_offset_0xabc0
];
if
(
0x10A00
<=
u
&&
u
<=
0x10A40
)
return
indic_table
[
u
-
0x10A00
+
indic_offset_0x10a00
];
if
(
0x11000
<=
u
&&
u
<=
0x11048
)
return
indic_table
[
u
-
0x11000
+
indic_offset_0x11000
];
if
(
0x11080
<=
u
&&
u
<=
0x110C0
)
return
indic_table
[
u
-
0x11080
+
indic_offset_0x11080
];
if
(
0x11100
<=
u
&&
u
<=
0x11138
)
return
indic_table
[
u
-
0x11100
+
indic_offset_0x11100
];
if
(
0x11180
<=
u
&&
u
<=
0x111C8
)
return
indic_table
[
u
-
0x11180
+
indic_offset_0x11180
];
if
(
0x11680
<=
u
&&
u
<=
0x116B8
)
return
indic_table
[
u
-
0x11680
+
indic_offset_0x11680
];
if
(
unlikely
(
u
==
0x00A0
))
return
_
(
CP
,
x
);
if
(
unlikely
(
u
==
0x25CC
))
return
_
(
CP
,
x
);
switch
(
u
>>
12
)
{
case
0x0
:
if
(
0x0900
<=
u
&&
u
<=
0x0EE0
)
return
indic_table
[
u
-
0x0900
+
indic_offset_0x0900
];
if
(
0x0F40
<=
u
&&
u
<=
0x0FC0
)
return
indic_table
[
u
-
0x0F40
+
indic_offset_0x0f40
];
if
(
unlikely
(
u
==
0x00A0
))
return
_
(
CP
,
x
);
break
;
case
0x1
:
if
(
0x1000
<=
u
&&
u
<=
0x10A0
)
return
indic_table
[
u
-
0x1000
+
indic_offset_0x1000
];
if
(
0x1700
<=
u
&&
u
<=
0x17E0
)
return
indic_table
[
u
-
0x1700
+
indic_offset_0x1700
];
if
(
0x1900
<=
u
&&
u
<=
0x1A80
)
return
indic_table
[
u
-
0x1900
+
indic_offset_0x1900
];
if
(
0x1B00
<=
u
&&
u
<=
0x1C50
)
return
indic_table
[
u
-
0x1B00
+
indic_offset_0x1b00
];
if
(
0x1CF0
<=
u
&&
u
<=
0x1CF8
)
return
indic_table
[
u
-
0x1CF0
+
indic_offset_0x1cf0
];
break
;
case
0x2
:
if
(
unlikely
(
u
==
0x25CC
))
return
_
(
CP
,
x
);
break
;
case
0xA
:
if
(
0xA800
<=
u
&&
u
<=
0xA8C8
)
return
indic_table
[
u
-
0xA800
+
indic_offset_0xa800
];
if
(
0xA908
<=
u
&&
u
<=
0xA9C8
)
return
indic_table
[
u
-
0xA908
+
indic_offset_0xa908
];
if
(
0xAA00
<=
u
&&
u
<=
0xAAF8
)
return
indic_table
[
u
-
0xAA00
+
indic_offset_0xaa00
];
if
(
0xABC0
<=
u
&&
u
<=
0xABF0
)
return
indic_table
[
u
-
0xABC0
+
indic_offset_0xabc0
];
break
;
case
0x10
:
if
(
0x10A00
<=
u
&&
u
<=
0x10A40
)
return
indic_table
[
u
-
0x10A00
+
indic_offset_0x10a00
];
break
;
case
0x11
:
if
(
0x11000
<=
u
&&
u
<=
0x11048
)
return
indic_table
[
u
-
0x11000
+
indic_offset_0x11000
];
if
(
0x11080
<=
u
&&
u
<=
0x110C0
)
return
indic_table
[
u
-
0x11080
+
indic_offset_0x11080
];
if
(
0x11100
<=
u
&&
u
<=
0x11138
)
return
indic_table
[
u
-
0x11100
+
indic_offset_0x11100
];
if
(
0x11180
<=
u
&&
u
<=
0x111C8
)
return
indic_table
[
u
-
0x11180
+
indic_offset_0x11180
];
if
(
0x11680
<=
u
&&
u
<=
0x116B8
)
return
indic_table
[
u
-
0x11680
+
indic_offset_0x11680
];
break
;
default:
break
;
}
return
_
(
x
,
x
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录