Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
c32c096a
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看板
提交
c32c096a
编写于
7月 27, 2012
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Switch to shape_plan
Not optimized yet. Eats babies. And no shaper uses the shape_plan.
上级
5b95c148
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
47 addition
and
25 deletion
+47
-25
src/hb-shape-plan.cc
src/hb-shape-plan.cc
+35
-2
src/hb-shape-plan.h
src/hb-shape-plan.h
+8
-0
src/hb-shape.cc
src/hb-shape.cc
+4
-23
未找到文件。
src/hb-shape-plan.cc
浏览文件 @
c32c096a
...
...
@@ -48,7 +48,9 @@ hb_##shaper##_##object##_data_ensure (hb_##object##_t *object) \
return data != NULL && !HB_SHAPER_DATA_IS_INVALID (data); \
}
#define HB_SHAPER_IMPLEMENT(shaper) HB_SHAPER_DATA_ENSURE_DECLARE(shaper, face)
#define HB_SHAPER_IMPLEMENT(shaper) \
HB_SHAPER_DATA_ENSURE_DECLARE(shaper, face) \
HB_SHAPER_DATA_ENSURE_DECLARE(shaper, font)
#include "hb-shaper-list.hh"
#undef HB_SHAPER_IMPLEMENT
...
...
@@ -65,7 +67,6 @@ hb_shape_plan_plan (hb_shape_plan_t *shape_plan,
#define HB_SHAPER_PLAN(shaper) \
HB_STMT_START { \
if (hb_##shaper##_face_data_ensure (shape_plan->face)) { \
/* TODO Ensure face shaper data. */
\
HB_SHAPER_DATA_TYPE (shaper, shape_plan) *data= \
HB_SHAPER_DATA_CREATE_FUNC (shaper, shape_plan) (shape_plan, user_features, num_user_features); \
if (data) { \
...
...
@@ -157,3 +158,35 @@ hb_shape_plan_destroy (hb_shape_plan_t *shape_plan)
free
(
shape_plan
);
}
hb_bool_t
hb_shape_plan_execute
(
hb_shape_plan
*
shape_plan
,
hb_font_t
*
font
,
hb_buffer_t
*
buffer
,
const
hb_feature_t
*
features
,
unsigned
int
num_features
)
{
if
(
unlikely
(
shape_plan
->
face
!=
font
->
face
))
return
false
;
#define HB_SHAPER_EXECUTE(shaper) \
HB_STMT_START { \
if (hb_##shaper##_font_data_ensure (font) && \
_hb_##shaper##_shape (shape_plan, font, buffer, features, num_features)) \
return true; \
} HB_STMT_END
for
(
hb_shape_func_t
**
shaper_func
=
shape_plan
->
shapers
;
*
shaper_func
;
shaper_func
++
)
if
(
0
)
;
#define HB_SHAPER_IMPLEMENT(shaper) \
else if (*shaper_func == _hb_##shaper##_shape) \
HB_SHAPER_EXECUTE (shaper);
#include "hb-shaper-list.hh"
#undef HB_SHAPER_IMPLEMENT
#undef HB_SHAPER_EXECUTE
return
false
;
}
src/hb-shape-plan.h
浏览文件 @
c32c096a
...
...
@@ -57,4 +57,12 @@ HB_INTERNAL void
hb_shape_plan_destroy
(
hb_shape_plan_t
*
shape_plan
);
HB_INTERNAL
hb_bool_t
hb_shape_plan_execute
(
hb_shape_plan
*
shape_plan
,
hb_font_t
*
font
,
hb_buffer_t
*
buffer
,
const
hb_feature_t
*
features
,
unsigned
int
num_features
);
#endif
/* HB_SHAPE_PLAN_H */
src/hb-shape.cc
浏览文件 @
c32c096a
...
...
@@ -32,7 +32,6 @@
#include "hb-font-private.hh"
static
const
char
**
static_shaper_list
;
static
...
...
@@ -83,28 +82,10 @@ hb_shape_full (hb_font_t *font,
unsigned
int
num_features
,
const
char
*
const
*
shaper_list
)
{
// hb_shape_plan_t *shape_plan = hb_shape_plan_create (font->face, &buffer->props, features, num_features, shaper_list);
const
hb_shaper_pair_t
*
shapers
=
_hb_shapers_get
();
hb_font_make_immutable
(
font
);
/* So we can safely cache stuff on it */
if
(
likely
(
!
shaper_list
))
{
for
(
unsigned
int
i
=
0
;
i
<
HB_SHAPERS_COUNT
;
i
++
)
if
(
likely
(
shapers
[
i
].
func
(
NULL
,
font
,
buffer
,
features
,
num_features
)))
return
true
;
}
else
{
while
(
*
shaper_list
)
{
for
(
unsigned
int
i
=
0
;
i
<
HB_SHAPERS_COUNT
;
i
++
)
if
(
0
==
strcmp
(
*
shaper_list
,
shapers
[
i
].
name
))
{
if
(
likely
(
shapers
[
i
].
func
(
NULL
,
font
,
buffer
,
features
,
num_features
)))
return
true
;
break
;
}
shaper_list
++
;
}
}
return
false
;
hb_shape_plan_t
*
shape_plan
=
hb_shape_plan_create
(
font
->
face
,
&
buffer
->
props
,
features
,
num_features
,
shaper_list
);
hb_bool_t
res
=
hb_shape_plan_execute
(
shape_plan
,
font
,
buffer
,
features
,
num_features
);
hb_shape_plan_destroy
(
shape_plan
);
return
res
;
}
void
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录