Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
a1733db1
T
Third Party Harfbuzz
项目概览
OpenHarmony
/
Third Party Harfbuzz
接近 2 年 前同步成功
通知
1
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看板
提交
a1733db1
编写于
11月 23, 2012
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[OTLayout] Start adding process() tracing
上级
73c18ae1
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
37 addition
and
13 deletion
+37
-13
src/hb-ot-layout-gsubgpos-private.hh
src/hb-ot-layout-gsubgpos-private.hh
+33
-11
src/hb-private.hh
src/hb-private.hh
+4
-2
未找到文件。
src/hb-ot-layout-gsubgpos-private.hh
浏览文件 @
a1733db1
...
...
@@ -38,6 +38,12 @@ namespace OT {
#define TRACE_PROCESS(this) \
hb_auto_trace_t<context_t::max_debug_depth, typename context_t::return_t> trace \
(&c->debug_depth, c->get_name (), this, HB_FUNC, \
"");
#ifndef HB_DEBUG_CLOSURE
#define HB_DEBUG_CLOSURE (HB_DEBUG+0)
#endif
...
...
@@ -49,11 +55,13 @@ namespace OT {
struct
hb_closure_context_t
{
inline
const
char
*
get_name
(
void
)
{
return
"CLOSURE"
;
}
static
const
unsigned
int
max_debug_depth
=
HB_DEBUG_CLOSURE
;
typedef
void_t
return_t
;
typedef
return_t
(
*
recurse_func_t
)
(
hb_closure_context_t
*
c
,
unsigned
int
lookup_index
);
template
<
typename
T
>
inline
return_t
process
(
const
T
&
obj
)
{
obj
.
closure
(
this
);
return
void_t
()
;
}
static
return_t
default_return_value
(
void
)
{
return
return_t
()
;
}
inline
return_t
process
(
const
T
&
obj
)
{
obj
.
closure
(
this
);
return
VOID
;
}
static
return_t
default_return_value
(
void
)
{
return
VOID
;
}
bool
stop_sublookup_iteration
(
const
return_t
r
)
const
{
return
false
;
}
return_t
recurse
(
unsigned
int
lookup_index
)
{
...
...
@@ -96,6 +104,8 @@ struct hb_closure_context_t
struct
hb_would_apply_context_t
{
inline
const
char
*
get_name
(
void
)
{
return
"WOULD_APPLY"
;
}
static
const
unsigned
int
max_debug_depth
=
HB_DEBUG_WOULD_APPLY
;
typedef
bool
return_t
;
template
<
typename
T
>
inline
return_t
process
(
const
T
&
obj
)
{
return
obj
.
would_apply
(
this
);
}
...
...
@@ -117,7 +127,7 @@ struct hb_would_apply_context_t
glyphs
(
glyphs_
),
len
(
len_
),
zero_context
(
zero_context_
),
debug_depth
(
0
)
{}
;
debug_depth
(
0
)
{}
};
...
...
@@ -133,10 +143,12 @@ struct hb_would_apply_context_t
struct
hb_collect_glyphs_context_t
{
inline
const
char
*
get_name
(
void
)
{
return
"COLLECT_GLYPHS"
;
}
static
const
unsigned
int
max_debug_depth
=
HB_DEBUG_COLLECT_GLYPHS
;
typedef
void_t
return_t
;
template
<
typename
T
>
inline
return_t
process
(
const
T
&
obj
)
{
obj
.
collect_glyphs
(
this
);
return
void_t
()
;
}
static
return_t
default_return_value
(
void
)
{
return
return_t
()
;
}
inline
return_t
process
(
const
T
&
obj
)
{
obj
.
collect_glyphs
(
this
);
return
VOID
;
}
static
return_t
default_return_value
(
void
)
{
return
VOID
;
}
bool
stop_iteration
(
const
return_t
r
)
const
{
return
false
;
}
return_t
recurse
(
unsigned
int
lookup_index
)
{
...
...
@@ -163,22 +175,27 @@ struct hb_collect_glyphs_context_t
input
(
glyphs_input
?
*
glyphs_input
:
*
hb_set_get_empty
()),
after
(
glyphs_after
?
*
glyphs_after
:
*
hb_set_get_empty
()),
output
(
glyphs_output
?
*
glyphs_output
:
*
hb_set_get_empty
()),
debug_depth
(
0
)
{}
;
debug_depth
(
0
)
{}
};
struct
hb_get_coverage_context_t
{
inline
const
char
*
get_name
(
void
)
{
return
"GET_COVERAGE"
;
}
static
const
unsigned
int
max_debug_depth
=
0
;
typedef
const
Coverage
&
return_t
;
template
<
typename
T
>
inline
return_t
process
(
const
T
&
obj
)
{
return
obj
.
get_coverage
();
}
static
const
return_t
default_return_value
(
void
)
{
return
Null
(
Coverage
);
}
static
return_t
default_return_value
(
void
)
{
return
Null
(
Coverage
);
}
bool
stop_sublookup_iteration
(
const
return_t
r
)
const
{
return
true
;
/* Unused */
}
return_t
recurse
(
unsigned
int
lookup_index
)
{
return
default_return_value
();
}
hb_get_coverage_context_t
(
void
)
{}
hb_get_coverage_context_t
(
void
)
:
debug_depth
(
0
)
{}
unsigned
int
debug_depth
;
};
...
...
@@ -194,6 +211,8 @@ struct hb_get_coverage_context_t
struct
hb_apply_context_t
{
inline
const
char
*
get_name
(
void
)
{
return
"APPLY"
;
}
static
const
unsigned
int
max_debug_depth
=
HB_DEBUG_APPLY
;
typedef
bool
return_t
;
typedef
return_t
(
*
recurse_func_t
)
(
hb_apply_context_t
*
c
,
unsigned
int
lookup_index
);
template
<
typename
T
>
...
...
@@ -205,6 +224,7 @@ struct hb_apply_context_t
if
(
unlikely
(
nesting_level_left
==
0
||
!
recurse_func
))
return
default_return_value
();
/* TODO Reuse context. */
hb_apply_context_t
new_c
(
*
this
);
new_c
.
nesting_level_left
--
;
return
recurse_func
(
&
new_c
,
lookup_index
);
...
...
@@ -219,9 +239,9 @@ struct hb_apply_context_t
unsigned
int
nesting_level_left
;
unsigned
int
lookup_props
;
unsigned
int
property
;
/* propety of first glyph */
unsigned
int
debug_depth
;
const
GDEF
&
gdef
;
bool
has_glyph_classes
;
unsigned
int
debug_depth
;
hb_apply_context_t
(
hb_font_t
*
font_
,
...
...
@@ -232,9 +252,10 @@ struct hb_apply_context_t
lookup_mask
(
lookup_mask_
),
recurse_func
(
NULL
),
nesting_level_left
(
MAX_NESTING_LEVEL
),
lookup_props
(
0
),
property
(
0
),
debug_depth
(
0
),
lookup_props
(
0
),
property
(
0
),
gdef
(
*
hb_ot_layout_from_face
(
face
)
->
gdef
),
has_glyph_classes
(
gdef
.
has_glyph_classes
())
{}
has_glyph_classes
(
gdef
.
has_glyph_classes
()),
debug_depth
(
0
)
{}
void
set_recurse_func
(
recurse_func_t
func
)
{
recurse_func
=
func
;
}
void
set_lookup_props
(
unsigned
int
lookup_props_
)
{
lookup_props
=
lookup_props_
;
}
...
...
@@ -1693,6 +1714,7 @@ struct ChainContext
template
<
typename
context_t
>
inline
typename
context_t
::
return_t
process
(
context_t
*
c
)
const
{
TRACE_PROCESS
(
this
);
switch
(
u
.
format
)
{
case
1
:
return
c
->
process
(
u
.
format1
);
case
2
:
return
c
->
process
(
u
.
format2
);
...
...
src/hb-private.hh
浏览文件 @
a1733db1
...
...
@@ -63,7 +63,9 @@
/* Void! */
typedef
struct
{}
void_t
;
struct
_void_t
;
typedef
const
_void_t
&
void_t
;
#define VOID (* (const _void_t *) NULL)
/* Basics */
...
...
@@ -718,7 +720,7 @@ struct hb_auto_trace_t {
if
(
plevel
)
--*
plevel
;
}
inline
ret_t
ret
(
ret_t
v
,
unsigned
int
line
=
0
)
inline
ret_t
&
ret
(
ret_t
&
v
,
unsigned
int
line
=
0
)
{
if
(
unlikely
(
returned
))
{
fprintf
(
stderr
,
"OUCH, double calls to TRACE_RETURN. This is a bug, please report.
\n
"
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录