Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
407fc124
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看板
提交
407fc124
编写于
2月 13, 2013
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[OTLayout] Remove bogus caching of glyph property
上级
6b1e3502
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
26 addition
and
42 deletion
+26
-42
src/hb-ot-layout-gpos-table.hh
src/hb-ot-layout-gpos-table.hh
+8
-13
src/hb-ot-layout-gsub-table.hh
src/hb-ot-layout-gsub-table.hh
+3
-4
src/hb-ot-layout-gsubgpos-private.hh
src/hb-ot-layout-gsubgpos-private.hh
+15
-25
未找到文件。
src/hb-ot-layout-gpos-table.hh
浏览文件 @
407fc124
...
...
@@ -878,7 +878,7 @@ struct CursivePosFormat1
TRACE_APPLY
(
this
);
/* We don't handle mark glyphs here. */
if
(
c
->
property
&
HB_OT_LAYOUT_GLYPH_PROPS_MARK
)
return
TRACE_RETURN
(
false
);
if
(
c
->
buffer
->
cur
().
glyph_props
()
&
HB_OT_LAYOUT_GLYPH_PROPS_MARK
)
return
TRACE_RETURN
(
false
);
hb_apply_context_t
::
skipping_forward_iterator_t
skippy_iter
(
c
,
c
->
buffer
->
idx
,
1
);
if
(
skippy_iter
.
has_no_chance
())
return
TRACE_RETURN
(
false
);
...
...
@@ -1028,17 +1028,16 @@ struct MarkBasePosFormat1
if
(
likely
(
mark_index
==
NOT_COVERED
))
return
TRACE_RETURN
(
false
);
/* now we search backwards for a non-mark glyph */
unsigned
int
property
;
hb_apply_context_t
::
skipping_backward_iterator_t
skippy_iter
(
c
,
c
->
buffer
->
idx
,
1
);
do
{
if
(
!
skippy_iter
.
prev
(
&
property
,
LookupFlag
::
IgnoreMarks
))
return
TRACE_RETURN
(
false
);
if
(
!
skippy_iter
.
prev
(
LookupFlag
::
IgnoreMarks
))
return
TRACE_RETURN
(
false
);
/* We only want to attach to the first of a MultipleSubst sequence. Reject others. */
if
(
0
==
get_lig_comp
(
c
->
buffer
->
info
[
skippy_iter
.
idx
]))
break
;
skippy_iter
.
reject
();
}
while
(
1
);
/* The following assertion is too strong, so we've disabled it. */
if
(
!
(
property
&
HB_OT_LAYOUT_GLYPH_PROPS_BASE_GLYPH
))
{
/*return TRACE_RETURN (false);*/
}
if
(
!
(
c
->
buffer
->
info
[
skippy_iter
.
idx
].
glyph_props
()
&
HB_OT_LAYOUT_GLYPH_PROPS_BASE_GLYPH
))
{
/*return TRACE_RETURN (false);*/
}
unsigned
int
base_index
=
(
this
+
baseCoverage
).
get_coverage
(
c
->
buffer
->
info
[
skippy_iter
.
idx
].
codepoint
);
if
(
base_index
==
NOT_COVERED
)
return
TRACE_RETURN
(
false
);
...
...
@@ -1132,12 +1131,11 @@ struct MarkLigPosFormat1
if
(
likely
(
mark_index
==
NOT_COVERED
))
return
TRACE_RETURN
(
false
);
/* now we search backwards for a non-mark glyph */
unsigned
int
property
;
hb_apply_context_t
::
skipping_backward_iterator_t
skippy_iter
(
c
,
c
->
buffer
->
idx
,
1
);
if
(
!
skippy_iter
.
prev
(
&
property
,
LookupFlag
::
IgnoreMarks
))
return
TRACE_RETURN
(
false
);
if
(
!
skippy_iter
.
prev
(
LookupFlag
::
IgnoreMarks
))
return
TRACE_RETURN
(
false
);
/* The following assertion is too strong, so we've disabled it. */
if
(
!
(
property
&
HB_OT_LAYOUT_GLYPH_PROPS_LIGATURE
))
{
/*return TRACE_RETURN (false);*/
}
if
(
!
(
c
->
buffer
->
info
[
skippy_iter
.
idx
].
glyph_props
()
&
HB_OT_LAYOUT_GLYPH_PROPS_LIGATURE
))
{
/*return TRACE_RETURN (false);*/
}
unsigned
int
j
=
skippy_iter
.
idx
;
unsigned
int
lig_index
=
(
this
+
ligatureCoverage
).
get_coverage
(
c
->
buffer
->
info
[
j
].
codepoint
);
...
...
@@ -1248,11 +1246,10 @@ struct MarkMarkPosFormat1
if
(
likely
(
mark1_index
==
NOT_COVERED
))
return
TRACE_RETURN
(
false
);
/* now we search backwards for a suitable mark glyph until a non-mark glyph */
unsigned
int
property
;
hb_apply_context_t
::
skipping_backward_iterator_t
skippy_iter
(
c
,
c
->
buffer
->
idx
,
1
);
if
(
!
skippy_iter
.
prev
(
&
property
,
c
->
lookup_props
&
~
LookupFlag
::
IgnoreFlags
))
return
TRACE_RETURN
(
false
);
if
(
!
skippy_iter
.
prev
(
c
->
lookup_props
&
~
LookupFlag
::
IgnoreFlags
))
return
TRACE_RETURN
(
false
);
if
(
!
(
property
&
HB_OT_LAYOUT_GLYPH_PROPS_MARK
))
return
TRACE_RETURN
(
false
);
if
(
!
(
c
->
buffer
->
info
[
skippy_iter
.
idx
].
glyph_props
()
&
HB_OT_LAYOUT_GLYPH_PROPS_MARK
))
{
return
TRACE_RETURN
(
false
);
}
unsigned
int
j
=
skippy_iter
.
idx
;
...
...
@@ -1474,7 +1471,7 @@ struct PosLookup : Lookup
inline
bool
apply_once
(
hb_apply_context_t
*
c
)
const
{
TRACE_APPLY
(
this
);
if
(
!
c
->
check_glyph_property
(
&
c
->
buffer
->
cur
(),
c
->
lookup_props
,
&
c
->
property
))
if
(
!
c
->
check_glyph_property
(
&
c
->
buffer
->
cur
(),
c
->
lookup_props
))
return
TRACE_RETURN
(
false
);
return
TRACE_RETURN
(
process
(
c
));
}
...
...
@@ -1629,11 +1626,9 @@ inline bool PosLookup::apply_recurse_func (hb_apply_context_t *c, unsigned int l
const
GPOS
&
gpos
=
*
(
hb_ot_layout_from_face
(
c
->
face
)
->
gpos
);
const
PosLookup
&
l
=
gpos
.
get_lookup
(
lookup_index
);
unsigned
int
saved_lookup_props
=
c
->
lookup_props
;
unsigned
int
saved_property
=
c
->
property
;
c
->
set_lookup
(
l
);
bool
ret
=
l
.
apply_once
(
c
);
c
->
lookup_props
=
saved_lookup_props
;
c
->
property
=
saved_property
;
return
ret
;
}
...
...
src/hb-ot-layout-gsub-table.hh
浏览文件 @
407fc124
...
...
@@ -272,7 +272,8 @@ struct Sequence
TRACE_APPLY
(
this
);
if
(
unlikely
(
!
substitute
.
len
))
return
TRACE_RETURN
(
false
);
unsigned
int
klass
=
c
->
property
&
HB_OT_LAYOUT_GLYPH_PROPS_LIGATURE
?
HB_OT_LAYOUT_GLYPH_PROPS_BASE_GLYPH
:
0
;
unsigned
int
klass
=
c
->
buffer
->
cur
().
glyph_props
()
&
HB_OT_LAYOUT_GLYPH_PROPS_LIGATURE
?
HB_OT_LAYOUT_GLYPH_PROPS_BASE_GLYPH
:
0
;
unsigned
int
count
=
substitute
.
len
;
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
{
set_lig_props_for_component
(
c
->
buffer
->
cur
(),
i
);
...
...
@@ -1193,7 +1194,7 @@ struct SubstLookup : Lookup
inline
bool
apply_once
(
hb_apply_context_t
*
c
)
const
{
TRACE_APPLY
(
this
);
if
(
!
c
->
check_glyph_property
(
&
c
->
buffer
->
cur
(),
c
->
lookup_props
,
&
c
->
property
))
if
(
!
c
->
check_glyph_property
(
&
c
->
buffer
->
cur
(),
c
->
lookup_props
))
return
TRACE_RETURN
(
false
);
return
TRACE_RETURN
(
process
(
c
));
}
...
...
@@ -1399,11 +1400,9 @@ inline bool SubstLookup::apply_recurse_func (hb_apply_context_t *c, unsigned int
const
GSUB
&
gsub
=
*
(
hb_ot_layout_from_face
(
c
->
face
)
->
gsub
);
const
SubstLookup
&
l
=
gsub
.
get_lookup
(
lookup_index
);
unsigned
int
saved_lookup_props
=
c
->
lookup_props
;
unsigned
int
saved_property
=
c
->
property
;
c
->
set_lookup
(
l
);
bool
ret
=
l
.
apply_once
(
c
);
c
->
lookup_props
=
saved_lookup_props
;
c
->
property
=
saved_property
;
return
ret
;
}
...
...
src/hb-ot-layout-gsubgpos-private.hh
浏览文件 @
407fc124
...
...
@@ -263,7 +263,6 @@ struct hb_apply_context_t
recurse_func_t
recurse_func
;
unsigned
int
nesting_level_left
;
unsigned
int
lookup_props
;
unsigned
int
property
;
/* propety of first glyph */
const
GDEF
&
gdef
;
bool
has_glyph_classes
;
unsigned
int
debug_depth
;
...
...
@@ -277,7 +276,7 @@ struct hb_apply_context_t
lookup_mask
(
lookup_mask_
),
recurse_func
(
NULL
),
nesting_level_left
(
MAX_NESTING_LEVEL
),
lookup_props
(
0
),
property
(
0
),
lookup_props
(
0
),
gdef
(
*
hb_ot_layout_from_face
(
face
)
->
gdef
),
has_glyph_classes
(
gdef
.
has_glyph_classes
()),
debug_depth
(
0
)
{}
...
...
@@ -308,8 +307,7 @@ struct hb_apply_context_t
{
num_items
++
;
}
inline
bool
next
(
unsigned
int
*
property_out
,
unsigned
int
lookup_props
)
inline
bool
next
(
unsigned
int
lookup_props
)
{
assert
(
num_items
>
0
);
do
...
...
@@ -317,13 +315,13 @@ struct hb_apply_context_t
if
(
has_no_chance
())
return
false
;
idx
++
;
}
while
(
c
->
should_skip
(
&
c
->
buffer
->
info
[
idx
],
lookup_props
,
property_out
));
}
while
(
c
->
should_skip
(
&
c
->
buffer
->
info
[
idx
],
lookup_props
));
num_items
--
;
return
(
c
->
buffer
->
info
[
idx
].
mask
&
mask
)
&&
(
!
syllable
||
syllable
==
c
->
buffer
->
info
[
idx
].
syllable
());
}
inline
bool
next
(
unsigned
int
*
property_out
=
NULL
)
inline
bool
next
(
void
)
{
return
next
(
property_out
,
c
->
lookup_props
);
return
next
(
c
->
lookup_props
);
}
unsigned
int
idx
;
...
...
@@ -357,8 +355,7 @@ struct hb_apply_context_t
{
num_items
++
;
}
inline
bool
prev
(
unsigned
int
*
property_out
,
unsigned
int
lookup_props
)
inline
bool
prev
(
unsigned
int
lookup_props
)
{
assert
(
num_items
>
0
);
do
...
...
@@ -366,13 +363,13 @@ struct hb_apply_context_t
if
(
has_no_chance
())
return
false
;
idx
--
;
}
while
(
c
->
should_skip
(
&
c
->
buffer
->
out_info
[
idx
],
lookup_props
,
property_out
));
}
while
(
c
->
should_skip
(
&
c
->
buffer
->
out_info
[
idx
],
lookup_props
));
num_items
--
;
return
(
c
->
buffer
->
out_info
[
idx
].
mask
&
mask
)
&&
(
!
syllable
||
syllable
==
c
->
buffer
->
out_info
[
idx
].
syllable
());
}
inline
bool
prev
(
unsigned
int
*
property_out
=
NULL
)
inline
bool
prev
(
void
)
{
return
prev
(
property_out
,
c
->
lookup_props
);
return
prev
(
c
->
lookup_props
);
}
unsigned
int
idx
;
...
...
@@ -423,27 +420,22 @@ struct hb_apply_context_t
inline
bool
check_glyph_property
(
hb_glyph_info_t
*
info
,
unsigned
int
lookup_props
,
unsigned
int
*
property_out
)
const
unsigned
int
lookup_props
)
const
{
unsigned
int
property
;
property
=
info
->
glyph_props
();
*
property_out
=
property
;
return
match_properties
(
info
->
codepoint
,
property
,
lookup_props
);
}
inline
bool
should_skip
(
hb_glyph_info_t
*
info
,
unsigned
int
lookup_props
,
unsigned
int
*
property_out
)
const
unsigned
int
lookup_props
)
const
{
unsigned
int
property
;
property
=
info
->
glyph_props
();
if
(
property_out
)
*
property_out
=
property
;
return
!
match_properties
(
info
->
codepoint
,
property
,
lookup_props
);
}
...
...
@@ -451,7 +443,7 @@ struct hb_apply_context_t
inline
bool
should_skip_current_glyph
(
void
)
const
{
return
should_skip
(
&
buffer
->
cur
(),
lookup_props
,
NULL
);
return
should_skip
(
&
buffer
->
cur
(),
lookup_props
);
}
inline
void
set_class
(
hb_codepoint_t
glyph_index
,
unsigned
int
class_guess
)
const
...
...
@@ -618,7 +610,7 @@ static inline bool match_input (hb_apply_context_t *c,
* ligate with a conjunct...)
*/
bool
is_mark_ligature
=
!!
(
c
->
property
&
HB_OT_LAYOUT_GLYPH_PROPS_MARK
);
bool
is_mark_ligature
=
!!
(
c
->
buffer
->
cur
().
glyph_props
()
&
HB_OT_LAYOUT_GLYPH_PROPS_MARK
);
unsigned
int
total_component_count
=
0
;
total_component_count
+=
get_lig_num_comps
(
c
->
buffer
->
cur
());
...
...
@@ -628,9 +620,7 @@ static inline bool match_input (hb_apply_context_t *c,
for
(
unsigned
int
i
=
1
;
i
<
count
;
i
++
)
{
unsigned
int
property
;
if
(
!
skippy_iter
.
next
(
&
property
))
return
TRACE_RETURN
(
false
);
if
(
!
skippy_iter
.
next
())
return
TRACE_RETURN
(
false
);
if
(
likely
(
!
match_func
(
c
->
buffer
->
info
[
skippy_iter
.
idx
].
codepoint
,
input
[
i
-
1
],
match_data
)))
return
TRACE_RETURN
(
false
);
...
...
@@ -651,7 +641,7 @@ static inline bool match_input (hb_apply_context_t *c,
return
TRACE_RETURN
(
false
);
}
is_mark_ligature
=
is_mark_ligature
&&
(
property
&
HB_OT_LAYOUT_GLYPH_PROPS_MARK
);
is_mark_ligature
=
is_mark_ligature
&&
(
c
->
buffer
->
info
[
skippy_iter
.
idx
].
glyph_props
()
&
HB_OT_LAYOUT_GLYPH_PROPS_MARK
);
total_component_count
+=
get_lig_num_comps
(
c
->
buffer
->
info
[
skippy_iter
.
idx
]);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录