Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
a9ad3d34
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看板
提交
a9ad3d34
编写于
7月 28, 2011
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Move more code around
Buffer var allocation coming into shape
上级
cc06c243
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
64 addition
and
5 deletion
+64
-5
src/hb-buffer-private.hh
src/hb-buffer-private.hh
+1
-0
src/hb-buffer.cc
src/hb-buffer.cc
+35
-0
src/hb-ot-layout-gpos-private.hh
src/hb-ot-layout-gpos-private.hh
+7
-0
src/hb-ot-layout-gsub-private.hh
src/hb-ot-layout-gsub-private.hh
+18
-0
src/hb-ot-layout.cc
src/hb-ot-layout.cc
+3
-5
未找到文件。
src/hb-buffer-private.hh
浏览文件 @
a9ad3d34
...
...
@@ -87,6 +87,7 @@ struct _hb_buffer_t {
HB_INTERNAL
void
allocate_var
(
unsigned
int
byte_i
,
unsigned
int
count
,
const
char
*
owner
);
HB_INTERNAL
void
deallocate_var
(
unsigned
int
byte_i
,
unsigned
int
count
,
const
char
*
owner
);
HB_INTERNAL
void
deallocate_var_all
(
void
);
inline
void
allocate_var_8
(
unsigned
int
var_num
,
unsigned
int
i
,
const
char
*
owner
)
{
assert
(
var_num
<
2
&&
i
<
4
);
allocate_var
(
var_num
*
4
+
i
,
1
,
owner
);
}
...
...
src/hb-buffer.cc
浏览文件 @
a9ad3d34
...
...
@@ -34,6 +34,11 @@
HB_BEGIN_DECLS
#ifndef HB_DEBUG_BUFFER
#define HB_DEBUG_BUFFER (HB_DEBUG+0)
#endif
static
hb_buffer_t
_hb_buffer_nil
=
{
HB_OBJECT_HEADER_STATIC
,
...
...
@@ -388,10 +393,28 @@ hb_buffer_t::reverse_clusters (void)
reverse_range
(
start
,
i
);
}
static
inline
void
dump_var_allocation
(
const
hb_buffer_t
*
buffer
)
{
char
buf
[
80
];
for
(
unsigned
int
i
=
0
;
i
<
8
;
i
++
)
buf
[
i
]
=
'0'
+
buffer
->
allocated_var_bytes
[
i
];
buf
[
8
]
=
'\0'
;
DEBUG_MSG
(
BUFFER
,
buffer
,
"Current var allocation: %s"
,
buf
);
}
void
hb_buffer_t
::
allocate_var
(
unsigned
int
byte_i
,
unsigned
int
count
,
const
char
*
owner
)
{
assert
(
byte_i
<
8
&&
byte_i
+
count
<
8
);
if
(
DEBUG
(
BUFFER
))
dump_var_allocation
(
this
);
DEBUG_MSG
(
BUFFER
,
this
,
"Allocating var bytes %d..%d for %s"
,
byte_i
,
byte_i
+
count
-
1
,
owner
);
for
(
unsigned
int
i
=
byte_i
;
i
<
byte_i
+
count
;
i
++
)
{
assert
(
!
allocated_var_bytes
[
i
]);
allocated_var_bytes
[
i
]
++
;
...
...
@@ -401,13 +424,25 @@ void hb_buffer_t::allocate_var (unsigned int byte_i, unsigned int count, const c
void
hb_buffer_t
::
deallocate_var
(
unsigned
int
byte_i
,
unsigned
int
count
,
const
char
*
owner
)
{
DEBUG_MSG
(
BUFFER
,
this
,
"Deallocating var bytes %d..%d for %s"
,
byte_i
,
byte_i
+
count
-
1
,
owner
);
assert
(
byte_i
<
8
&&
byte_i
+
count
<
8
);
for
(
unsigned
int
i
=
byte_i
;
i
<
byte_i
+
count
;
i
++
)
{
assert
(
allocated_var_bytes
[
i
]
&&
allocated_var_owner
[
i
]
==
owner
);
allocated_var_bytes
[
i
]
--
;
}
if
(
DEBUG
(
BUFFER
))
dump_var_allocation
(
this
);
}
void
hb_buffer_t
::
deallocate_var_all
(
void
)
{
memset
(
allocated_var_bytes
,
0
,
sizeof
(
allocated_var_bytes
));
memset
(
allocated_var_owner
,
0
,
sizeof
(
allocated_var_owner
));
}
/* Public API */
...
...
src/hb-ot-layout-gpos-private.hh
浏览文件 @
a9ad3d34
...
...
@@ -1507,6 +1507,7 @@ struct GPOS : GSUBGPOS
hb_mask_t
mask
)
const
{
return
get_lookup
(
lookup_index
).
apply_string
(
font
,
buffer
,
mask
);
}
static
inline
void
position_start
(
hb_buffer_t
*
buffer
);
static
inline
void
position_finish
(
hb_buffer_t
*
buffer
);
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
...
...
@@ -1564,6 +1565,12 @@ fix_mark_attachment (hb_glyph_position_t *pos, unsigned int i, hb_direction_t di
}
}
void
GPOS
::
position_start
(
hb_buffer_t
*
buffer
)
{
buffer
->
clear_positions
();
}
void
GPOS
::
position_finish
(
hb_buffer_t
*
buffer
)
{
...
...
src/hb-ot-layout-gsub-private.hh
浏览文件 @
a9ad3d34
...
...
@@ -870,6 +870,9 @@ struct GSUB : GSUBGPOS
hb_mask_t
mask
)
const
{
return
get_lookup
(
lookup_index
).
apply_string
(
face
,
buffer
,
mask
);
}
static
inline
void
substitute_start
(
hb_buffer_t
*
buffer
);
static
inline
void
substitute_finish
(
hb_buffer_t
*
buffer
);
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
();
if
(
unlikely
(
!
GSUBGPOS
::
sanitize
(
c
)))
return
false
;
...
...
@@ -881,6 +884,21 @@ struct GSUB : GSUBGPOS
};
void
GSUB
::
substitute_start
(
hb_buffer_t
*
buffer
)
{
unsigned
int
count
=
buffer
->
len
;
/* XXX */
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
buffer
->
info
[
i
].
var1
.
u32
=
buffer
->
info
[
i
].
var2
.
u32
=
0
;
}
void
GSUB
::
substitute_finish
(
hb_buffer_t
*
buffer
)
{
}
/* Out-of-class implementation for methods recursing */
inline
bool
ExtensionSubst
::
apply
(
hb_apply_context_t
*
c
)
const
...
...
src/hb-ot-layout.cc
浏览文件 @
a9ad3d34
...
...
@@ -443,10 +443,7 @@ hb_ot_layout_has_substitution (hb_face_t *face)
void
hb_ot_layout_substitute_start
(
hb_buffer_t
*
buffer
)
{
unsigned
int
count
=
buffer
->
len
;
/* XXX */
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
buffer
->
info
[
i
].
var1
.
u32
=
buffer
->
info
[
i
].
var2
.
u32
=
0
;
GSUB
::
substitute_start
(
buffer
);
}
hb_bool_t
...
...
@@ -461,6 +458,7 @@ hb_ot_layout_substitute_lookup (hb_face_t *face,
void
hb_ot_layout_substitute_finish
(
hb_buffer_t
*
buffer
HB_UNUSED
)
{
GSUB
::
substitute_finish
(
buffer
);
}
...
...
@@ -477,7 +475,7 @@ hb_ot_layout_has_positioning (hb_face_t *face)
void
hb_ot_layout_position_start
(
hb_buffer_t
*
buffer
)
{
buffer
->
clear_positions
(
);
GPOS
::
position_start
(
buffer
);
}
hb_bool_t
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录