Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
b051be54
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看板
提交
b051be54
编写于
1月 29, 2015
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[lookup] Add skippy_iter.reset()
Towards reducing the cost of initializing skippy_iter()
上级
2cecc38c
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
32 addition
and
16 deletion
+32
-16
src/hb-ot-layout-gpos-table.hh
src/hb-ot-layout-gpos-table.hh
+12
-6
src/hb-ot-layout-gsubgpos-private.hh
src/hb-ot-layout-gsubgpos-private.hh
+18
-9
src/hb-ot-shape-fallback.cc
src/hb-ot-shape-fallback.cc
+2
-1
未找到文件。
src/hb-ot-layout-gpos-table.hh
浏览文件 @
b051be54
...
...
@@ -684,7 +684,8 @@ struct PairPosFormat1
unsigned
int
index
=
(
this
+
coverage
).
get_coverage
(
buffer
->
cur
().
codepoint
);
if
(
likely
(
index
==
NOT_COVERED
))
return
TRACE_RETURN
(
false
);
hb_apply_context_t
::
skipping_iterator_t
skippy_iter
(
c
,
buffer
->
idx
,
1
);
hb_apply_context_t
::
skipping_iterator_t
skippy_iter
(
c
);
skippy_iter
.
reset
(
buffer
->
idx
,
1
);
if
(
!
skippy_iter
.
next
())
return
TRACE_RETURN
(
false
);
return
TRACE_RETURN
((
this
+
pairSet
[
index
]).
apply
(
c
,
&
valueFormat1
,
skippy_iter
.
idx
));
...
...
@@ -753,7 +754,8 @@ struct PairPosFormat2
unsigned
int
index
=
(
this
+
coverage
).
get_coverage
(
buffer
->
cur
().
codepoint
);
if
(
likely
(
index
==
NOT_COVERED
))
return
TRACE_RETURN
(
false
);
hb_apply_context_t
::
skipping_iterator_t
skippy_iter
(
c
,
buffer
->
idx
,
1
);
hb_apply_context_t
::
skipping_iterator_t
skippy_iter
(
c
);
skippy_iter
.
reset
(
buffer
->
idx
,
1
);
if
(
!
skippy_iter
.
next
())
return
TRACE_RETURN
(
false
);
unsigned
int
len1
=
valueFormat1
.
get_len
();
...
...
@@ -902,7 +904,8 @@ struct CursivePosFormat1
const
EntryExitRecord
&
this_record
=
entryExitRecord
[(
this
+
coverage
).
get_coverage
(
buffer
->
cur
().
codepoint
)];
if
(
!
this_record
.
exitAnchor
)
return
TRACE_RETURN
(
false
);
hb_apply_context_t
::
skipping_iterator_t
skippy_iter
(
c
,
buffer
->
idx
,
1
);
hb_apply_context_t
::
skipping_iterator_t
skippy_iter
(
c
);
skippy_iter
.
reset
(
buffer
->
idx
,
1
);
if
(
!
skippy_iter
.
next
())
return
TRACE_RETURN
(
false
);
const
EntryExitRecord
&
next_record
=
entryExitRecord
[(
this
+
coverage
).
get_coverage
(
buffer
->
info
[
skippy_iter
.
idx
].
codepoint
)];
...
...
@@ -1045,7 +1048,8 @@ struct MarkBasePosFormat1
if
(
likely
(
mark_index
==
NOT_COVERED
))
return
TRACE_RETURN
(
false
);
/* now we search backwards for a non-mark glyph */
hb_apply_context_t
::
skipping_iterator_t
skippy_iter
(
c
,
buffer
->
idx
,
1
);
hb_apply_context_t
::
skipping_iterator_t
skippy_iter
(
c
);
skippy_iter
.
reset
(
buffer
->
idx
,
1
);
skippy_iter
.
set_lookup_props
(
LookupFlag
::
IgnoreMarks
);
do
{
if
(
!
skippy_iter
.
prev
())
return
TRACE_RETURN
(
false
);
...
...
@@ -1149,7 +1153,8 @@ struct MarkLigPosFormat1
if
(
likely
(
mark_index
==
NOT_COVERED
))
return
TRACE_RETURN
(
false
);
/* now we search backwards for a non-mark glyph */
hb_apply_context_t
::
skipping_iterator_t
skippy_iter
(
c
,
buffer
->
idx
,
1
);
hb_apply_context_t
::
skipping_iterator_t
skippy_iter
(
c
);
skippy_iter
.
reset
(
buffer
->
idx
,
1
);
skippy_iter
.
set_lookup_props
(
LookupFlag
::
IgnoreMarks
);
if
(
!
skippy_iter
.
prev
())
return
TRACE_RETURN
(
false
);
...
...
@@ -1265,7 +1270,8 @@ 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 */
hb_apply_context_t
::
skipping_iterator_t
skippy_iter
(
c
,
buffer
->
idx
,
1
);
hb_apply_context_t
::
skipping_iterator_t
skippy_iter
(
c
);
skippy_iter
.
reset
(
buffer
->
idx
,
1
);
skippy_iter
.
set_lookup_props
(
c
->
lookup_props
&
~
LookupFlag
::
IgnoreFlags
);
if
(
!
skippy_iter
.
prev
())
return
TRACE_RETURN
(
false
);
...
...
src/hb-ot-layout-gsubgpos-private.hh
浏览文件 @
b051be54
...
...
@@ -338,14 +338,12 @@ struct hb_apply_context_t
struct
skipping_iterator_t
{
inline
skipping_iterator_t
(
hb_apply_context_t
*
c_
,
unsigned
int
start_index_
,
unsigned
int
num_items_
,
bool
context_match
=
false
)
:
idx
(
start_index_
),
idx
(
0
),
c
(
c_
),
match_glyph_data
(
NULL
),
num_items
(
num_items_
),
end
(
c
->
buffer
->
len
)
num_items
(
0
),
end
(
0
)
{
matcher
.
set_lookup_props
(
c
->
lookup_props
);
/* Ignore ZWNJ if we are matching GSUB context, or matching GPOS. */
...
...
@@ -354,7 +352,6 @@ struct hb_apply_context_t
matcher
.
set_ignore_zwj
(
context_match
||
c
->
table_index
==
1
||
c
->
auto_zwj
);
if
(
!
context_match
)
matcher
.
set_mask
(
c
->
lookup_mask
);
matcher
.
set_syllable
(
start_index_
==
c
->
buffer
->
idx
?
c
->
buffer
->
cur
().
syllable
()
:
0
);
}
inline
void
set_lookup_props
(
unsigned
int
lookup_props
)
{
matcher
.
set_lookup_props
(
lookup_props
);
}
inline
void
set_match_func
(
matcher_t
::
match_func_t
match_func
,
...
...
@@ -365,6 +362,15 @@ struct hb_apply_context_t
match_glyph_data
=
glyph_data
;
}
inline
void
reset
(
unsigned
int
start_index_
,
unsigned
int
num_items_
)
{
idx
=
start_index_
;
num_items
=
num_items_
;
end
=
c
->
buffer
->
len
;
matcher
.
set_syllable
(
start_index_
==
c
->
buffer
->
idx
?
c
->
buffer
->
cur
().
syllable
()
:
0
);
}
inline
void
reject
(
void
)
{
num_items
++
;
match_glyph_data
--
;
}
inline
bool
next
(
void
)
...
...
@@ -699,7 +705,8 @@ static inline bool match_input (hb_apply_context_t *c,
hb_buffer_t
*
buffer
=
c
->
buffer
;
hb_apply_context_t
::
skipping_iterator_t
skippy_iter
(
c
,
buffer
->
idx
,
count
-
1
);
hb_apply_context_t
::
skipping_iterator_t
skippy_iter
(
c
);
skippy_iter
.
reset
(
buffer
->
idx
,
count
-
1
);
skippy_iter
.
set_match_func
(
match_func
,
match_data
,
input
);
/*
...
...
@@ -867,7 +874,8 @@ static inline bool match_backtrack (hb_apply_context_t *c,
{
TRACE_APPLY
(
NULL
);
hb_apply_context_t
::
skipping_iterator_t
skippy_iter
(
c
,
c
->
buffer
->
backtrack_len
(),
count
,
true
);
hb_apply_context_t
::
skipping_iterator_t
skippy_iter
(
c
,
true
);
skippy_iter
.
reset
(
c
->
buffer
->
backtrack_len
(),
count
);
skippy_iter
.
set_match_func
(
match_func
,
match_data
,
backtrack
);
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
...
...
@@ -886,7 +894,8 @@ static inline bool match_lookahead (hb_apply_context_t *c,
{
TRACE_APPLY
(
NULL
);
hb_apply_context_t
::
skipping_iterator_t
skippy_iter
(
c
,
c
->
buffer
->
idx
+
offset
-
1
,
count
,
true
);
hb_apply_context_t
::
skipping_iterator_t
skippy_iter
(
c
,
true
);
skippy_iter
.
reset
(
c
->
buffer
->
idx
+
offset
-
1
,
count
);
skippy_iter
.
set_match_func
(
match_func
,
match_data
,
lookahead
);
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
...
...
src/hb-ot-shape-fallback.cc
浏览文件 @
b051be54
...
...
@@ -441,13 +441,14 @@ _hb_ot_shape_fallback_kern (const hb_ot_shape_plan_t *plan,
OT
::
hb_apply_context_t
c
(
1
,
font
,
buffer
);
c
.
set_lookup_mask
(
plan
->
kern_mask
);
c
.
set_lookup_props
(
OT
::
LookupFlag
::
IgnoreMarks
);
OT
::
hb_apply_context_t
::
skipping_iterator_t
skippy_iter
(
&
c
);
unsigned
int
count
=
buffer
->
len
;
hb_glyph_info_t
*
info
=
buffer
->
info
;
hb_glyph_position_t
*
pos
=
buffer
->
pos
;
for
(
unsigned
int
idx
=
0
;
idx
<
count
;)
{
OT
::
hb_apply_context_t
::
skipping_iterator_t
skippy_iter
(
&
c
,
idx
,
1
);
skippy_iter
.
reset
(
idx
,
1
);
if
(
!
skippy_iter
.
next
())
{
idx
++
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录