Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
37ba2413
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看板
提交
37ba2413
编写于
10月 21, 2018
作者:
E
Ebrahim Byagowi
提交者:
Khaled Hosny
10月 22, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Minor
上级
44f79b4b
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
25 addition
and
22 deletion
+25
-22
src/hb-ot-color-cpal-table.hh
src/hb-ot-color-cpal-table.hh
+5
-5
src/hb-ot-color.cc
src/hb-ot-color.cc
+14
-11
src/hb-ot-color.h
src/hb-ot-color.h
+6
-6
未找到文件。
src/hb-ot-color-cpal-table.hh
浏览文件 @
37ba2413
...
...
@@ -115,17 +115,17 @@ struct CPAL
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
{
TRACE_SANITIZE
(
this
);
if
(
unlikely
(
!
(
c
->
check_struct
(
this
)
&&
//
it checks colorRecordIndices also
// see #get_size
if
(
unlikely
(
!
(
c
->
check_struct
(
this
)
&&
/*
it checks colorRecordIndices also
* See #get_size */
(
this
+
colorRecordsZ
).
sanitize
(
c
,
numColorRecords
))))
return_trace
(
false
);
/
/ Check for indices sanity so no need for doing it runtime
/
* Check for indices sanity so no need for doing it runtime */
for
(
unsigned
int
i
=
0
;
i
<
numPalettes
;
++
i
)
if
(
unlikely
(
colorRecordIndicesZ
[
i
]
+
numPaletteEntries
>
numColorRecords
))
return_trace
(
false
);
/
/ If version is zero, we are done here; otherwise we need to check tail also
/
* If version is zero, we are done here; otherwise we need to check tail also */
if
(
version
==
0
)
return_trace
(
true
);
...
...
@@ -177,7 +177,7 @@ struct CPAL
if
(
unlikely
(
color_index
>=
numPaletteEntries
||
palette
>=
numPalettes
))
return
false
;
/
/ No need for more range check as it is already done on #sanitize
/
* No need for more range check as it is already done on #sanitize */
const
UnsizedArrayOf
<
BGRAColor
>&
color_records
=
this
+
colorRecordsZ
;
if
(
color
)
*
color
=
color_records
[
colorRecordIndicesZ
[
palette
]
+
color_index
];
...
...
src/hb-ot-color.cc
浏览文件 @
37ba2413
...
...
@@ -96,7 +96,7 @@ hb_ot_color_get_palette_count (hb_face_t *face)
/**
* hb_ot_color_get_palette_name_id:
* @face: a font face.
* @face:
a font face.
* @palette: the index of the color palette whose name is being requested.
*
* Retrieves the name id of a color palette. For example, a color font can
...
...
@@ -121,7 +121,7 @@ hb_ot_color_get_palette_name_id (hb_face_t *face, unsigned int palette)
* @face: a font face.
* @palette_entry:
*
* Returns: Name ID associated with a
n
palette entry, e.g. eye color
* Returns: Name ID associated with a palette entry, e.g. eye color
*
* Since: REPLACEME
*/
...
...
@@ -162,33 +162,36 @@ unsigned int
hb_ot_color_get_palette_colors
(
hb_face_t
*
face
,
unsigned
int
palette
,
/* default=0 */
unsigned
int
start_offset
,
unsigned
int
*
co
unt
/* IN/OUT. May be NULL. */
,
unsigned
int
*
co
lors_count
/* IN/OUT. May be NULL. */
,
hb_color_t
*
colors
/* OUT. May be NULL. */
)
{
const
OT
::
CPAL
&
cpal
=
_get_cpal
(
face
);
if
(
unlikely
(
palette
>=
cpal
.
get_palette_count
()))
{
if
(
co
unt
)
*
count
=
0
;
if
(
co
lors_count
)
*
colors_
count
=
0
;
return
0
;
}
unsigned
int
num_results
=
0
;
if
(
count
)
if
(
co
lors_co
unt
)
{
unsigned
int
platte_count
=
MIN
<
unsigned
int
>
(
*
count
,
cpal
.
get_palette_entries_count
()
-
start_offset
);
unsigned
int
platte_count
;
platte_count
=
MIN
<
unsigned
int
>
(
*
colors_count
,
cpal
.
get_palette_entries_count
()
-
start_offset
);
for
(
unsigned
int
i
=
0
;
i
<
platte_count
;
i
++
)
{
if
(
cpal
.
get_color_record_argb
(
start_offset
+
i
,
palette
,
&
colors
[
num_results
]))
++
num_results
;
++
num_results
;
}
}
if
(
likely
(
co
unt
))
*
count
=
num_results
;
if
(
likely
(
co
lors_count
))
*
colors_
count
=
num_results
;
return
cpal
.
get_palette_entries_count
();
}
/**
* hb_ot_color_get_color_layers:
* @face: a font face.
* @gid:
* @start_offset:
* @count: (inout) (optional):
...
...
@@ -203,8 +206,8 @@ unsigned int
hb_ot_color_get_color_layers
(
hb_face_t
*
face
,
hb_codepoint_t
gid
,
unsigned
int
start_offset
,
unsigned
int
*
count
,
/* IN/OUT. May be NULL. */
hb_codepoint_t
*
gids
,
/* OUT. May be NULL. */
unsigned
int
*
count
/* IN/OUT. May be NULL. */
,
hb_codepoint_t
*
gids
/* OUT. May be NULL. */
,
unsigned
int
*
color_indices
/* OUT. May be NULL. */
)
{
const
OT
::
COLR
&
colr
=
_get_colr
(
face
);
...
...
@@ -230,7 +233,7 @@ hb_ot_color_get_color_layers (hb_face_t *face,
/**
* hb_ot_color_get_palette_flags:
* @face: a font face
* @face:
a font face
* @palette: the index of the color palette whose flags are being requested
*
* Returns: the flags for the requested color palette. If @face has no colors,
...
...
src/hb-ot-color.h
浏览文件 @
37ba2413
...
...
@@ -57,16 +57,16 @@ HB_EXTERN unsigned int
hb_ot_color_get_palette_colors
(
hb_face_t
*
face
,
unsigned
int
palette
,
/* default=0 */
unsigned
int
start_offset
,
unsigned
int
*
color_count
/* IN/OUT */
,
hb_color_t
*
colors
/* OUT */
);
unsigned
int
*
color_count
/* IN/OUT
. May be NULL.
*/
,
hb_color_t
*
colors
/* OUT
. May be NULL.
*/
);
HB_EXTERN
unsigned
int
hb_ot_color_get_color_layers
(
hb_face_t
*
face
,
hb_codepoint_t
gid
,
unsigned
int
offset
,
unsigned
int
*
count
,
/* IN/OUT */
hb_codepoint_t
*
gids
,
/* OUT */
unsigned
int
*
color_indices
/* OUT */
);
unsigned
int
start_
offset
,
unsigned
int
*
count
/* IN/OUT. May be NULL. */
,
hb_codepoint_t
*
gids
/* OUT. May be NULL. */
,
unsigned
int
*
color_indices
/* OUT
. May be NULL.
*/
);
/**
* hb_ot_color_palette_flags_t:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录