Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
7b2ef551
T
Third Party Harfbuzz
项目概览
OpenHarmony
/
Third Party Harfbuzz
接近 2 年 前同步成功
通知
1
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看板
提交
7b2ef551
编写于
9月 03, 2018
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Templatize Lookup::sanitize()
上级
9c3747c5
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
33 addition
and
39 deletion
+33
-39
src/hb-ot-layout-common.hh
src/hb-ot-layout-common.hh
+28
-12
src/hb-ot-layout-gpos-table.hh
src/hb-ot-layout-gpos-table.hh
+2
-5
src/hb-ot-layout-gsub-table.hh
src/hb-ot-layout-gsub-table.hh
+3
-22
未找到文件。
src/hb-ot-layout-common.hh
浏览文件 @
7b2ef551
...
@@ -634,16 +634,16 @@ struct Lookup
...
@@ -634,16 +634,16 @@ struct Lookup
{
{
inline
unsigned
int
get_subtable_count
(
void
)
const
{
return
subTable
.
len
;
}
inline
unsigned
int
get_subtable_count
(
void
)
const
{
return
subTable
.
len
;
}
template
<
typename
SubTableTyp
e
>
template
<
typename
TSubTabl
e
>
inline
const
SubTableTyp
e
&
get_subtable
(
unsigned
int
i
)
const
inline
const
TSubTabl
e
&
get_subtable
(
unsigned
int
i
)
const
{
return
this
+
CastR
<
OffsetArrayOf
<
SubTableTyp
e
>
>
(
subTable
)[
i
];
}
{
return
this
+
CastR
<
OffsetArrayOf
<
TSubTabl
e
>
>
(
subTable
)[
i
];
}
template
<
typename
SubTableTyp
e
>
template
<
typename
TSubTabl
e
>
inline
const
OffsetArrayOf
<
SubTableTyp
e
>&
get_subtables
(
void
)
const
inline
const
OffsetArrayOf
<
TSubTabl
e
>&
get_subtables
(
void
)
const
{
return
CastR
<
OffsetArrayOf
<
SubTableTyp
e
>
>
(
subTable
);
}
{
return
CastR
<
OffsetArrayOf
<
TSubTabl
e
>
>
(
subTable
);
}
template
<
typename
SubTableTyp
e
>
template
<
typename
TSubTabl
e
>
inline
OffsetArrayOf
<
SubTableTyp
e
>&
get_subtables
(
void
)
inline
OffsetArrayOf
<
TSubTabl
e
>&
get_subtables
(
void
)
{
return
CastR
<
OffsetArrayOf
<
SubTableTyp
e
>
>
(
subTable
);
}
{
return
CastR
<
OffsetArrayOf
<
TSubTabl
e
>
>
(
subTable
);
}
inline
unsigned
int
get_size
(
void
)
const
inline
unsigned
int
get_size
(
void
)
const
{
{
...
@@ -669,14 +669,14 @@ struct Lookup
...
@@ -669,14 +669,14 @@ struct Lookup
return
flag
;
return
flag
;
}
}
template
<
typename
SubTableTyp
e
,
typename
context_t
>
template
<
typename
TSubTabl
e
,
typename
context_t
>
inline
typename
context_t
::
return_t
dispatch
(
context_t
*
c
)
const
inline
typename
context_t
::
return_t
dispatch
(
context_t
*
c
)
const
{
{
unsigned
int
lookup_type
=
get_type
();
unsigned
int
lookup_type
=
get_type
();
TRACE_DISPATCH
(
this
,
lookup_type
);
TRACE_DISPATCH
(
this
,
lookup_type
);
unsigned
int
count
=
get_subtable_count
();
unsigned
int
count
=
get_subtable_count
();
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
{
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
{
typename
context_t
::
return_t
r
=
get_subtable
<
SubTableTyp
e
>
(
i
).
dispatch
(
c
,
lookup_type
);
typename
context_t
::
return_t
r
=
get_subtable
<
TSubTabl
e
>
(
i
).
dispatch
(
c
,
lookup_type
);
if
(
c
->
stop_sublookup_iteration
(
r
))
if
(
c
->
stop_sublookup_iteration
(
r
))
return_trace
(
r
);
return_trace
(
r
);
}
}
...
@@ -702,16 +702,32 @@ struct Lookup
...
@@ -702,16 +702,32 @@ struct Lookup
return_trace
(
true
);
return_trace
(
true
);
}
}
template
<
typename
TSubTable
>
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
{
{
TRACE_SANITIZE
(
this
);
TRACE_SANITIZE
(
this
);
/* Real sanitize of the subtables is done by GSUB/GPOS/... */
if
(
!
(
c
->
check_struct
(
this
)
&&
subTable
.
sanitize
(
c
)))
return_trace
(
false
);
if
(
!
(
c
->
check_struct
(
this
)
&&
subTable
.
sanitize
(
c
)))
return_trace
(
false
);
if
(
lookupFlag
&
LookupFlag
::
UseMarkFilteringSet
)
if
(
lookupFlag
&
LookupFlag
::
UseMarkFilteringSet
)
{
{
const
HBUINT16
&
markFilteringSet
=
StructAfter
<
HBUINT16
>
(
subTable
);
const
HBUINT16
&
markFilteringSet
=
StructAfter
<
HBUINT16
>
(
subTable
);
if
(
!
markFilteringSet
.
sanitize
(
c
))
return_trace
(
false
);
if
(
!
markFilteringSet
.
sanitize
(
c
))
return_trace
(
false
);
}
}
if
(
unlikely
(
!
dispatch
<
TSubTable
>
(
c
)))
return_trace
(
false
);
if
(
unlikely
(
get_type
()
==
TSubTable
::
Extension
))
{
/* The spec says all subtables of an Extension lookup should
* have the same type, which shall not be the Extension type
* itself (but we already checked for that).
* This is specially important if one has a reverse type! */
unsigned
int
type
=
get_subtable
<
TSubTable
>
(
0
).
u
.
extension
.
get_type
();
unsigned
int
count
=
get_subtable_count
();
for
(
unsigned
int
i
=
1
;
i
<
count
;
i
++
)
if
(
get_subtable
<
TSubTable
>
(
i
).
u
.
extension
.
get_type
()
!=
type
)
return_trace
(
false
);
}
return_trace
(
true
);
return_trace
(
true
);
return_trace
(
true
);
}
}
...
...
src/hb-ot-layout-gpos-table.hh
浏览文件 @
7b2ef551
...
@@ -1445,6 +1445,7 @@ struct ExtensionPos : Extension<ExtensionPos>
...
@@ -1445,6 +1445,7 @@ struct ExtensionPos : Extension<ExtensionPos>
struct
PosLookupSubTable
struct
PosLookupSubTable
{
{
friend
struct
Lookup
;
friend
struct
PosLookup
;
friend
struct
PosLookup
;
enum
Type
{
enum
Type
{
...
@@ -1543,11 +1544,7 @@ struct PosLookup : Lookup
...
@@ -1543,11 +1544,7 @@ struct PosLookup : Lookup
{
return
Lookup
::
dispatch
<
SubTable
>
(
c
);
}
{
return
Lookup
::
dispatch
<
SubTable
>
(
c
);
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
{
{
return
Lookup
::
sanitize
<
SubTable
>
(
c
);
}
TRACE_SANITIZE
(
this
);
if
(
unlikely
(
!
Lookup
::
sanitize
(
c
)))
return_trace
(
false
);
return_trace
(
dispatch
(
c
));
}
};
};
/*
/*
...
...
src/hb-ot-layout-gsub-table.hh
浏览文件 @
7b2ef551
...
@@ -1161,6 +1161,7 @@ struct ReverseChainSingleSubst
...
@@ -1161,6 +1161,7 @@ struct ReverseChainSingleSubst
struct
SubstLookupSubTable
struct
SubstLookupSubTable
{
{
friend
struct
Lookup
;
friend
struct
SubstLookup
;
friend
struct
SubstLookup
;
enum
Type
{
enum
Type
{
...
@@ -1366,30 +1367,10 @@ struct SubstLookup : Lookup
...
@@ -1366,30 +1367,10 @@ struct SubstLookup : Lookup
{
return
Lookup
::
dispatch
<
SubTable
>
(
c
);
}
{
return
Lookup
::
dispatch
<
SubTable
>
(
c
);
}
inline
bool
subset
(
hb_subset_context_t
*
c
)
const
inline
bool
subset
(
hb_subset_context_t
*
c
)
const
{
{
return
false
;
}
//XXX Lookup::subset<SubTable> (c); }
return
false
;
//XXX
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
{
{
return
Lookup
::
sanitize
<
SubTable
>
(
c
);
}
TRACE_SANITIZE
(
this
);
if
(
unlikely
(
!
Lookup
::
sanitize
(
c
)))
return_trace
(
false
);
if
(
unlikely
(
!
dispatch
(
c
)))
return_trace
(
false
);
if
(
unlikely
(
get_type
()
==
SubTable
::
Extension
))
{
/* The spec says all subtables of an Extension lookup should
* have the same type, which shall not be the Extension type
* itself (but we already checked for that).
* This is specially important if one has a reverse type! */
unsigned
int
type
=
get_subtable
(
0
).
u
.
extension
.
get_type
();
unsigned
int
count
=
get_subtable_count
();
for
(
unsigned
int
i
=
1
;
i
<
count
;
i
++
)
if
(
get_subtable
(
i
).
u
.
extension
.
get_type
()
!=
type
)
return_trace
(
false
);
}
return_trace
(
true
);
}
};
};
/*
/*
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录