Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
eba1c16a
T
Third Party Harfbuzz
项目概览
OpenHarmony
/
Third Party Harfbuzz
12 个月 前同步成功
通知
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
eba1c16a
编写于
5月 08, 2018
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Always lock blob in sanitize. Remove blob->lock_as() in favor of blob->lock()
上级
b4fa5050
变更
17
隐藏空白更改
内联
并排
Showing
17 changed file
with
34 addition
and
36 deletion
+34
-36
src/dump-emoji.cc
src/dump-emoji.cc
+2
-2
src/dump-fon.cc
src/dump-fon.cc
+1
-1
src/hb-aat-layout.cc
src/hb-aat-layout.cc
+2
-2
src/hb-blob-private.hh
src/hb-blob-private.hh
+0
-6
src/hb-face.cc
src/hb-face.cc
+4
-4
src/hb-open-type-private.hh
src/hb-open-type-private.hh
+6
-2
src/hb-ot-cmap-table.hh
src/hb-ot-cmap-table.hh
+1
-1
src/hb-ot-color-cbdt-table.hh
src/hb-ot-color-cbdt-table.hh
+2
-2
src/hb-ot-color-sbix-table.hh
src/hb-ot-color-sbix-table.hh
+1
-1
src/hb-ot-color-svg-table.hh
src/hb-ot-color-svg-table.hh
+1
-1
src/hb-ot-glyf-table.hh
src/hb-ot-glyf-table.hh
+3
-3
src/hb-ot-hmtx-table.hh
src/hb-ot-hmtx-table.hh
+4
-4
src/hb-ot-kern-table.hh
src/hb-ot-kern-table.hh
+1
-1
src/hb-ot-layout.cc
src/hb-ot-layout.cc
+3
-3
src/hb-ot-post-table.hh
src/hb-ot-post-table.hh
+1
-1
src/hb-subset.cc
src/hb-subset.cc
+1
-1
src/main.cc
src/main.cc
+1
-1
未找到文件。
src/dump-emoji.cc
浏览文件 @
eba1c16a
...
...
@@ -240,11 +240,11 @@ int main (int argc, char **argv)
OT
::
Sanitizer
<
OT
::
COLR
>
sanitizerCOLR
;
hb_blob_t
*
colr_blob
=
sanitizerCOLR
.
sanitize
(
face
->
reference_table
(
HB_OT_TAG_COLR
));
const
OT
::
COLR
*
colr
=
colr_blob
->
lock_
as
<
OT
::
COLR
>
();
const
OT
::
COLR
*
colr
=
colr_blob
->
as
<
OT
::
COLR
>
();
OT
::
Sanitizer
<
OT
::
CPAL
>
sanitizerCPAL
;
hb_blob_t
*
cpal_blob
=
sanitizerCPAL
.
sanitize
(
face
->
reference_table
(
HB_OT_TAG_CPAL
));
const
OT
::
CPAL
*
cpal
=
cpal_blob
->
lock_
as
<
OT
::
CPAL
>
();
const
OT
::
CPAL
*
cpal
=
cpal_blob
->
as
<
OT
::
CPAL
>
();
cairo_font_face_t
*
cairo_face
;
{
...
...
src/dump-fon.cc
浏览文件 @
eba1c16a
...
...
@@ -542,7 +542,7 @@ int main (int argc, char** argv) {
OT
::
Sanitizer
<
LE_IMAGE_DOS_HEADER
>
sanitizer
;
hb_blob_t
*
font_blob
=
sanitizer
.
sanitize
(
blob
);
const
LE_IMAGE_DOS_HEADER
*
dos_header
=
font_blob
->
lock_
as
<
LE_IMAGE_DOS_HEADER
>
();
const
LE_IMAGE_DOS_HEADER
*
dos_header
=
font_blob
->
as
<
LE_IMAGE_DOS_HEADER
>
();
const
NE_RESOURCE_TABLE
&
rtable
=
dos_header
->
get_os2_header
().
get_resource_table
();
int
shift
=
rtable
.
get_shift_value
();
...
...
src/hb-aat-layout.cc
浏览文件 @
eba1c16a
...
...
@@ -118,11 +118,11 @@ _get_trak (hb_face_t *face, hb_blob_t **blob = nullptr)
// OT::Sanitizer<AAT::morx> sanitizer;
// sanitizer.set_num_glyphs (face->get_num_glyphs ());
// hb_blob_t *morx_blob = sanitizer.sanitize (face->reference_table (HB_AAT_TAG_morx));
// morx_blob->
lock_
as<AAT::morx> ();
// morx_blob->as<AAT::morx> ();
// if (0)
// {
// morx_blob->
lock_
as<AAT::Lookup<OT::GlyphID> > ()->get_value (1, face->get_num_glyphs ());
// morx_blob->as<AAT::Lookup<OT::GlyphID> > ()->get_value (1, face->get_num_glyphs ());
// }
// }
...
...
src/hb-blob-private.hh
浏览文件 @
eba1c16a
...
...
@@ -69,12 +69,6 @@ struct hb_blob_t
{
return
unlikely
(
!
data
)
?
&
Null
(
Type
)
:
reinterpret_cast
<
const
Type
*>
(
data
);
}
template
<
typename
Type
>
inline
const
Type
*
lock_as
(
void
)
{
lock
();
return
unlikely
(
!
data
)
?
&
Null
(
Type
)
:
reinterpret_cast
<
const
Type
*>
(
data
);
}
public:
hb_object_header_t
header
;
...
...
src/hb-face.cc
浏览文件 @
eba1c16a
...
...
@@ -135,7 +135,7 @@ _hb_face_for_data_reference_table (hb_face_t *face HB_UNUSED, hb_tag_t tag, void
if
(
tag
==
HB_TAG_NONE
)
return
hb_blob_reference
(
data
->
blob
);
const
OT
::
OpenTypeFontFile
&
ot_file
=
*
data
->
blob
->
lock_
as
<
OT
::
OpenTypeFontFile
>
();
const
OT
::
OpenTypeFontFile
&
ot_file
=
*
data
->
blob
->
as
<
OT
::
OpenTypeFontFile
>
();
const
OT
::
OpenTypeFontFace
&
ot_face
=
ot_file
.
get_face
(
data
->
index
);
const
OT
::
OpenTypeTable
&
table
=
ot_face
.
get_table_by_tag
(
tag
);
...
...
@@ -426,7 +426,7 @@ void
hb_face_t
::
load_upem
(
void
)
const
{
hb_blob_t
*
head_blob
=
OT
::
Sanitizer
<
OT
::
head
>
().
sanitize
(
reference_table
(
HB_OT_TAG_head
));
const
OT
::
head
*
head_table
=
head_blob
->
lock_
as
<
OT
::
head
>
();
const
OT
::
head
*
head_table
=
head_blob
->
as
<
OT
::
head
>
();
upem
=
head_table
->
get_upem
();
hb_blob_destroy
(
head_blob
);
}
...
...
@@ -470,7 +470,7 @@ void
hb_face_t
::
load_num_glyphs
(
void
)
const
{
hb_blob_t
*
maxp_blob
=
OT
::
Sanitizer
<
OT
::
maxp
>
().
sanitize
(
reference_table
(
HB_OT_TAG_maxp
));
const
OT
::
maxp
*
maxp_table
=
maxp_blob
->
lock_
as
<
OT
::
maxp
>
();
const
OT
::
maxp
*
maxp_table
=
maxp_blob
->
as
<
OT
::
maxp
>
();
num_glyphs
=
maxp_table
->
get_num_glyphs
();
hb_blob_destroy
(
maxp_blob
);
}
...
...
@@ -500,7 +500,7 @@ hb_face_get_table_tags (hb_face_t *face,
hb_face_for_data_closure_t
*
data
=
(
hb_face_for_data_closure_t
*
)
face
->
user_data
;
const
OT
::
OpenTypeFontFile
&
ot_file
=
*
data
->
blob
->
lock_
as
<
OT
::
OpenTypeFontFile
>
();
const
OT
::
OpenTypeFontFile
&
ot_file
=
*
data
->
blob
->
as
<
OT
::
OpenTypeFontFile
>
();
const
OT
::
OpenTypeFontFace
&
ot_face
=
ot_file
.
get_face
(
data
->
index
);
return
ot_face
.
get_table_tags
(
start_offset
,
table_count
,
table_tags
);
...
...
src/hb-open-type-private.hh
浏览文件 @
eba1c16a
...
...
@@ -344,8 +344,12 @@ struct Sanitizer
DEBUG_MSG_FUNC
(
SANITIZE
,
c
->
start
,
sane
?
"PASSED"
:
"FAILED"
);
if
(
sane
)
{
blob
->
lock
();
return
blob
;
else
{
}
else
{
hb_blob_destroy
(
blob
);
return
hb_blob_get_empty
();
}
...
...
@@ -1250,7 +1254,7 @@ struct hb_lazy_table_loader_t
if
(
unlikely
(
!
p
))
{
hb_blob_t
*
blob_
=
OT
::
Sanitizer
<
T
>
().
sanitize
(
face
->
reference_table
(
T
::
tableTag
));
p
=
const_cast
<
T
*>
(
blob_
->
lock_
as
<
T
>
());
p
=
const_cast
<
T
*>
(
blob_
->
as
<
T
>
());
if
(
!
hb_atomic_ptr_cmpexch
(
const_cast
<
T
**>
(
&
instance
),
nullptr
,
p
))
{
hb_blob_destroy
(
blob_
);
...
...
src/hb-ot-cmap-table.hh
浏览文件 @
eba1c16a
...
...
@@ -661,7 +661,7 @@ struct cmap
inline
void
init
(
hb_face_t
*
face
)
{
this
->
blob
=
OT
::
Sanitizer
<
OT
::
cmap
>
().
sanitize
(
face
->
reference_table
(
HB_OT_TAG_cmap
));
const
OT
::
cmap
*
cmap
=
this
->
blob
->
lock_
as
<
OT
::
cmap
>
();
const
OT
::
cmap
*
cmap
=
this
->
blob
->
as
<
OT
::
cmap
>
();
const
OT
::
CmapSubtable
*
subtable
=
nullptr
;
const
OT
::
CmapSubtableFormat14
*
subtable_uvs
=
nullptr
;
...
...
src/hb-ot-color-cbdt-table.hh
浏览文件 @
eba1c16a
...
...
@@ -403,8 +403,8 @@ struct CBDT
cbdt
=
nullptr
;
return
;
/* Not a bitmap font. */
}
cblc
=
cblc_blob
->
lock_
as
<
CBLC
>
();
cbdt
=
cbdt_blob
->
lock_
as
<
CBDT
>
();
cblc
=
cblc_blob
->
as
<
CBLC
>
();
cbdt
=
cbdt_blob
->
as
<
CBDT
>
();
}
...
...
src/hb-ot-color-sbix-table.hh
浏览文件 @
eba1c16a
...
...
@@ -102,7 +102,7 @@ struct sbix
sanitizer
.
set_num_glyphs
(
num_glyphs
);
sbix_blob
=
sanitizer
.
sanitize
(
face
->
reference_table
(
HB_OT_TAG_sbix
));
sbix_len
=
hb_blob_get_length
(
sbix_blob
);
sbix_table
=
sbix_blob
->
lock_
as
<
OT
::
sbix
>
();
sbix_table
=
sbix_blob
->
as
<
OT
::
sbix
>
();
}
...
...
src/hb-ot-color-svg-table.hh
浏览文件 @
eba1c16a
...
...
@@ -99,7 +99,7 @@ struct SVG
OT
::
Sanitizer
<
OT
::
SVG
>
sanitizer
;
svg_blob
=
sanitizer
.
sanitize
(
face
->
reference_table
(
HB_OT_TAG_SVG
));
svg_len
=
hb_blob_get_length
(
svg_blob
);
svg
=
svg_blob
->
lock_
as
<
OT
::
SVG
>
();
svg
=
svg_blob
->
as
<
OT
::
SVG
>
();
}
...
...
src/hb-ot-glyf-table.hh
浏览文件 @
eba1c16a
...
...
@@ -237,7 +237,7 @@ struct glyf
memset
(
this
,
0
,
sizeof
(
accelerator_t
));
hb_blob_t
*
head_blob
=
Sanitizer
<
head
>
().
sanitize
(
face
->
reference_table
(
HB_OT_TAG_head
));
const
head
*
head_table
=
head_blob
->
lock_
as
<
head
>
();
const
head
*
head_table
=
head_blob
->
as
<
head
>
();
if
(
head_table
==
&
Null
(
head
)
||
(
unsigned
int
)
head_table
->
indexToLocFormat
>
1
||
head_table
->
glyphDataFormat
!=
0
)
{
/* head table is not present, or in an unknown format. Leave num_glyphs=0, that takes care of disabling us. */
...
...
@@ -248,9 +248,9 @@ struct glyf
hb_blob_destroy
(
head_blob
);
loca_blob
=
Sanitizer
<
loca
>
().
sanitize
(
face
->
reference_table
(
HB_OT_TAG_loca
));
loca_table
=
loca_blob
->
lock_
as
<
loca
>
();
loca_table
=
loca_blob
->
as
<
loca
>
();
glyf_blob
=
Sanitizer
<
glyf
>
().
sanitize
(
face
->
reference_table
(
HB_OT_TAG_glyf
));
glyf_table
=
glyf_blob
->
lock_
as
<
glyf
>
();
glyf_table
=
glyf_blob
->
as
<
glyf
>
();
num_glyphs
=
MAX
(
1u
,
hb_blob_get_length
(
loca_blob
)
/
(
short_offset
?
2
:
4
))
-
1
;
glyf_len
=
hb_blob_get_length
(
glyf_blob
);
...
...
src/hb-ot-hmtx-table.hh
浏览文件 @
eba1c16a
...
...
@@ -196,7 +196,7 @@ struct hmtxvmtx
if
(
T
::
os2Tag
)
{
hb_blob_t
*
os2_blob
=
Sanitizer
<
os2
>
().
sanitize
(
face
->
reference_table
(
T
::
os2Tag
));
const
os2
*
os2_table
=
os2_blob
->
lock_
as
<
os2
>
();
const
os2
*
os2_table
=
os2_blob
->
as
<
os2
>
();
#define USE_TYPO_METRICS (1u<<7)
if
(
0
!=
(
os2_table
->
fsSelection
&
USE_TYPO_METRICS
))
{
...
...
@@ -209,7 +209,7 @@ struct hmtxvmtx
}
hb_blob_t
*
_hea_blob
=
Sanitizer
<
H
>
().
sanitize
(
face
->
reference_table
(
H
::
tableTag
));
const
H
*
_hea_table
=
_hea_blob
->
lock_
as
<
H
>
();
const
H
*
_hea_table
=
_hea_blob
->
as
<
H
>
();
num_advances
=
_hea_table
->
numberOfLongMetrics
;
if
(
!
got_font_extents
)
{
...
...
@@ -238,10 +238,10 @@ struct hmtxvmtx
hb_blob_destroy
(
blob
);
blob
=
hb_blob_get_empty
();
}
table
=
blob
->
lock_
as
<
hmtxvmtx
>
();
table
=
blob
->
as
<
hmtxvmtx
>
();
var_blob
=
Sanitizer
<
HVARVVAR
>
().
sanitize
(
face
->
reference_table
(
T
::
variationsTag
));
var_table
=
var_blob
->
lock_
as
<
HVARVVAR
>
();
var_table
=
var_blob
->
as
<
HVARVVAR
>
();
}
inline
void
fini
(
void
)
...
...
src/hb-ot-kern-table.hh
浏览文件 @
eba1c16a
...
...
@@ -363,7 +363,7 @@ struct kern
inline
void
init
(
hb_face_t
*
face
)
{
blob
=
Sanitizer
<
kern
>
().
sanitize
(
face
->
reference_table
(
HB_OT_TAG_kern
));
table
=
blob
->
lock_
as
<
kern
>
();
table
=
blob
->
as
<
kern
>
();
table_length
=
hb_blob_get_length
(
blob
);
}
inline
void
fini
(
void
)
...
...
src/hb-ot-layout.cc
浏览文件 @
eba1c16a
...
...
@@ -59,13 +59,13 @@ _hb_ot_layout_create (hb_face_t *face)
return
nullptr
;
layout
->
gdef_blob
=
OT
::
Sanitizer
<
OT
::
GDEF
>
().
sanitize
(
face
->
reference_table
(
HB_OT_TAG_GDEF
));
layout
->
gdef
=
layout
->
gdef_blob
->
lock_
as
<
OT
::
GDEF
>
();
layout
->
gdef
=
layout
->
gdef_blob
->
as
<
OT
::
GDEF
>
();
layout
->
gsub_blob
=
OT
::
Sanitizer
<
OT
::
GSUB
>
().
sanitize
(
face
->
reference_table
(
HB_OT_TAG_GSUB
));
layout
->
gsub
=
layout
->
gsub_blob
->
lock_
as
<
OT
::
GSUB
>
();
layout
->
gsub
=
layout
->
gsub_blob
->
as
<
OT
::
GSUB
>
();
layout
->
gpos_blob
=
OT
::
Sanitizer
<
OT
::
GPOS
>
().
sanitize
(
face
->
reference_table
(
HB_OT_TAG_GPOS
));
layout
->
gpos
=
layout
->
gpos_blob
->
lock_
as
<
OT
::
GPOS
>
();
layout
->
gpos
=
layout
->
gpos_blob
->
as
<
OT
::
GPOS
>
();
layout
->
math
.
init
(
face
);
layout
->
fvar
.
init
(
face
);
...
...
src/hb-ot-post-table.hh
浏览文件 @
eba1c16a
...
...
@@ -110,7 +110,7 @@ struct post
inline
void
init
(
hb_face_t
*
face
)
{
blob
=
Sanitizer
<
post
>
().
sanitize
(
face
->
reference_table
(
HB_OT_TAG_post
));
const
post
*
table
=
blob
->
lock_
as
<
post
>
();
const
post
*
table
=
blob
->
as
<
post
>
();
unsigned
int
table_length
=
hb_blob_get_length
(
blob
);
version
=
table
->
version
.
to_int
();
...
...
src/hb-subset.cc
浏览文件 @
eba1c16a
...
...
@@ -87,7 +87,7 @@ _subset (hb_subset_plan_t *plan)
OT
::
Sanitizer
<
TableType
>
sanitizer
;
hb_blob_t
*
source_blob
=
sanitizer
.
sanitize
(
plan
->
source
->
reference_table
(
TableType
::
tableTag
));
const
TableType
*
table
=
source_blob
->
lock_
as
<
TableType
>
();
const
TableType
*
table
=
source_blob
->
as
<
TableType
>
();
hb_tag_t
tag
=
TableType
::
tableTag
;
hb_bool_t
result
=
false
;
...
...
src/main.cc
浏览文件 @
eba1c16a
...
...
@@ -56,7 +56,7 @@ main (int argc, char **argv)
Sanitizer
<
OpenTypeFontFile
>
sanitizer
;
hb_blob_t
*
font_blob
=
sanitizer
.
sanitize
(
blob
);
const
OpenTypeFontFile
*
sanitized
=
font_blob
->
lock_
as
<
OpenTypeFontFile
>
();
const
OpenTypeFontFile
*
sanitized
=
font_blob
->
as
<
OpenTypeFontFile
>
();
if
(
sanitized
==
&
Null
(
OpenTypeFontFile
))
{
printf
(
"Sanitization of the file wasn't successful. Exit"
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录