Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
1f810daf
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看板
提交
1f810daf
编写于
1月 09, 2017
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Port math table to hb_lazy_table_loader_t
上级
ebbcc111
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
23 addition
and
27 deletion
+23
-27
src/hb-open-type-private.hh
src/hb-open-type-private.hh
+17
-5
src/hb-ot-layout-private.hh
src/hb-ot-layout-private.hh
+2
-2
src/hb-ot-layout.cc
src/hb-ot-layout.cc
+3
-4
src/hb-ot-math.cc
src/hb-ot-math.cc
+1
-16
未找到文件。
src/hb-open-type-private.hh
浏览文件 @
1f810daf
...
...
@@ -1064,6 +1064,7 @@ struct SortedArrayOf : ArrayOf<Type, LenType>
/* Lazy struct and blob loaders. */
/* Logic is shared between hb_lazy_loader_t and hb_lazy_table_loader_t */
template
<
typename
T
>
struct
hb_lazy_loader_t
{
...
...
@@ -1082,7 +1083,7 @@ struct hb_lazy_loader_t
}
}
inline
const
T
*
operator
->
(
void
)
const
inline
const
T
*
get
(
void
)
const
{
retry:
T
*
p
=
(
T
*
)
hb_atomic_ptr_get
(
&
instance
);
...
...
@@ -1103,11 +1104,17 @@ struct hb_lazy_loader_t
return
p
;
}
inline
const
T
*
operator
->
(
void
)
const
{
return
get
();
}
private:
hb_face_t
*
face
;
T
*
instance
;
};
/* Logic is shared between hb_lazy_loader_t and hb_lazy_table_loader_t */
template
<
typename
T
>
struct
hb_lazy_table_loader_t
{
...
...
@@ -1123,14 +1130,14 @@ struct hb_lazy_table_loader_t
hb_blob_destroy
(
blob
);
}
inline
const
T
*
operator
->
(
void
)
const
inline
const
T
*
get
(
void
)
const
{
retry:
T
*
p
=
(
T
*
)
hb_atomic_ptr_get
(
&
instance
);
const
T
*
p
=
(
T
*
)
hb_atomic_ptr_get
(
&
instance
);
if
(
unlikely
(
!
p
))
{
hb_blob_t
*
blob_
=
OT
::
Sanitizer
<
T
>::
sanitize
(
face
->
reference_table
(
T
::
tableTag
));
p
=
OT
::
Sanitizer
<
T
>::
lock_instance
(
blob
);
p
=
OT
::
Sanitizer
<
T
>::
lock_instance
(
blob
_
);
if
(
!
hb_atomic_ptr_cmpexch
(
const_cast
<
T
**>
(
&
instance
),
NULL
,
p
))
{
hb_blob_destroy
(
blob_
);
...
...
@@ -1141,10 +1148,15 @@ struct hb_lazy_table_loader_t
return
p
;
}
inline
const
T
*
operator
->
(
void
)
const
{
return
get
();
}
private:
hb_face_t
*
face
;
T
*
instance
;
hb_blob_t
*
blob
;
mutable
hb_blob_t
*
blob
;
};
...
...
src/hb-ot-layout-private.hh
浏览文件 @
1f810daf
...
...
@@ -34,6 +34,7 @@
#include "hb-font-private.hh"
#include "hb-buffer-private.hh"
#include "hb-set-private.hh"
#include "hb-open-type-private.hh"
/* Private API corresponding to hb-ot-layout.h: */
...
...
@@ -153,12 +154,11 @@ struct hb_ot_layout_t
hb_blob_t
*
gdef_blob
;
hb_blob_t
*
gsub_blob
;
hb_blob_t
*
gpos_blob
;
hb_blob_t
*
math_blob
;
const
struct
OT
::
GDEF
*
gdef
;
const
struct
OT
::
GSUB
*
gsub
;
const
struct
OT
::
GPOS
*
gpos
;
const
struct
OT
::
MATH
*
math
;
OT
::
hb_lazy_table_loader_t
<
struct
OT
::
MATH
>
math
;
unsigned
int
gsub_lookup_count
;
unsigned
int
gpos_lookup_count
;
...
...
src/hb-ot-layout.cc
浏览文件 @
1f810daf
...
...
@@ -60,9 +60,7 @@ _hb_ot_layout_create (hb_face_t *face)
layout
->
gpos_blob
=
OT
::
Sanitizer
<
OT
::
GPOS
>::
sanitize
(
face
->
reference_table
(
HB_OT_TAG_GPOS
));
layout
->
gpos
=
OT
::
Sanitizer
<
OT
::
GPOS
>::
lock_instance
(
layout
->
gpos_blob
);
/* The MATH table is rarely used, so only try and load it in _get_math. */
layout
->
math_blob
=
NULL
;
layout
->
math
=
NULL
;
layout
->
math
.
init
(
face
);
{
/*
...
...
@@ -181,7 +179,8 @@ _hb_ot_layout_destroy (hb_ot_layout_t *layout)
hb_blob_destroy
(
layout
->
gdef_blob
);
hb_blob_destroy
(
layout
->
gsub_blob
);
hb_blob_destroy
(
layout
->
gpos_blob
);
hb_blob_destroy
(
layout
->
math_blob
);
layout
->
math
.
fini
();
free
(
layout
);
}
...
...
src/hb-ot-math.cc
浏览文件 @
1f810daf
...
...
@@ -37,22 +37,7 @@ _get_math (hb_face_t *face)
hb_ot_layout_t
*
layout
=
hb_ot_layout_from_face
(
face
);
retry:
const
OT
::
MATH
*
math
=
(
const
OT
::
MATH
*
)
hb_atomic_ptr_get
(
&
layout
->
math
);
if
(
unlikely
(
!
math
))
{
hb_blob_t
*
blob
=
OT
::
Sanitizer
<
OT
::
MATH
>::
sanitize
(
face
->
reference_table
(
HB_OT_TAG_MATH
));
math
=
OT
::
Sanitizer
<
OT
::
MATH
>::
lock_instance
(
blob
);
if
(
!
hb_atomic_ptr_cmpexch
(
&
layout
->
math
,
NULL
,
math
))
{
hb_blob_destroy
(
blob
);
goto
retry
;
}
layout
->
math_blob
=
blob
;
}
return
*
math
;
return
*
(
layout
->
math
.
get
());
}
/*
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录