Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
a3b97db9
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看板
提交
a3b97db9
编写于
8月 12, 2018
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[lazy] Port more to it
上级
69010909
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
38 addition
and
37 deletion
+38
-37
src/hb-shape.cc
src/hb-shape.cc
+38
-37
未找到文件。
src/hb-shape.cc
浏览文件 @
a3b97db9
...
...
@@ -32,6 +32,7 @@
#include "hb-shape-plan-private.hh"
#include "hb-buffer-private.hh"
#include "hb-font-private.hh"
#include "hb-machinery-private.hh"
/**
* SECTION:hb-shape
...
...
@@ -45,21 +46,50 @@
* contains the output glyphs and their positions.
**/
static
hb_atomic_ptr_t
<
const
char
**>
static_shaper_list
;
static
void
free_static_shaper_list
(
void
);
static
struct
hb_shaper_list_lazy_loader_t
:
hb_lazy_loader_t
<
const
char
*
,
hb_shaper_list_lazy_loader_t
>
{
static
inline
const
char
**
create
(
void
)
{
const
char
**
shaper_list
=
(
const
char
**
)
calloc
(
1
+
HB_SHAPERS_COUNT
,
sizeof
(
const
char
*
));
if
(
unlikely
(
!
shaper_list
))
return
nullptr
;
const
hb_shaper_pair_t
*
shapers
=
_hb_shapers_get
();
unsigned
int
i
;
for
(
i
=
0
;
i
<
HB_SHAPERS_COUNT
;
i
++
)
shaper_list
[
i
]
=
shapers
[
i
].
name
;
shaper_list
[
i
]
=
nullptr
;
#ifdef HB_USE_ATEXIT
atexit
(
free_static_shaper_list
);
#endif
return
shaper_list
;
}
static
inline
void
destroy
(
const
char
**
l
)
{
::
free
(
l
);
}
static
inline
const
char
**
get_null
(
void
)
{
static
const
char
*
nil_shaper_list
[]
=
{
nullptr
};
return
nil_shaper_list
;
}
}
static_shaper_list
;
#ifdef HB_USE_ATEXIT
static
void
free_static_shaper_list
(
void
)
{
retry:
const
char
**
shaper_list
=
static_shaper_list
.
get
();
if
(
unlikely
(
!
static_shaper_list
.
cmpexch
(
shaper_list
,
nullptr
)))
goto
retry
;
free
(
shaper_list
);
static_shaper_list
.
free
();
}
#endif
/**
* hb_shape_list_shapers:
*
...
...
@@ -73,36 +103,7 @@ retry:
const
char
**
hb_shape_list_shapers
(
void
)
{
retry:
const
char
**
shaper_list
=
static_shaper_list
.
get
();
if
(
unlikely
(
!
shaper_list
))
{
/* Not found; allocate one. */
shaper_list
=
(
const
char
**
)
calloc
(
1
+
HB_SHAPERS_COUNT
,
sizeof
(
const
char
*
));
if
(
unlikely
(
!
shaper_list
))
{
static
const
char
*
nil_shaper_list
[]
=
{
nullptr
};
return
nil_shaper_list
;
}
const
hb_shaper_pair_t
*
shapers
=
_hb_shapers_get
();
unsigned
int
i
;
for
(
i
=
0
;
i
<
HB_SHAPERS_COUNT
;
i
++
)
shaper_list
[
i
]
=
shapers
[
i
].
name
;
shaper_list
[
i
]
=
nullptr
;
if
(
unlikely
(
!
static_shaper_list
.
cmpexch
(
nullptr
,
shaper_list
)))
{
free
(
shaper_list
);
goto
retry
;
}
#ifdef HB_USE_ATEXIT
atexit
(
free_static_shaper_list
);
/* First person registers atexit() callback. */
#endif
}
return
shaper_list
;
return
static_shaper_list
.
get_unconst
();
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录