Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
5cb1ce86
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看板
提交
5cb1ce86
编写于
10月 25, 2018
作者:
E
Ebrahim Byagowi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[svg] Collapse SVGDocumentIndex into SVG
上级
4ceabb8c
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
20 addition
and
38 deletion
+20
-38
src/hb-ot-color-svg-table.hh
src/hb-ot-color-svg-table.hh
+18
-36
src/hb-ot-color.cc
src/hb-ot-color.cc
+1
-1
test/api/test-ot-color.c
test/api/test-ot-color.c
+1
-1
未找到文件。
src/hb-ot-color-svg-table.hh
浏览文件 @
5cb1ce86
...
...
@@ -50,7 +50,7 @@ struct SVGDocumentIndexEntry
return
b
->
cmp
(
*
a
);
}
inline
hb_blob_t
*
creat
e_blob
(
hb_blob_t
*
svg_blob
,
unsigned
int
index_offset
)
const
inline
hb_blob_t
*
referenc
e_blob
(
hb_blob_t
*
svg_blob
,
unsigned
int
index_offset
)
const
{
if
(
svgDocLength
==
0
)
return
hb_blob_get_empty
();
return
hb_blob_create_sub_blob
(
svg_blob
,
(
unsigned
int
)
svgDoc
+
index_offset
,
...
...
@@ -77,35 +77,6 @@ struct SVGDocumentIndexEntry
DEFINE_SIZE_STATIC
(
12
);
};
struct
SVGDocumentIndex
{
friend
struct
SVG
;
inline
const
SVGDocumentIndexEntry
&
get_glyph_entry
(
hb_codepoint_t
glyph_id
)
const
{
const
SVGDocumentIndexEntry
*
rec
;
rec
=
(
SVGDocumentIndexEntry
*
)
bsearch
(
&
glyph_id
,
&
entries
.
arrayZ
,
entries
.
len
,
sizeof
(
SVGDocumentIndexEntry
),
SVGDocumentIndexEntry
::
cmp
);
return
likely
(
rec
)
?
*
rec
:
Null
(
SVGDocumentIndexEntry
);
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
{
TRACE_SANITIZE
(
this
);
return_trace
(
c
->
check_struct
(
this
)
&&
entries
.
sanitize_shallow
(
c
));
}
protected:
ArrayOf
<
SVGDocumentIndexEntry
>
entries
;
/* Array of SVG Document Index Entries. */
public:
DEFINE_SIZE_ARRAY
(
2
,
entries
);
};
struct
SVG
{
static
const
hb_tag_t
tableTag
=
HB_OT_TAG_SVG
;
...
...
@@ -124,12 +95,11 @@ struct SVG
hb_blob_destroy
(
svg_blob
);
}
inline
hb_blob_t
*
creat
e_blob_for_glyph
(
hb_codepoint_t
glyph_id
)
const
inline
hb_blob_t
*
referenc
e_blob_for_glyph
(
hb_codepoint_t
glyph_id
)
const
{
if
(
unlikely
(
svg_len
==
0
))
return
hb_blob_get_empty
();
return
(
svg
+
svg
->
svgDocIndex
).
get_glyph_entry
(
glyph_id
).
create_blob
(
svg_blob
,
svg
->
svgDocIndex
);
return
svg
->
get_glyph_entry
(
glyph_id
).
reference_blob
(
svg_blob
,
svg
->
svgDocEntries
);
}
inline
bool
has_data
()
const
...
...
@@ -142,18 +112,30 @@ struct SVG
unsigned
int
svg_len
;
};
inline
const
SVGDocumentIndexEntry
&
get_glyph_entry
(
hb_codepoint_t
glyph_id
)
const
{
const
SVGDocumentIndexEntry
*
rec
;
rec
=
(
SVGDocumentIndexEntry
*
)
bsearch
(
&
glyph_id
,
&
(
this
+
svgDocEntries
).
arrayZ
,
(
this
+
svgDocEntries
).
len
,
sizeof
(
SVGDocumentIndexEntry
),
SVGDocumentIndexEntry
::
cmp
);
return
likely
(
rec
)
?
*
rec
:
Null
(
SVGDocumentIndexEntry
);
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
{
TRACE_SANITIZE
(
this
);
return_trace
(
likely
(
c
->
check_struct
(
this
)
&&
(
this
+
svgDoc
Index
).
sanitize
(
c
)));
(
this
+
svgDoc
Entries
).
sanitize_shallow
(
c
)));
}
protected:
HBUINT16
version
;
/* Table version (starting at 0). */
LOffsetTo
<
SVGDocumentIndex
>
svgDoc
Index
;
/* Offset (relative to the start of the SVG table) to the
LOffsetTo
<
ArrayOf
<
SVGDocumentIndexEntry
>
>
svgDoc
Entries
;
/* Offset (relative to the start of the SVG table) to the
* SVG Documents Index. Must be non-zero. */
/* Array of SVG Document Index Entries. */
HBUINT32
reserved
;
/* Set to 0. */
public:
DEFINE_SIZE_STATIC
(
10
);
...
...
src/hb-ot-color.cc
浏览文件 @
5cb1ce86
...
...
@@ -270,5 +270,5 @@ hb_ot_color_has_svg (hb_face_t *face)
hb_blob_t
*
hb_ot_color_glyph_svg_create_blob
(
hb_face_t
*
face
,
hb_codepoint_t
glyph
)
{
return
_get_svg
(
face
).
creat
e_blob_for_glyph
(
glyph
);
return
_get_svg
(
face
).
referenc
e_blob_for_glyph
(
glyph
);
}
test/api/test-ot-color.c
浏览文件 @
5cb1ce86
...
...
@@ -388,7 +388,7 @@ test_hb_ot_color_svg (void)
g_assert
(
strncmp
(
data
+
140
,
"</svg>"
,
5
)
==
0
);
hb_blob_destroy
(
blob
);
blob
=
hb_ot_color_glyph_svg_create_blob
(
empty
,
0
,
&
start_glyph
,
&
end_glyph
);
blob
=
hb_ot_color_glyph_svg_create_blob
(
empty
,
0
);
g_assert
(
hb_blob_get_length
(
blob
)
==
0
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录