Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
6960350b
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看板
提交
6960350b
编写于
5月 14, 2010
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Shortening buffer accessors: rename buffer->in_length to buffer->len
上级
1b621823
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
32 addition
and
32 deletion
+32
-32
src/hb-buffer-private.hh
src/hb-buffer-private.hh
+1
-1
src/hb-buffer.cc
src/hb-buffer.cc
+13
-13
src/hb-ot-layout-gpos-private.hh
src/hb-ot-layout-gpos-private.hh
+4
-4
src/hb-ot-layout-gsub-private.hh
src/hb-ot-layout-gsub-private.hh
+4
-4
src/hb-ot-layout-gsubgpos-private.hh
src/hb-ot-layout-gsubgpos-private.hh
+4
-4
src/hb-shape.cc
src/hb-shape.cc
+6
-6
未找到文件。
src/hb-buffer-private.hh
浏览文件 @
6960350b
...
...
@@ -110,7 +110,7 @@ struct _hb_buffer_t {
hb_bool_t
have_output
;
/* whether we have an output buffer going on */
hb_bool_t
have_positions
;
/* whether we have positions */
unsigned
int
in_length
;
unsigned
int
len
;
unsigned
int
out_length
;
unsigned
int
in_pos
;
...
...
src/hb-buffer.cc
浏览文件 @
6960350b
...
...
@@ -43,7 +43,7 @@ static hb_buffer_t _hb_buffer_nil = {
*
* As an optimization, both info and out_info may point to the
* same piece of memory, which is owned by info. This remains the
* case as long as out_length doesn't exceed
in_length
at any time.
* case as long as out_length doesn't exceed
len
at any time.
* In that case, swap() is no-op and the glyph operations operate mostly
* in-place.
*
...
...
@@ -181,7 +181,7 @@ hb_buffer_clear (hb_buffer_t *buffer)
{
buffer
->
have_output
=
FALSE
;
buffer
->
have_positions
=
FALSE
;
buffer
->
in_length
=
0
;
buffer
->
len
=
0
;
buffer
->
out_length
=
0
;
buffer
->
in_pos
=
0
;
buffer
->
out_info
=
buffer
->
info
;
...
...
@@ -224,9 +224,9 @@ hb_buffer_add_glyph (hb_buffer_t *buffer,
{
hb_internal_glyph_info_t
*
glyph
;
hb_buffer_ensure
(
buffer
,
buffer
->
in_length
+
1
);
hb_buffer_ensure
(
buffer
,
buffer
->
len
+
1
);
glyph
=
&
buffer
->
info
[
buffer
->
in_length
];
glyph
=
&
buffer
->
info
[
buffer
->
len
];
glyph
->
codepoint
=
codepoint
;
glyph
->
mask
=
mask
;
glyph
->
cluster
=
cluster
;
...
...
@@ -234,7 +234,7 @@ hb_buffer_add_glyph (hb_buffer_t *buffer,
glyph
->
lig_id
=
0
;
glyph
->
gproperty
=
HB_BUFFER_GLYPH_PROPERTIES_UNKNOWN
;
buffer
->
in_length
++
;
buffer
->
len
++
;
}
...
...
@@ -262,7 +262,7 @@ hb_buffer_clear_positions (hb_buffer_t *buffer)
return
;
}
memset
(
buffer
->
pos
,
0
,
sizeof
(
buffer
->
pos
[
0
])
*
buffer
->
in_length
);
memset
(
buffer
->
pos
,
0
,
sizeof
(
buffer
->
pos
[
0
])
*
buffer
->
len
);
}
void
...
...
@@ -281,8 +281,8 @@ _hb_buffer_swap (hb_buffer_t *buffer)
buffer
->
pos
=
(
hb_internal_glyph_position_t
*
)
buffer
->
out_info
;
}
tmp
=
buffer
->
in_length
;
buffer
->
in_length
=
buffer
->
out_length
;
tmp
=
buffer
->
len
;
buffer
->
len
=
buffer
->
out_length
;
buffer
->
out_length
=
tmp
;
buffer
->
in_pos
=
0
;
...
...
@@ -439,7 +439,7 @@ _hb_buffer_next_glyph (hb_buffer_t *buffer)
unsigned
int
hb_buffer_get_length
(
hb_buffer_t
*
buffer
)
{
return
buffer
->
in_length
;
return
buffer
->
len
;
}
/* Return value valid as long as buffer not modified */
...
...
@@ -489,10 +489,10 @@ reverse_range (hb_buffer_t *buffer,
void
hb_buffer_reverse
(
hb_buffer_t
*
buffer
)
{
if
(
unlikely
(
!
buffer
->
in_length
))
if
(
unlikely
(
!
buffer
->
len
))
return
;
reverse_range
(
buffer
,
0
,
buffer
->
in_length
);
reverse_range
(
buffer
,
0
,
buffer
->
len
);
}
void
...
...
@@ -500,12 +500,12 @@ hb_buffer_reverse_clusters (hb_buffer_t *buffer)
{
unsigned
int
i
,
start
,
count
,
last_cluster
;
if
(
unlikely
(
!
buffer
->
in_length
))
if
(
unlikely
(
!
buffer
->
len
))
return
;
hb_buffer_reverse
(
buffer
);
count
=
buffer
->
in_length
;
count
=
buffer
->
len
;
start
=
0
;
last_cluster
=
buffer
->
info
[
0
].
cluster
;
for
(
i
=
1
;
i
<
count
;
i
++
)
{
...
...
src/hb-ot-layout-gpos-private.hh
浏览文件 @
6960350b
...
...
@@ -619,7 +619,7 @@ struct PairPosFormat1
inline
bool
apply
(
hb_apply_context_t
*
c
)
const
{
TRACE_APPLY
();
unsigned
int
end
=
MIN
(
c
->
buffer
->
in_length
,
c
->
buffer
->
in_pos
+
c
->
context_length
);
unsigned
int
end
=
MIN
(
c
->
buffer
->
len
,
c
->
buffer
->
in_pos
+
c
->
context_length
);
if
(
unlikely
(
c
->
buffer
->
in_pos
+
2
>
end
))
return
false
;
...
...
@@ -681,7 +681,7 @@ struct PairPosFormat2
inline
bool
apply
(
hb_apply_context_t
*
c
)
const
{
TRACE_APPLY
();
unsigned
int
end
=
MIN
(
c
->
buffer
->
in_length
,
c
->
buffer
->
in_pos
+
c
->
context_length
);
unsigned
int
end
=
MIN
(
c
->
buffer
->
len
,
c
->
buffer
->
in_pos
+
c
->
context_length
);
if
(
unlikely
(
c
->
buffer
->
in_pos
+
2
>
end
))
return
false
;
...
...
@@ -1529,13 +1529,13 @@ struct PosLookup : Lookup
{
bool
ret
=
false
;
if
(
unlikely
(
!
buffer
->
in_length
))
if
(
unlikely
(
!
buffer
->
len
))
return
false
;
layout
->
info
.
gpos
.
last
=
HB_OT_LAYOUT_GPOS_NO_LAST
;
/* no last valid glyph for cursive pos. */
buffer
->
in_pos
=
0
;
while
(
buffer
->
in_pos
<
buffer
->
in_length
)
while
(
buffer
->
in_pos
<
buffer
->
len
)
{
bool
done
;
if
(
~
buffer
->
info
[
buffer
->
in_pos
].
mask
&
mask
)
...
...
src/hb-ot-layout-gsub-private.hh
浏览文件 @
6960350b
...
...
@@ -367,7 +367,7 @@ struct Ligature
TRACE_APPLY
();
unsigned
int
i
,
j
;
unsigned
int
count
=
component
.
len
;
unsigned
int
end
=
MIN
(
c
->
buffer
->
in_length
,
c
->
buffer
->
in_pos
+
c
->
context_length
);
unsigned
int
end
=
MIN
(
c
->
buffer
->
len
,
c
->
buffer
->
in_pos
+
c
->
context_length
);
if
(
unlikely
(
c
->
buffer
->
in_pos
+
count
>
end
))
return
false
;
...
...
@@ -820,7 +820,7 @@ struct SubstLookup : Lookup
{
bool
ret
=
false
;
if
(
unlikely
(
!
buffer
->
in_length
))
if
(
unlikely
(
!
buffer
->
len
))
return
false
;
if
(
likely
(
!
is_reverse
()))
...
...
@@ -828,7 +828,7 @@ struct SubstLookup : Lookup
/* in/out forward substitution */
buffer
->
clear_output
();
buffer
->
in_pos
=
0
;
while
(
buffer
->
in_pos
<
buffer
->
in_length
)
while
(
buffer
->
in_pos
<
buffer
->
len
)
{
if
((
~
buffer
->
info
[
buffer
->
in_pos
].
mask
&
mask
)
&&
apply_once
(
layout
,
buffer
,
NO_CONTEXT
,
MAX_NESTING_LEVEL
))
...
...
@@ -843,7 +843,7 @@ struct SubstLookup : Lookup
else
{
/* in-place backward substitution */
buffer
->
in_pos
=
buffer
->
in_length
-
1
;
buffer
->
in_pos
=
buffer
->
len
-
1
;
do
{
if
((
~
buffer
->
info
[
buffer
->
in_pos
].
mask
&
mask
)
&&
...
...
src/hb-ot-layout-gsubgpos-private.hh
浏览文件 @
6960350b
...
...
@@ -88,7 +88,7 @@ static inline bool match_input (hb_apply_context_t *c,
unsigned
int
*
context_length_out
)
{
unsigned
int
i
,
j
;
unsigned
int
end
=
MIN
(
c
->
buffer
->
in_length
,
c
->
buffer
->
in_pos
+
c
->
context_length
);
unsigned
int
end
=
MIN
(
c
->
buffer
->
len
,
c
->
buffer
->
in_pos
+
c
->
context_length
);
if
(
unlikely
(
c
->
buffer
->
in_pos
+
count
>
end
))
return
false
;
...
...
@@ -143,7 +143,7 @@ static inline bool match_lookahead (hb_apply_context_t *c,
unsigned
int
offset
)
{
unsigned
int
i
,
j
;
unsigned
int
end
=
MIN
(
c
->
buffer
->
in_length
,
c
->
buffer
->
in_pos
+
c
->
context_length
);
unsigned
int
end
=
MIN
(
c
->
buffer
->
len
,
c
->
buffer
->
in_pos
+
c
->
context_length
);
if
(
unlikely
(
c
->
buffer
->
in_pos
+
offset
+
count
>
end
))
return
false
;
...
...
@@ -185,7 +185,7 @@ static inline bool apply_lookup (hb_apply_context_t *c,
const
LookupRecord
lookupRecord
[],
/* Array of LookupRecords--in design order */
apply_lookup_func_t
apply_func
)
{
unsigned
int
end
=
MIN
(
c
->
buffer
->
in_length
,
c
->
buffer
->
in_pos
+
c
->
context_length
);
unsigned
int
end
=
MIN
(
c
->
buffer
->
len
,
c
->
buffer
->
in_pos
+
c
->
context_length
);
if
(
unlikely
(
c
->
buffer
->
in_pos
+
count
>
end
))
return
false
;
...
...
@@ -520,7 +520,7 @@ static inline bool chain_context_lookup (hb_apply_context_t *c,
{
/* First guess */
if
(
unlikely
(
c
->
buffer
->
out_length
<
backtrackCount
||
c
->
buffer
->
in_pos
+
inputCount
+
lookaheadCount
>
c
->
buffer
->
in_length
||
c
->
buffer
->
in_pos
+
inputCount
+
lookaheadCount
>
c
->
buffer
->
len
||
inputCount
+
lookaheadCount
>
c
->
context_length
))
return
false
;
...
...
src/hb-shape.cc
浏览文件 @
6960350b
...
...
@@ -48,7 +48,7 @@ hb_form_clusters (hb_buffer_t *buffer)
{
unsigned
int
count
;
count
=
buffer
->
in_length
;
count
=
buffer
->
len
;
for
(
buffer
->
in_pos
=
1
;
buffer
->
in_pos
<
count
;
buffer
->
in_pos
++
)
if
(
buffer
->
unicode
->
get_general_category
(
buffer
->
info
[
buffer
->
in_pos
].
codepoint
)
==
HB_CATEGORY_NON_SPACING_MARK
)
buffer
->
info
[
buffer
->
in_pos
].
cluster
=
buffer
->
info
[
buffer
->
in_pos
-
1
].
cluster
;
...
...
@@ -82,7 +82,7 @@ hb_mirror_chars (hb_buffer_t *buffer)
if
(
HB_DIRECTION_IS_FORWARD
(
buffer
->
direction
))
return
;
count
=
buffer
->
in_length
;
count
=
buffer
->
len
;
for
(
buffer
->
in_pos
=
0
;
buffer
->
in_pos
<
count
;
buffer
->
in_pos
++
)
{
buffer
->
info
[
buffer
->
in_pos
].
codepoint
=
get_mirroring
(
buffer
->
info
[
buffer
->
in_pos
].
codepoint
);
}
...
...
@@ -95,9 +95,9 @@ hb_map_glyphs (hb_font_t *font,
{
unsigned
int
count
;
if
(
unlikely
(
!
buffer
->
in_length
))
if
(
unlikely
(
!
buffer
->
len
))
return
;
count
=
buffer
->
in_length
-
1
;
count
=
buffer
->
len
-
1
;
for
(
buffer
->
in_pos
=
0
;
buffer
->
in_pos
<
count
;
buffer
->
in_pos
++
)
{
if
(
unlikely
(
is_variation_selector
(
buffer
->
info
[
buffer
->
in_pos
+
1
].
codepoint
)))
{
buffer
->
info
[
buffer
->
in_pos
].
codepoint
=
hb_font_get_glyph
(
font
,
face
,
buffer
->
info
[
buffer
->
in_pos
].
codepoint
,
buffer
->
info
[
buffer
->
in_pos
+
1
].
codepoint
);
...
...
@@ -154,7 +154,7 @@ hb_position_default (hb_font_t *font,
hb_buffer_clear_positions
(
buffer
);
count
=
buffer
->
in_length
;
count
=
buffer
->
len
;
for
(
buffer
->
in_pos
=
0
;
buffer
->
in_pos
<
count
;
buffer
->
in_pos
++
)
{
hb_glyph_metrics_t
metrics
;
hb_font_get_glyph_metrics
(
font
,
face
,
buffer
->
info
[
buffer
->
in_pos
].
codepoint
,
&
metrics
);
...
...
@@ -193,7 +193,7 @@ hb_truetype_kern (hb_font_t *font,
unsigned
int
count
;
/* TODO Check for kern=0 */
count
=
buffer
->
in_length
;
count
=
buffer
->
len
;
for
(
buffer
->
in_pos
=
1
;
buffer
->
in_pos
<
count
;
buffer
->
in_pos
++
)
{
hb_position_t
kern
,
kern1
,
kern2
;
kern
=
hb_font_get_kerning
(
font
,
face
,
buffer
->
info
[
buffer
->
in_pos
-
1
].
codepoint
,
buffer
->
info
[
buffer
->
in_pos
].
codepoint
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录