Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
cbe5a4e0
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看板
提交
cbe5a4e0
编写于
8月 10, 2009
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[HB] Reuse the positions array as alt string array
上级
5c441884
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
9 addition
and
20 deletion
+9
-20
src/hb-buffer-private.h
src/hb-buffer-private.h
+0
-1
src/hb-buffer.c
src/hb-buffer.c
+9
-19
未找到文件。
src/hb-buffer-private.h
浏览文件 @
cbe5a4e0
...
...
@@ -78,7 +78,6 @@ struct _hb_buffer_t {
hb_internal_glyph_info_t
*
in_string
;
hb_internal_glyph_info_t
*
out_string
;
hb_internal_glyph_info_t
*
alt_string
;
hb_internal_glyph_position_t
*
positions
;
hb_direction_t
direction
;
...
...
src/hb-buffer.c
浏览文件 @
cbe5a4e0
...
...
@@ -46,11 +46,10 @@ static hb_buffer_t _hb_buffer_nil = {
* in-place.
*
* As soon as out_string gets longer than in_string, out_string is moved over
* to an alternate buffer (alt_string), and its current contents (out_length
* entries) are copied to the alt buffer. This should all remain transparent
* to the user. swap() then switches in_string and alt_string. alt_string is
* not allocated until its needed, but after that it's grown with in_string
* unconditionally.
* to an alternate buffer (which we reuse the positions buffer for!), and its
* current contents (out_length entries) are copied to the alt buffer.
* This should all remain transparent to the user. swap() then switches
* in_string and out_string.
*/
/* XXX err handling */
...
...
@@ -63,10 +62,10 @@ hb_buffer_ensure_separate (hb_buffer_t *buffer, unsigned int size)
hb_buffer_ensure
(
buffer
,
size
);
if
(
buffer
->
out_string
==
buffer
->
in_string
)
{
if
(
!
buffer
->
alt_string
)
buffer
->
alt_string
=
calloc
(
buffer
->
allocated
,
sizeof
(
buffer
->
alt_string
[
0
]));
if
(
!
buffer
->
positions
)
buffer
->
positions
=
calloc
(
buffer
->
allocated
,
sizeof
(
buffer
->
positions
[
0
]));
buffer
->
out_string
=
buffer
->
alt_string
;
buffer
->
out_string
=
buffer
->
positions
;
memcpy
(
buffer
->
out_string
,
buffer
->
in_string
,
buffer
->
out_length
*
sizeof
(
buffer
->
out_string
[
0
]));
}
}
...
...
@@ -105,7 +104,6 @@ hb_buffer_destroy (hb_buffer_t *buffer)
HB_OBJECT_DO_DESTROY
(
buffer
);
free
(
buffer
->
in_string
);
free
(
buffer
->
alt_string
);
free
(
buffer
->
positions
);
free
(
buffer
);
...
...
@@ -138,19 +136,12 @@ hb_buffer_ensure (hb_buffer_t *buffer, unsigned int size)
if
(
buffer
->
out_string
!=
buffer
->
in_string
)
{
buffer
->
in_string
=
realloc
(
buffer
->
in_string
,
new_allocated
*
sizeof
(
buffer
->
in_string
[
0
]));
buffer
->
alt_string
=
realloc
(
buffer
->
alt_string
,
new_allocated
*
sizeof
(
buffer
->
alt_string
[
0
]));
buffer
->
out_string
=
buffer
->
alt_string
;
buffer
->
out_string
=
buffer
->
positions
;
}
else
{
buffer
->
in_string
=
realloc
(
buffer
->
in_string
,
new_allocated
*
sizeof
(
buffer
->
in_string
[
0
]));
buffer
->
out_string
=
buffer
->
in_string
;
if
(
buffer
->
alt_string
)
{
free
(
buffer
->
alt_string
);
buffer
->
alt_string
=
NULL
;
}
}
buffer
->
allocated
=
new_allocated
;
...
...
@@ -221,8 +212,7 @@ _hb_buffer_swap (hb_buffer_t *buffer)
hb_internal_glyph_info_t
*
tmp_string
;
tmp_string
=
buffer
->
in_string
;
buffer
->
in_string
=
buffer
->
out_string
;
buffer
->
out_string
=
tmp_string
;
buffer
->
alt_string
=
buffer
->
out_string
;
buffer
->
positions
=
buffer
->
out_string
=
tmp_string
;
}
tmp
=
buffer
->
in_length
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录