Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_43355755
engine
提交
22e7e464
E
engine
项目概览
weixin_43355755
/
engine
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
E
engine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
22e7e464
编写于
1月 12, 2017
作者:
S
Siyamed Sinir
提交者:
Android (Google) Code Review
1月 12, 2017
浏览文件
操作
浏览文件
下载
差异文件
Merge "Revert "Reduce memory usage of FontCollection.""
上级
646a6f80
1d753f6f
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
11 addition
and
12 deletion
+11
-12
include/minikin/FontCollection.h
include/minikin/FontCollection.h
+5
-5
libs/minikin/FontCollection.cpp
libs/minikin/FontCollection.cpp
+6
-7
未找到文件。
include/minikin/FontCollection.h
浏览文件 @
22e7e464
...
...
@@ -63,8 +63,8 @@ private:
static
const
int
kPageMask
=
(
1
<<
kLogCharsPerPage
)
-
1
;
struct
Range
{
uint8
_t
start
;
uint8
_t
end
;
size
_t
start
;
size
_t
end
;
};
FontFamily
*
getFamilyForChar
(
uint32_t
ch
,
uint32_t
vs
,
uint32_t
langListId
,
int
variant
)
const
;
...
...
@@ -92,14 +92,14 @@ private:
// This vector can't be empty.
std
::
vector
<
FontFamily
*>
mFamilies
;
// This vector contains
indices into mFamilies.
// This vector contains
pointers into mInstances
// This vector can't be empty.
std
::
vector
<
uint8_t
>
mFamilyVec
;
std
::
vector
<
FontFamily
*
>
mFamilyVec
;
// This vector has pointers to the font family instance which has cmap 14 subtable.
std
::
vector
<
FontFamily
*>
mVSFamilyVec
;
// These are offsets into m
Family
Vec, one range per page
// These are offsets into m
Instance
Vec, one range per page
std
::
vector
<
Range
>
mRanges
;
// Set of supported axes in this collection.
...
...
libs/minikin/FontCollection.cpp
浏览文件 @
22e7e464
...
...
@@ -110,8 +110,6 @@ FontCollection::FontCollection(const vector<FontFamily*>& typefaces) :
nTypefaces
=
mFamilies
.
size
();
LOG_ALWAYS_FATAL_IF
(
nTypefaces
==
0
,
"Font collection must have at least one valid typeface"
);
LOG_ALWAYS_FATAL_IF
(
nTypefaces
>
254
,
"Up to 254 font families can be registered to collection."
);
size_t
nPages
=
(
mMaxChar
+
kPageMask
)
>>
kLogCharsPerPage
;
size_t
offset
=
0
;
// TODO: Use variation selector map for mRanges construction.
...
...
@@ -125,11 +123,11 @@ FontCollection::FontCollection(const vector<FontFamily*>& typefaces) :
#ifdef VERBOSE_DEBUG
ALOGD
(
"i=%zd: range start = %zd
\n
"
,
i
,
offset
);
#endif
range
->
start
=
(
uint8_t
)
offset
;
range
->
start
=
offset
;
for
(
size_t
j
=
0
;
j
<
nTypefaces
;
j
++
)
{
if
(
lastChar
[
j
]
<
(
i
+
1
)
<<
kLogCharsPerPage
)
{
FontFamily
*
family
=
mFamilies
[
j
];
mFamilyVec
.
push_back
(
(
uint8_t
)
j
);
mFamilyVec
.
push_back
(
family
);
offset
++
;
uint32_t
nextChar
=
family
->
getCoverage
().
nextSetBit
((
i
+
1
)
<<
kLogCharsPerPage
);
#ifdef VERBOSE_DEBUG
...
...
@@ -138,7 +136,7 @@ FontCollection::FontCollection(const vector<FontFamily*>& typefaces) :
lastChar
[
j
]
=
nextChar
;
}
}
range
->
end
=
(
uint8_t
)
offset
;
range
->
end
=
offset
;
}
}
...
...
@@ -285,10 +283,11 @@ FontFamily* FontCollection::getFamilyForChar(uint32_t ch, uint32_t vs,
return
mFamilies
[
0
];
}
const
std
::
vector
<
FontFamily
*>&
familyVec
=
(
vs
==
0
)
?
mFamilyVec
:
mFamilies
;
Range
range
=
mRanges
[
ch
>>
kLogCharsPerPage
];
if
(
vs
!=
0
)
{
range
=
{
0
,
(
uint8_t
)
mFamilies
.
size
()
};
range
=
{
0
,
mFamilies
.
size
()
};
}
#ifdef VERBOSE_DEBUG
...
...
@@ -297,7 +296,7 @@ FontFamily* FontCollection::getFamilyForChar(uint32_t ch, uint32_t vs,
FontFamily
*
bestFamily
=
nullptr
;
uint32_t
bestScore
=
kUnsupportedFontScore
;
for
(
size_t
i
=
range
.
start
;
i
<
range
.
end
;
i
++
)
{
FontFamily
*
family
=
vs
==
0
?
mFamilies
[
mFamilyVec
[
i
]]
:
mFamilies
[
i
];
FontFamily
*
family
=
familyVec
[
i
];
const
uint32_t
score
=
calcFamilyScore
(
ch
,
vs
,
variant
,
langListId
,
family
);
if
(
score
==
kFirstFontScore
)
{
// If the first font family supports the given character or variation sequence, always
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录