Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
5bd1e952
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看板
提交
5bd1e952
编写于
9月 22, 2010
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Speedup Device table delta computation for common cases
上级
ed4acbde
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
21 addition
and
4 deletion
+21
-4
src/hb-ot-layout-common-private.hh
src/hb-ot-layout-common-private.hh
+21
-4
未找到文件。
src/hb-ot-layout-common-private.hh
浏览文件 @
5bd1e952
/*
/*
* Copyright (C) 2007,2008,2009 Red Hat, Inc.
* Copyright (C) 2007,2008,2009 Red Hat, Inc.
* Copyright (C) 2010 Google, Inc.
*
*
* This is part of HarfBuzz, a text shaping library.
* This is part of HarfBuzz, a text shaping library.
*
*
...
@@ -22,6 +23,7 @@
...
@@ -22,6 +23,7 @@
* PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
* PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
*
*
* Red Hat Author(s): Behdad Esfahbod
* Red Hat Author(s): Behdad Esfahbod
* Google Author(s): Behdad Esfahbod
*/
*/
#ifndef HB_OT_LAYOUT_COMMON_PRIVATE_HH
#ifndef HB_OT_LAYOUT_COMMON_PRIVATE_HH
...
@@ -519,15 +521,30 @@ struct ClassDef
...
@@ -519,15 +521,30 @@ struct ClassDef
struct
Device
struct
Device
{
{
/* XXX speed up */
inline
hb_position_t
get_x_delta
(
hb_ot_layout_context_t
*
c
)
const
inline
hb_position_t
get_x_delta
(
hb_ot_layout_context_t
*
c
)
const
{
return
c
->
font
->
x_ppem
?
get_delta
(
c
->
font
->
x_ppem
)
*
(
uint64_t
)
c
->
font
->
x_scale
/
c
->
font
->
x_ppem
:
0
;
}
{
return
get_delta
(
c
->
font
->
x_ppem
,
c
->
font
->
x_scale
)
;
}
inline
hb_position_t
get_y_delta
(
hb_ot_layout_context_t
*
c
)
const
inline
hb_position_t
get_y_delta
(
hb_ot_layout_context_t
*
c
)
const
{
return
c
->
font
->
y_ppem
?
get_delta
(
c
->
font
->
y_ppem
)
*
(
uint64_t
)
c
->
font
->
y_scale
/
c
->
font
->
y_ppem
:
0
;
}
{
return
get_delta
(
c
->
font
->
y_ppem
,
c
->
font
->
y_scale
)
;
}
inline
int
get_delta
(
unsigned
int
ppem_size
)
const
inline
int
get_delta
(
unsigned
int
ppem
,
unsigned
int
scale
)
const
{
if
(
!
ppem
)
return
0
;
int
pixels
=
get_delta_pixels
(
ppem
);
if
(
!
pixels
)
return
0
;
/* pixels is at most in the -8..7 range. So 64-bit arithmetic is
* not really necessary here. A simple cast to int may just work
* as well. But since this code is not reached that often and
* for the sake of correctness, we do a 64bit operation. */
return
pixels
*
(
int64_t
)
scale
/
ppem
;
}
inline
int
get_delta_pixels
(
unsigned
int
ppem_size
)
const
{
{
unsigned
int
f
=
deltaFormat
;
unsigned
int
f
=
deltaFormat
;
if
(
unlikely
(
f
<
1
||
f
>
3
))
if
(
unlikely
(
f
<
1
||
f
>
3
))
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录