Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
747d2564
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看板
提交
747d2564
编写于
8月 12, 2018
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[lazy] Port more
上级
7bd508a0
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
37 addition
and
45 deletion
+37
-45
src/hb-machinery-private.hh
src/hb-machinery-private.hh
+0
-1
src/hb-shaper.cc
src/hb-shaper.cc
+35
-43
src/hb-uniscribe.cc
src/hb-uniscribe.cc
+2
-1
未找到文件。
src/hb-machinery-private.hh
浏览文件 @
747d2564
...
...
@@ -698,7 +698,6 @@ struct hb_lazy_loader_t : hb_data_wrapper_t<Data, WheresData>
inline
Returned
*
get_unconst
(
void
)
const
{
return
const_cast
<
Returned
*>
(
Funcs
::
convert
(
get_stored
()));
}
/* To be possibly overloaded by subclasses. */
static
inline
const
Returned
*
convert
(
const
Stored
*
p
)
{
return
p
;
}
static
inline
Returned
*
convert
(
Stored
*
p
)
{
return
p
;
}
/* By default null/init/fini the object. */
...
...
src/hb-shaper.cc
浏览文件 @
747d2564
...
...
@@ -26,7 +26,7 @@
#include "hb-private.hh"
#include "hb-shaper-private.hh"
#include "hb-
atomic
-private.hh"
#include "hb-
machinery
-private.hh"
static
const
hb_shaper_pair_t
all_shapers
[]
=
{
...
...
@@ -36,52 +36,28 @@ static const hb_shaper_pair_t all_shapers[] = {
};
/* Thread-safe, lock-free, shapers */
static
void
free_static_shapers
(
void
);
static
hb_atomic_ptr_t
<
const
hb_shaper_pair_t
>
static_shapers
;
#ifdef HB_USE_ATEXIT
static
void
free_static_shapers
(
void
)
static
struct
hb_shapers_lazy_loader_t
:
hb_lazy_loader_t
<
const
hb_shaper_pair_t
,
hb_shapers_lazy_loader_t
>
{
retry:
const
hb_shaper_pair_t
*
shapers
=
static_shapers
.
get
();
if
(
unlikely
(
!
static_shapers
.
cmpexch
(
shapers
,
nullptr
)))
goto
retry
;
if
(
unlikely
(
shapers
!=
all_shapers
))
free
((
void
*
)
shapers
);
}
#endif
const
hb_shaper_pair_t
*
_hb_shapers_get
(
void
)
{
retry:
hb_shaper_pair_t
*
shapers
=
const_cast
<
hb_shaper_pair_t
*>
(
static_shapers
.
get
());
if
(
unlikely
(
!
shapers
))
static
inline
hb_shaper_pair_t
*
create
(
void
)
{
char
*
env
=
getenv
(
"HB_SHAPER_LIST"
);
if
(
!
env
||
!*
env
)
{
(
void
)
static_shapers
.
cmpexch
(
nullptr
,
&
all_shapers
[
0
]);
return
(
const
hb_shaper_pair_t
*
)
all_shapers
;
}
if
(
!
env
||
!*
env
)
return
nullptr
;
/* Not found; allocate one. */
shapers
=
(
hb_shaper_pair_t
*
)
calloc
(
1
,
sizeof
(
all_shapers
));
hb_shaper_pair_t
*
shapers
=
(
hb_shaper_pair_t
*
)
calloc
(
1
,
sizeof
(
all_shapers
));
if
(
unlikely
(
!
shapers
))
{
(
void
)
static_shapers
.
cmpexch
(
nullptr
,
&
all_shapers
[
0
]);
return
(
const
hb_shaper_pair_t
*
)
all_shapers
;
}
return
nullptr
;
memcpy
(
shapers
,
all_shapers
,
sizeof
(
all_shapers
));
/* Reorder shaper list to prefer requested shapers. */
unsigned
int
i
=
0
;
char
*
end
,
*
p
=
env
;
for
(;;)
{
for
(;;)
{
end
=
strchr
(
p
,
','
);
if
(
!
end
)
end
=
p
+
strlen
(
p
);
...
...
@@ -103,16 +79,32 @@ retry:
p
=
end
+
1
;
}
if
(
unlikely
(
!
static_shapers
.
cmpexch
(
nullptr
,
shapers
)))
{
free
(
shapers
);
goto
retry
;
}
#ifdef HB_USE_ATEXIT
atexit
(
free_static_shapers
);
/* First person registers atexit() callback. */
atexit
(
free_static_shapers
);
#endif
return
shapers
;
}
static
inline
void
destroy
(
const
hb_shaper_pair_t
*
p
)
{
free
((
void
*
)
p
);
}
static
inline
const
hb_shaper_pair_t
*
get_null
(
void
)
{
return
all_shapers
;
}
}
static_shapers
;
return
shapers
;
#ifdef HB_USE_ATEXIT
static
void
free_static_shapers
(
void
)
{
static_shapers
.
free_instance
();
}
#endif
const
hb_shaper_pair_t
*
_hb_shapers_get
(
void
)
{
return
static_shapers
.
get_unconst
();
}
src/hb-uniscribe.cc
浏览文件 @
747d2564
...
...
@@ -190,7 +190,8 @@ hb_ScriptPlaceOpenType(
}
struct
hb_uniscribe_shaper_funcs_t
{
struct
hb_uniscribe_shaper_funcs_t
{
SIOT
ScriptItemizeOpenType
;
SSOT
ScriptShapeOpenType
;
SPOT
ScriptPlaceOpenType
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录