Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
ac350c92
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看板
提交
ac350c92
编写于
5月 05, 2019
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[dispatch] Try obj.dispatch(c) before trying c->dispatch(obj)
上级
0d5fd168
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
24 addition
and
11 deletion
+24
-11
src/hb-aat-layout-common.hh
src/hb-aat-layout-common.hh
+1
-1
src/hb-dispatch.hh
src/hb-dispatch.hh
+13
-0
src/hb-ot-layout-gsubgpos.hh
src/hb-ot-layout-gsubgpos.hh
+7
-7
src/hb-sanitize.hh
src/hb-sanitize.hh
+1
-1
src/hb-subset.hh
src/hb-subset.hh
+2
-2
未找到文件。
src/hb-aat-layout-common.hh
浏览文件 @
ac350c92
...
...
@@ -807,7 +807,7 @@ struct hb_aat_apply_context_t :
{
const
char
*
get_name
()
{
return
"APPLY"
;
}
template
<
typename
T
>
return_t
dispatch
(
const
T
&
obj
)
{
return
obj
.
apply
(
this
);
}
return_t
_
dispatch
(
const
T
&
obj
)
{
return
obj
.
apply
(
this
);
}
static
return_t
default_return_value
()
{
return
false
;
}
bool
stop_sublookup_iteration
(
return_t
r
)
const
{
return
r
;
}
...
...
src/hb-dispatch.hh
浏览文件 @
ac350c92
...
...
@@ -38,12 +38,25 @@
template
<
typename
Context
,
typename
Return
,
unsigned
int
MaxDebugDepth
>
struct
hb_dispatch_context_t
{
private:
/* https://en.wikipedia.org/wiki/Curiously_recurring_template_pattern */
const
Context
*
thiz
()
const
{
return
static_cast
<
const
Context
*>
(
this
);
}
Context
*
thiz
()
{
return
static_cast
<
Context
*>
(
this
);
}
public:
static
constexpr
unsigned
max_debug_depth
=
MaxDebugDepth
;
typedef
Return
return_t
;
template
<
typename
T
,
typename
F
>
bool
may_dispatch
(
const
T
*
obj
HB_UNUSED
,
const
F
*
format
HB_UNUSED
)
{
return
true
;
}
template
<
typename
T
>
return_t
dispatch
(
const
T
&
obj
)
{
return
_dispatch_impl
(
obj
,
hb_prioritize
);
}
static
return_t
no_dispatch_return_value
()
{
return
Context
::
default_return_value
();
}
static
bool
stop_sublookup_iteration
(
const
return_t
r
HB_UNUSED
)
{
return
false
;
}
private:
template
<
typename
T
>
auto
_dispatch_impl
(
const
T
&
obj
,
hb_priority
<
1
>
)
HB_AUTO_RETURN
(
obj
.
dispatch
(
thiz
()))
template
<
typename
T
>
Return
_dispatch_impl
(
const
T
&
obj
,
hb_priority
<
0
>
)
{
return
thiz
()
->
_dispatch
(
obj
);
}
};
...
...
src/hb-ot-layout-gsubgpos.hh
浏览文件 @
ac350c92
...
...
@@ -46,7 +46,7 @@ struct hb_intersects_context_t :
{
const
char
*
get_name
()
{
return
"INTERSECTS"
;
}
template
<
typename
T
>
return_t
dispatch
(
const
T
&
obj
)
{
return
obj
.
intersects
(
this
->
glyphs
);
}
return_t
_
dispatch
(
const
T
&
obj
)
{
return
obj
.
intersects
(
this
->
glyphs
);
}
static
return_t
default_return_value
()
{
return
false
;
}
bool
stop_sublookup_iteration
(
return_t
r
)
const
{
return
r
;
}
...
...
@@ -64,7 +64,7 @@ struct hb_closure_context_t :
const
char
*
get_name
()
{
return
"CLOSURE"
;
}
typedef
return_t
(
*
recurse_func_t
)
(
hb_closure_context_t
*
c
,
unsigned
int
lookup_index
);
template
<
typename
T
>
return_t
dispatch
(
const
T
&
obj
)
{
obj
.
closure
(
this
);
return
hb_void_t
();
}
return_t
_
dispatch
(
const
T
&
obj
)
{
obj
.
closure
(
this
);
return
hb_void_t
();
}
static
return_t
default_return_value
()
{
return
hb_void_t
();
}
void
recurse
(
unsigned
int
lookup_index
)
{
...
...
@@ -128,7 +128,7 @@ struct hb_would_apply_context_t :
{
const
char
*
get_name
()
{
return
"WOULD_APPLY"
;
}
template
<
typename
T
>
return_t
dispatch
(
const
T
&
obj
)
{
return
obj
.
would_apply
(
this
);
}
return_t
_
dispatch
(
const
T
&
obj
)
{
return
obj
.
would_apply
(
this
);
}
static
return_t
default_return_value
()
{
return
false
;
}
bool
stop_sublookup_iteration
(
return_t
r
)
const
{
return
r
;
}
...
...
@@ -156,7 +156,7 @@ struct hb_collect_glyphs_context_t :
const
char
*
get_name
()
{
return
"COLLECT_GLYPHS"
;
}
typedef
return_t
(
*
recurse_func_t
)
(
hb_collect_glyphs_context_t
*
c
,
unsigned
int
lookup_index
);
template
<
typename
T
>
return_t
dispatch
(
const
T
&
obj
)
{
obj
.
collect_glyphs
(
this
);
return
hb_void_t
();
}
return_t
_
dispatch
(
const
T
&
obj
)
{
obj
.
collect_glyphs
(
this
);
return
hb_void_t
();
}
static
return_t
default_return_value
()
{
return
hb_void_t
();
}
void
recurse
(
unsigned
int
lookup_index
)
{
...
...
@@ -235,7 +235,7 @@ struct hb_add_coverage_context_t :
const
char
*
get_name
()
{
return
"GET_COVERAGE"
;
}
typedef
const
Coverage
&
return_t
;
template
<
typename
T
>
return_t
dispatch
(
const
T
&
obj
)
{
return
obj
.
get_coverage
();
}
return_t
_
dispatch
(
const
T
&
obj
)
{
return
obj
.
get_coverage
();
}
static
return_t
default_return_value
()
{
return
Null
(
Coverage
);
}
bool
stop_sublookup_iteration
(
return_t
r
)
const
{
...
...
@@ -438,7 +438,7 @@ struct hb_ot_apply_context_t :
const
char
*
get_name
()
{
return
"APPLY"
;
}
typedef
return_t
(
*
recurse_func_t
)
(
hb_ot_apply_context_t
*
c
,
unsigned
int
lookup_index
);
template
<
typename
T
>
return_t
dispatch
(
const
T
&
obj
)
{
return
obj
.
apply
(
this
);
}
return_t
_
dispatch
(
const
T
&
obj
)
{
return
obj
.
apply
(
this
);
}
static
return_t
default_return_value
()
{
return
false
;
}
bool
stop_sublookup_iteration
(
return_t
r
)
const
{
return
r
;
}
return_t
recurse
(
unsigned
int
sub_lookup_index
)
...
...
@@ -648,7 +648,7 @@ struct hb_get_subtables_context_t :
/* Dispatch interface. */
const
char
*
get_name
()
{
return
"GET_SUBTABLES"
;
}
template
<
typename
T
>
return_t
dispatch
(
const
T
&
obj
)
return_t
_
dispatch
(
const
T
&
obj
)
{
hb_applicable_t
*
entry
=
array
.
push
();
entry
->
init
(
obj
,
apply_to
<
T
>
);
...
...
src/hb-sanitize.hh
浏览文件 @
ac350c92
...
...
@@ -131,7 +131,7 @@ struct hb_sanitize_context_t :
bool
may_dispatch
(
const
T
*
obj
HB_UNUSED
,
const
F
*
format
)
{
return
format
->
sanitize
(
this
);
}
template
<
typename
T
>
return_t
dispatch
(
const
T
&
obj
)
{
return
obj
.
sanitize
(
this
);
}
return_t
_
dispatch
(
const
T
&
obj
)
{
return
obj
.
sanitize
(
this
);
}
static
return_t
default_return_value
()
{
return
true
;
}
static
return_t
no_dispatch_return_value
()
{
return
false
;
}
bool
stop_sublookup_iteration
(
const
return_t
r
)
const
{
return
!
r
;
}
...
...
src/hb-subset.hh
浏览文件 @
ac350c92
...
...
@@ -41,8 +41,8 @@ struct hb_subset_context_t :
{
const
char
*
get_name
()
{
return
"SUBSET"
;
}
template
<
typename
T
>
bool
dispatch
(
const
T
&
obj
)
{
return
obj
.
subset
(
this
);
}
static
bool
default_return_value
()
{
return
true
;
}
return_t
_
dispatch
(
const
T
&
obj
)
{
return
obj
.
subset
(
this
);
}
static
return_t
default_return_value
()
{
return
true
;
}
hb_subset_plan_t
*
plan
;
hb_serialize_context_t
*
serializer
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录