Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
969c9705
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看板
提交
969c9705
编写于
5月 05, 2010
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Move context_length into apply_context
上级
94a23aae
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
50 addition
and
38 deletion
+50
-38
src/hb-ot-layout-gpos-private.hh
src/hb-ot-layout-gpos-private.hh
+5
-4
src/hb-ot-layout-gsub-private.hh
src/hb-ot-layout-gsub-private.hh
+5
-4
src/hb-ot-layout-gsubgpos-private.hh
src/hb-ot-layout-gsubgpos-private.hh
+40
-30
未找到文件。
src/hb-ot-layout-gpos-private.hh
浏览文件 @
969c9705
...
...
@@ -577,7 +577,7 @@ struct PairPosFormat1
inline
bool
apply
(
APPLY_ARG_DEF
)
const
{
TRACE_APPLY
();
unsigned
int
end
=
MIN
(
context
->
buffer
->
in_length
,
context
->
buffer
->
in_pos
+
context_length
);
unsigned
int
end
=
MIN
(
context
->
buffer
->
in_length
,
context
->
buffer
->
in_pos
+
context
->
context
_length
);
if
(
unlikely
(
context
->
buffer
->
in_pos
+
2
>
end
))
return
false
;
...
...
@@ -670,7 +670,7 @@ struct PairPosFormat2
inline
bool
apply
(
APPLY_ARG_DEF
)
const
{
TRACE_APPLY
();
unsigned
int
end
=
MIN
(
context
->
buffer
->
in_length
,
context
->
buffer
->
in_pos
+
context_length
);
unsigned
int
end
=
MIN
(
context
->
buffer
->
in_length
,
context
->
buffer
->
in_pos
+
context
->
context
_length
);
if
(
unlikely
(
context
->
buffer
->
in_pos
+
2
>
end
))
return
false
;
...
...
@@ -1495,6 +1495,7 @@ struct PosLookup : Lookup
context
->
layout
=
layout
;
context
->
buffer
=
buffer
;
context
->
context_length
=
context_length
;
context
->
nesting_level_left
=
nesting_level_left
;
context
->
lookup_flag
=
get_flag
();
...
...
@@ -1608,10 +1609,10 @@ static inline bool position_lookup (APPLY_ARG_DEF, unsigned int lookup_index)
if
(
unlikely
(
context
->
nesting_level_left
==
0
))
return
false
;
if
(
unlikely
(
context_length
<
1
))
if
(
unlikely
(
context
->
context
_length
<
1
))
return
false
;
return
l
.
apply_once
(
context
->
layout
,
context
->
buffer
,
context_length
,
context
->
nesting_level_left
-
1
,
apply_depth
+
1
);
return
l
.
apply_once
(
context
->
layout
,
context
->
buffer
,
context
->
context
_length
,
context
->
nesting_level_left
-
1
,
apply_depth
+
1
);
}
...
...
src/hb-ot-layout-gsub-private.hh
浏览文件 @
969c9705
...
...
@@ -367,7 +367,7 @@ struct Ligature
TRACE_APPLY
();
unsigned
int
i
,
j
;
unsigned
int
count
=
component
.
len
;
unsigned
int
end
=
MIN
(
context
->
buffer
->
in_length
,
context
->
buffer
->
in_pos
+
context_length
);
unsigned
int
end
=
MIN
(
context
->
buffer
->
in_length
,
context
->
buffer
->
in_pos
+
context
->
context
_length
);
if
(
unlikely
(
context
->
buffer
->
in_pos
+
count
>
end
))
return
false
;
...
...
@@ -597,7 +597,7 @@ struct ReverseChainSingleSubstFormat1
inline
bool
apply
(
APPLY_ARG_DEF
)
const
{
TRACE_APPLY
();
if
(
unlikely
(
context_length
!=
NO_CONTEXT
))
if
(
unlikely
(
context
->
context
_length
!=
NO_CONTEXT
))
return
false
;
/* No chaining to this type */
unsigned
int
index
=
(
this
+
coverage
)
(
IN_CURGLYPH
());
...
...
@@ -780,6 +780,7 @@ struct SubstLookup : Lookup
context
->
layout
=
layout
;
context
->
buffer
=
buffer
;
context
->
context_length
=
context_length
;
context
->
nesting_level_left
=
nesting_level_left
;
context
->
lookup_flag
=
get_flag
();
...
...
@@ -927,10 +928,10 @@ static inline bool substitute_lookup (APPLY_ARG_DEF, unsigned int lookup_index)
if
(
unlikely
(
context
->
nesting_level_left
==
0
))
return
false
;
if
(
unlikely
(
context_length
<
1
))
if
(
unlikely
(
context
->
context
_length
<
1
))
return
false
;
return
l
.
apply_once
(
context
->
layout
,
context
->
buffer
,
context_length
,
context
->
nesting_level_left
-
1
,
apply_depth
+
1
);
return
l
.
apply_once
(
context
->
layout
,
context
->
buffer
,
context
->
context
_length
,
context
->
nesting_level_left
-
1
,
apply_depth
+
1
);
}
...
...
src/hb-ot-layout-gsubgpos-private.hh
浏览文件 @
969c9705
...
...
@@ -44,17 +44,16 @@
#define APPLY_ARG_DEF \
hb_apply_context_t *context, \
unsigned int context_length HB_UNUSED, \
unsigned int apply_depth HB_UNUSED
#define APPLY_ARG \
context, \
context_length, \
(HB_DEBUG_APPLY ? apply_depth + 1 : 0)
struct
hb_apply_context_t
{
hb_ot_layout_context_t
*
layout
;
hb_buffer_t
*
buffer
;
unsigned
int
context_length
;
unsigned
int
nesting_level_left
;
unsigned
int
lookup_flag
;
unsigned
int
property
;
/* propety of first glyph (TODO remove) */
...
...
@@ -103,7 +102,7 @@ static inline bool match_input (APPLY_ARG_DEF,
unsigned
int
*
context_length_out
)
{
unsigned
int
i
,
j
;
unsigned
int
end
=
MIN
(
context
->
buffer
->
in_length
,
context
->
buffer
->
in_pos
+
context_length
);
unsigned
int
end
=
MIN
(
context
->
buffer
->
in_length
,
context
->
buffer
->
in_pos
+
context
->
context
_length
);
if
(
unlikely
(
context
->
buffer
->
in_pos
+
count
>
end
))
return
false
;
...
...
@@ -158,7 +157,7 @@ static inline bool match_lookahead (APPLY_ARG_DEF,
unsigned
int
offset
)
{
unsigned
int
i
,
j
;
unsigned
int
end
=
MIN
(
context
->
buffer
->
in_length
,
context
->
buffer
->
in_pos
+
context_length
);
unsigned
int
end
=
MIN
(
context
->
buffer
->
in_length
,
context
->
buffer
->
in_pos
+
context
->
context
_length
);
if
(
unlikely
(
context
->
buffer
->
in_pos
+
offset
+
count
>
end
))
return
false
;
...
...
@@ -201,7 +200,7 @@ static inline bool apply_lookup (APPLY_ARG_DEF,
const
LookupRecord
lookupRecord
[],
/* Array of LookupRecords--in design order */
apply_lookup_func_t
apply_func
)
{
unsigned
int
end
=
MIN
(
context
->
buffer
->
in_length
,
context
->
buffer
->
in_pos
+
context_length
);
unsigned
int
end
=
MIN
(
context
->
buffer
->
in_length
,
context
->
buffer
->
in_pos
+
context
->
context
_length
);
if
(
unlikely
(
context
->
buffer
->
in_pos
+
count
>
end
))
return
false
;
...
...
@@ -267,14 +266,20 @@ static inline bool context_lookup (APPLY_ARG_DEF,
const
LookupRecord
lookupRecord
[],
ContextLookupContext
&
lookup_context
)
{
return
match_input
(
APPLY_ARG
,
inputCount
,
input
,
lookup_context
.
funcs
.
match
,
lookup_context
.
match_data
,
&
context_length
)
&&
apply_lookup
(
APPLY_ARG
,
inputCount
,
lookupCount
,
lookupRecord
,
lookup_context
.
funcs
.
apply
);
unsigned
int
new_context_length
;
if
(
!
match_input
(
APPLY_ARG
,
inputCount
,
input
,
lookup_context
.
funcs
.
match
,
lookup_context
.
match_data
,
&
new_context_length
))
return
false
;
unsigned
int
old_context_length
;
old_context_length
=
context
->
context_length
;
context
->
context_length
=
new_context_length
;
bool
ret
=
apply_lookup
(
APPLY_ARG
,
inputCount
,
lookupCount
,
lookupRecord
,
lookup_context
.
funcs
.
apply
);
context
->
context_length
=
old_context_length
;
return
ret
;
}
struct
Rule
...
...
@@ -529,26 +534,31 @@ static inline bool chain_context_lookup (APPLY_ARG_DEF,
/* First guess */
if
(
unlikely
(
context
->
buffer
->
out_pos
<
backtrackCount
||
context
->
buffer
->
in_pos
+
inputCount
+
lookaheadCount
>
context
->
buffer
->
in_length
||
inputCount
+
lookaheadCount
>
context_length
))
inputCount
+
lookaheadCount
>
context
->
context
_length
))
return
false
;
unsigned
int
offset
;
return
match_backtrack
(
APPLY_ARG
,
backtrackCount
,
backtrack
,
lookup_context
.
funcs
.
match
,
lookup_context
.
match_data
[
0
])
&&
match_input
(
APPLY_ARG
,
inputCount
,
input
,
lookup_context
.
funcs
.
match
,
lookup_context
.
match_data
[
1
],
&
offset
)
&&
match_lookahead
(
APPLY_ARG
,
lookaheadCount
,
lookahead
,
lookup_context
.
funcs
.
match
,
lookup_context
.
match_data
[
2
],
offset
)
&&
(
context_length
=
offset
,
true
)
&&
apply_lookup
(
APPLY_ARG
,
inputCount
,
lookupCount
,
lookupRecord
,
lookup_context
.
funcs
.
apply
);
if
(
!
(
match_backtrack
(
APPLY_ARG
,
backtrackCount
,
backtrack
,
lookup_context
.
funcs
.
match
,
lookup_context
.
match_data
[
0
])
&&
match_input
(
APPLY_ARG
,
inputCount
,
input
,
lookup_context
.
funcs
.
match
,
lookup_context
.
match_data
[
1
],
&
offset
)
&&
match_lookahead
(
APPLY_ARG
,
lookaheadCount
,
lookahead
,
lookup_context
.
funcs
.
match
,
lookup_context
.
match_data
[
2
],
offset
)))
return
false
;
unsigned
int
old_context_length
;
old_context_length
=
context
->
context_length
;
context
->
context_length
=
offset
;
bool
ret
=
apply_lookup
(
APPLY_ARG
,
inputCount
,
lookupCount
,
lookupRecord
,
lookup_context
.
funcs
.
apply
);
context
->
context_length
=
old_context_length
;
return
ret
;
}
struct
ChainRule
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录