Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
45186b9b
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看板
提交
45186b9b
编写于
6月 05, 2018
作者:
G
Garret Rieger
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[subset] Add memoization of GSUB lookup closures.
上级
78d92e0f
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
37 addition
and
4 deletion
+37
-4
src/hb-ot-layout-gsub-table.hh
src/hb-ot-layout-gsub-table.hh
+13
-2
src/hb-ot-layout-gsubgpos-private.hh
src/hb-ot-layout-gsubgpos-private.hh
+20
-0
src/hb-ot-layout.cc
src/hb-ot-layout.cc
+4
-2
未找到文件。
src/hb-ot-layout-gsub-table.hh
浏览文件 @
45186b9b
...
...
@@ -1156,10 +1156,13 @@ struct SubstLookup : Lookup
return_trace
(
dispatch
(
c
));
}
inline
hb_closure_context_t
::
return_t
closure
(
hb_closure_context_t
*
c
)
const
inline
hb_closure_context_t
::
return_t
closure
(
hb_closure_context_t
*
c
,
unsigned
int
this_index
)
const
{
TRACE_CLOSURE
(
this
);
c
->
set_recurse_func
(
dispatch_recurse_func
<
hb_closure_context_t
>
);
if
(
!
c
->
start_lookup
(
this_index
))
return_trace
(
HB_VOID
);
c
->
set_recurse_func
(
dispatch_closure_recurse_func
);
return_trace
(
dispatch
(
c
));
}
...
...
@@ -1258,6 +1261,14 @@ struct SubstLookup : Lookup
template
<
typename
context_t
>
static
inline
typename
context_t
::
return_t
dispatch_recurse_func
(
context_t
*
c
,
unsigned
int
lookup_index
);
static
inline
hb_closure_context_t
::
return_t
dispatch_closure_recurse_func
(
hb_closure_context_t
*
c
,
unsigned
int
lookup_index
)
{
if
(
!
c
->
start_lookup
(
lookup_index
))
return
HB_VOID
;
return
dispatch_recurse_func
(
c
,
lookup_index
);
}
template
<
typename
context_t
>
inline
typename
context_t
::
return_t
dispatch
(
context_t
*
c
)
const
{
return
Lookup
::
dispatch
<
SubstLookupSubTable
>
(
c
);
}
...
...
src/hb-ot-layout-gsubgpos-private.hh
浏览文件 @
45186b9b
...
...
@@ -32,6 +32,7 @@
#include "hb-private.hh"
#include "hb-debug.hh"
#include "hb-buffer-private.hh"
#include "hb-map-private.hh"
#include "hb-ot-layout-gdef-table.hh"
#include "hb-set-private.hh"
...
...
@@ -59,6 +60,20 @@ struct hb_closure_context_t :
return
HB_VOID
;
}
bool
start_lookup
(
unsigned
int
lookup_index
)
{
if
(
is_lookup_done
(
lookup_index
))
return
false
;
done_lookups
->
set
(
lookup_index
,
glyphs
->
get_population
());
return
true
;
}
bool
is_lookup_done
(
unsigned
int
lookup_index
)
{
// Have we visited this lookup with the current set of glyphs?
return
done_lookups
->
get
(
lookup_index
)
==
glyphs
->
get_population
();
}
hb_face_t
*
face
;
hb_set_t
*
glyphs
;
recurse_func_t
recurse_func
;
...
...
@@ -67,14 +82,19 @@ struct hb_closure_context_t :
hb_closure_context_t
(
hb_face_t
*
face_
,
hb_set_t
*
glyphs_
,
hb_map_t
*
done_lookups_
,
unsigned
int
nesting_level_left_
=
HB_MAX_NESTING_LEVEL
)
:
face
(
face_
),
glyphs
(
glyphs_
),
done_lookups
(
done_lookups_
),
recurse_func
(
nullptr
),
nesting_level_left
(
nesting_level_left_
),
debug_depth
(
0
)
{}
void
set_recurse_func
(
recurse_func_t
func
)
{
recurse_func
=
func
;
}
private:
hb_map_t
*
done_lookups
;
};
...
...
src/hb-ot-layout.cc
浏览文件 @
45186b9b
...
...
@@ -44,6 +44,7 @@
#include "hb-ot-color-sbix-table.hh"
#include "hb-ot-color-svg-table.hh"
#include "hb-ot-name-table.hh"
#include "hb-map-private.hh"
hb_ot_layout_t
*
...
...
@@ -943,11 +944,12 @@ hb_ot_layout_lookup_substitute_closure (hb_face_t *face,
unsigned
int
lookup_index
,
hb_set_t
*
glyphs
)
{
OT
::
hb_closure_context_t
c
(
face
,
glyphs
);
hb_auto_t
<
hb_map_t
>
done_lookups
;
OT
::
hb_closure_context_t
c
(
face
,
glyphs
,
&
done_lookups
);
const
OT
::
SubstLookup
&
l
=
_get_gsub
(
face
).
get_lookup
(
lookup_index
);
l
.
closure
(
&
c
);
l
.
closure
(
&
c
,
lookup_index
);
}
/*
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录