Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
sxychenjing
engine
提交
84fe4a9f
E
engine
项目概览
sxychenjing
/
engine
与 Fork 源项目一致
从无法访问的项目Fork
通知
3
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,发现更多精彩内容 >>
未验证
提交
84fe4a9f
编写于
10月 12, 2018
作者:
G
Gary Qian
提交者:
GitHub
10月 12, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Re-revert invalid line height tests (#6516)
上级
5f529566
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
0 addition
and
101 deletion
+0
-101
third_party/txt/src/txt/paragraph.h
third_party/txt/src/txt/paragraph.h
+0
-1
third_party/txt/src/txt/styled_runs.h
third_party/txt/src/txt/styled_runs.h
+0
-1
third_party/txt/tests/paragraph_unittests.cc
third_party/txt/tests/paragraph_unittests.cc
+0
-99
未找到文件。
third_party/txt/src/txt/paragraph.h
浏览文件 @
84fe4a9f
...
...
@@ -208,7 +208,6 @@ class Paragraph {
FRIEND_TEST
(
ParagraphTest
,
UnderlineShiftParagraph
);
FRIEND_TEST
(
ParagraphTest
,
SimpleShadow
);
FRIEND_TEST
(
ParagraphTest
,
ComplexShadow
);
FRIEND_TEST
(
ParagraphTest
,
LineHeightsParagraph
);
// Starting data to layout.
std
::
vector
<
uint16_t
>
text_
;
...
...
third_party/txt/src/txt/styled_runs.h
浏览文件 @
84fe4a9f
...
...
@@ -81,7 +81,6 @@ class StyledRuns {
FRIEND_TEST
(
ParagraphTest
,
Ellipsize
);
FRIEND_TEST
(
ParagraphTest
,
SimpleShadow
);
FRIEND_TEST
(
ParagraphTest
,
ComplexShadow
);
FRIEND_TEST
(
ParagraphTest
,
LineHeightsParagraph
);
struct
IndexedRun
{
size_t
style_index
=
0
;
...
...
third_party/txt/tests/paragraph_unittests.cc
浏览文件 @
84fe4a9f
...
...
@@ -1840,105 +1840,6 @@ TEST_F(ParagraphTest, ComplexShadow) {
ASSERT_TRUE
(
Snapshot
());
}
TEST_F
(
ParagraphTest
,
DISABLE_ON_WINDOWS
(
LineHeightsParagraph
))
{
const
char
*
text
=
"This is a very long sentence to test if the text will properly wrap "
"around and go to the next line. Sometimes, short sentence. Longer "
"sentences are okay too because they are nessecary. Very short. "
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod "
"tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim "
"veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea "
"commodo consequat. Duis aute irure dolor in reprehenderit in voluptate "
"velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint "
"occaecat cupidatat non proident, sunt in culpa qui officia deserunt "
"mollit anim id est laborum. "
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod "
"tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim "
"veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea "
"commodo consequat. Duis aute irure dolor in reprehenderit in voluptate "
"velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint "
"occaecat cupidatat non proident, sunt in culpa qui officia deserunt "
"mollit anim id est laborum."
;
auto
icu_text
=
icu
::
UnicodeString
::
fromUTF8
(
text
);
std
::
u16string
u16_text
(
icu_text
.
getBuffer
(),
icu_text
.
getBuffer
()
+
icu_text
.
length
());
txt
::
ParagraphStyle
paragraph_style
;
paragraph_style
.
max_lines
=
14
;
paragraph_style
.
text_align
=
TextAlign
::
left
;
double
line_height
=
2.0
;
paragraph_style
.
line_height
=
line_height
;
txt
::
ParagraphBuilder
builder
(
paragraph_style
,
GetTestFontCollection
());
txt
::
TextStyle
text_style
;
text_style
.
font_family
=
"Roboto"
;
text_style
.
font_size
=
26
;
text_style
.
letter_spacing
=
1
;
text_style
.
word_spacing
=
5
;
text_style
.
color
=
SK_ColorBLACK
;
text_style
.
height
=
1
;
text_style
.
decoration
=
TextDecoration
::
kUnderline
;
text_style
.
decoration_color
=
SK_ColorBLACK
;
builder
.
PushStyle
(
text_style
);
builder
.
AddText
(
u16_text
);
builder
.
Pop
();
auto
paragraph
=
builder
.
Build
();
paragraph
->
Layout
(
GetTestCanvasWidth
()
-
100
);
paragraph
->
Paint
(
GetCanvas
(),
0
,
0
);
ASSERT_TRUE
(
Snapshot
());
ASSERT_EQ
(
paragraph
->
text_
.
size
(),
std
::
string
{
text
}.
length
());
for
(
size_t
i
=
0
;
i
<
u16_text
.
length
();
i
++
)
{
ASSERT_EQ
(
paragraph
->
text_
[
i
],
u16_text
[
i
]);
}
ASSERT_EQ
(
paragraph
->
runs_
.
runs_
.
size
(),
1ull
);
ASSERT_EQ
(
paragraph
->
runs_
.
styles_
.
size
(),
2ull
);
ASSERT_TRUE
(
paragraph
->
runs_
.
styles_
[
1
].
equals
(
text_style
));
ASSERT_EQ
(
paragraph
->
records_
.
size
(),
paragraph_style
.
max_lines
);
double
expected_y
=
24
;
ASSERT_TRUE
(
paragraph
->
records_
[
0
].
style
().
equals
(
text_style
));
ASSERT_DOUBLE_EQ
(
paragraph
->
records_
[
0
].
offset
().
y
(),
expected_y
);
expected_y
+=
27.5
*
line_height
;
ASSERT_DOUBLE_EQ
(
paragraph
->
records_
[
0
].
offset
().
x
(),
0
);
ASSERT_TRUE
(
paragraph
->
records_
[
1
].
style
().
equals
(
text_style
));
ASSERT_DOUBLE_EQ
(
paragraph
->
records_
[
1
].
offset
().
y
(),
expected_y
);
expected_y
+=
27.5
*
line_height
;
ASSERT_DOUBLE_EQ
(
paragraph
->
records_
[
1
].
offset
().
x
(),
0
);
ASSERT_TRUE
(
paragraph
->
records_
[
2
].
style
().
equals
(
text_style
));
ASSERT_DOUBLE_EQ
(
paragraph
->
records_
[
2
].
offset
().
y
(),
expected_y
);
expected_y
+=
27.5
*
line_height
;
ASSERT_DOUBLE_EQ
(
paragraph
->
records_
[
2
].
offset
().
x
(),
0
);
ASSERT_TRUE
(
paragraph
->
records_
[
3
].
style
().
equals
(
text_style
));
ASSERT_DOUBLE_EQ
(
paragraph
->
records_
[
3
].
offset
().
y
(),
expected_y
);
expected_y
+=
27.5
*
10
*
line_height
;
ASSERT_DOUBLE_EQ
(
paragraph
->
records_
[
3
].
offset
().
x
(),
0
);
ASSERT_TRUE
(
paragraph
->
records_
[
13
].
style
().
equals
(
text_style
));
ASSERT_DOUBLE_EQ
(
paragraph
->
records_
[
13
].
offset
().
y
(),
expected_y
);
ASSERT_DOUBLE_EQ
(
paragraph
->
records_
[
13
].
offset
().
x
(),
0
);
ASSERT_EQ
(
paragraph_style
.
text_align
,
paragraph
->
GetParagraphStyle
().
text_align
);
// Tests for GetGlyphPositionAtCoordinate()
ASSERT_EQ
(
paragraph
->
GetGlyphPositionAtCoordinate
(
0
,
0
).
position
,
0ull
);
ASSERT_EQ
(
paragraph
->
GetGlyphPositionAtCoordinate
(
1
,
1
).
position
,
0ull
);
ASSERT_EQ
(
paragraph
->
GetGlyphPositionAtCoordinate
(
1
,
35
).
position
,
68ull
);
ASSERT_EQ
(
paragraph
->
GetGlyphPositionAtCoordinate
(
1
,
70
).
position
,
68ull
);
ASSERT_EQ
(
paragraph
->
GetGlyphPositionAtCoordinate
(
2000
,
35
).
position
,
134ull
);
ASSERT_TRUE
(
Snapshot
());
}
TEST_F
(
ParagraphTest
,
BaselineParagraph
)
{
const
char
*
text
=
"左線読設Byg後碁給能上目秘使約。満毎冠行来昼本可必図将発確年。今属場育"
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录