Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
sxychenjing
engine
提交
b1884799
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,发现更多精彩内容 >>
未验证
提交
b1884799
编写于
6月 24, 2019
作者:
J
Jason Simmons
提交者:
GitHub
6月 24, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove variants of ParagraphBuilder::AddText that are not used within the engine (#9403)
上级
a1840379
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
20 addition
and
40 deletion
+20
-40
third_party/txt/benchmarks/paragraph_builder_benchmarks.cc
third_party/txt/benchmarks/paragraph_builder_benchmarks.cc
+2
-2
third_party/txt/src/txt/paragraph_builder.cc
third_party/txt/src/txt/paragraph_builder.cc
+0
-14
third_party/txt/src/txt/paragraph_builder.h
third_party/txt/src/txt/paragraph_builder.h
+0
-6
third_party/txt/tests/paragraph_unittests.cc
third_party/txt/tests/paragraph_unittests.cc
+18
-18
未找到文件。
third_party/txt/benchmarks/paragraph_builder_benchmarks.cc
浏览文件 @
b1884799
...
...
@@ -63,7 +63,7 @@ static void BM_ParagraphBuilderPushPop(benchmark::State& state) {
BENCHMARK
(
BM_ParagraphBuilderPushPop
);
static
void
BM_ParagraphBuilderAddTextString
(
benchmark
::
State
&
state
)
{
std
::
string
text
=
"Hello World"
;
std
::
u16string
text
=
u
"Hello World"
;
auto
font_collection
=
GetTestFontCollection
();
...
...
@@ -77,7 +77,7 @@ static void BM_ParagraphBuilderAddTextString(benchmark::State& state) {
BENCHMARK
(
BM_ParagraphBuilderAddTextString
);
static
void
BM_ParagraphBuilderAddTextChar
(
benchmark
::
State
&
state
)
{
const
char
*
text
=
"Hello World"
;
std
::
u16string
text
=
u
"Hello World"
;
txt
::
ParagraphStyle
paragraph_style
;
auto
font_collection
=
GetTestFontCollection
();
...
...
third_party/txt/src/txt/paragraph_builder.cc
浏览文件 @
b1884799
...
...
@@ -63,20 +63,6 @@ void ParagraphBuilder::AddText(const std::u16string& text) {
text_
.
insert
(
text_
.
end
(),
text
.
begin
(),
text
.
end
());
}
void
ParagraphBuilder
::
AddText
(
const
std
::
string
&
text
)
{
auto
icu_text
=
icu
::
UnicodeString
::
fromUTF8
(
text
);
std
::
u16string
u16_text
(
icu_text
.
getBuffer
(),
icu_text
.
getBuffer
()
+
icu_text
.
length
());
AddText
(
u16_text
);
}
void
ParagraphBuilder
::
AddText
(
const
char
*
text
)
{
auto
icu_text
=
icu
::
UnicodeString
::
fromUTF8
(
text
);
std
::
u16string
u16_text
(
icu_text
.
getBuffer
(),
icu_text
.
getBuffer
()
+
icu_text
.
length
());
AddText
(
u16_text
);
}
void
ParagraphBuilder
::
AddPlaceholder
(
PlaceholderRun
&
span
)
{
obj_replacement_char_indexes_
.
insert
(
text_
.
size
());
runs_
.
StartRun
(
PeekStyleIndex
(),
text_
.
size
());
...
...
third_party/txt/src/txt/paragraph_builder.h
浏览文件 @
b1884799
...
...
@@ -61,12 +61,6 @@ class ParagraphBuilder {
// on the style_stack_;
void
AddText
(
const
std
::
u16string
&
text
);
// Converts to u16string before adding.
void
AddText
(
const
std
::
string
&
text
);
// Converts to u16string before adding.
void
AddText
(
const
char
*
text
);
// Pushes the information requried to leave an open space, where Flutter may
// draw a custom placeholder into.
//
...
...
third_party/txt/tests/paragraph_unittests.cc
浏览文件 @
b1884799
...
...
@@ -1825,31 +1825,31 @@ TEST_F(ParagraphTest, DecorationsParagraph) {
text_style
.
decoration_color
=
SK_ColorBLACK
;
text_style
.
decoration_thickness_multiplier
=
2.0
;
builder
.
PushStyle
(
text_style
);
builder
.
AddText
(
"This text should be"
);
builder
.
AddText
(
u
"This text should be"
);
text_style
.
decoration_style
=
txt
::
TextDecorationStyle
::
kDouble
;
text_style
.
decoration_color
=
SK_ColorBLUE
;
text_style
.
decoration_thickness_multiplier
=
1.0
;
builder
.
PushStyle
(
text_style
);
builder
.
AddText
(
" decorated even when"
);
builder
.
AddText
(
u
" decorated even when"
);
text_style
.
decoration_style
=
txt
::
TextDecorationStyle
::
kDotted
;
text_style
.
decoration_color
=
SK_ColorBLACK
;
builder
.
PushStyle
(
text_style
);
builder
.
AddText
(
" wrapped around to"
);
builder
.
AddText
(
u
" wrapped around to"
);
text_style
.
decoration_style
=
txt
::
TextDecorationStyle
::
kDashed
;
text_style
.
decoration_color
=
SK_ColorBLACK
;
text_style
.
decoration_thickness_multiplier
=
3.0
;
builder
.
PushStyle
(
text_style
);
builder
.
AddText
(
" the next line."
);
builder
.
AddText
(
u
" the next line."
);
text_style
.
decoration_style
=
txt
::
TextDecorationStyle
::
kWavy
;
text_style
.
decoration_color
=
SK_ColorRED
;
text_style
.
decoration_thickness_multiplier
=
1.0
;
builder
.
PushStyle
(
text_style
);
builder
.
AddText
(
" Otherwise, bad things happen."
);
builder
.
AddText
(
u
" Otherwise, bad things happen."
);
builder
.
Pop
();
...
...
@@ -1911,14 +1911,14 @@ TEST_F(ParagraphTest, ItalicsParagraph) {
text_style
.
color
=
SK_ColorRED
;
text_style
.
font_size
=
10
;
builder
.
PushStyle
(
text_style
);
builder
.
AddText
(
"No italic "
);
builder
.
AddText
(
u
"No italic "
);
text_style
.
font_style
=
txt
::
FontStyle
::
italic
;
builder
.
PushStyle
(
text_style
);
builder
.
AddText
(
"Yes Italic "
);
builder
.
AddText
(
u
"Yes Italic "
);
builder
.
Pop
();
builder
.
AddText
(
"No Italic again."
);
builder
.
AddText
(
u
"No Italic again."
);
auto
paragraph
=
builder
.
Build
();
paragraph
->
Layout
(
GetTestCanvasWidth
());
...
...
@@ -3493,28 +3493,28 @@ TEST_F(ParagraphTest, SpacingParagraph) {
text_style
.
letter_spacing
=
0
;
text_style
.
word_spacing
=
0
;
builder
.
PushStyle
(
text_style
);
builder
.
AddText
(
"|"
);
builder
.
AddText
(
u
"|"
);
builder
.
Pop
();
text_style
.
font_size
=
50
;
text_style
.
letter_spacing
=
0
;
text_style
.
word_spacing
=
20
;
builder
.
PushStyle
(
text_style
);
builder
.
AddText
(
"H "
);
builder
.
AddText
(
u
"H "
);
builder
.
Pop
();
text_style
.
font_size
=
50
;
text_style
.
letter_spacing
=
0
;
text_style
.
word_spacing
=
0
;
builder
.
PushStyle
(
text_style
);
builder
.
AddText
(
"H "
);
builder
.
AddText
(
u
"H "
);
builder
.
Pop
();
text_style
.
font_size
=
50
;
text_style
.
letter_spacing
=
0
;
text_style
.
word_spacing
=
20
;
builder
.
PushStyle
(
text_style
);
builder
.
AddText
(
"H "
);
builder
.
AddText
(
u
"H "
);
builder
.
Pop
();
auto
paragraph
=
builder
.
Build
();
...
...
@@ -3598,16 +3598,16 @@ TEST_F(ParagraphTest, KernScaleParagraph) {
text_style
.
color
=
SK_ColorBLACK
;
text_style
.
height
=
1
;
builder
.
PushStyle
(
text_style
);
builder
.
AddText
(
"AVAVAWAH A0 V0 VA To The Lo"
);
builder
.
AddText
(
u
"AVAVAWAH A0 V0 VA To The Lo"
);
builder
.
PushStyle
(
text_style
);
builder
.
AddText
(
"A"
);
builder
.
AddText
(
u
"A"
);
builder
.
PushStyle
(
text_style
);
builder
.
AddText
(
"V"
);
builder
.
AddText
(
u
"V"
);
text_style
.
font_size
=
14
/
scale
;
builder
.
PushStyle
(
text_style
);
builder
.
AddText
(
" Dialog Text List lots of words to see if kerning works on a bigger set
"
"
of characters AVAVAW"
);
u" Dialog Text List lots of words to see if kerning works on a bigger
"
u"set
of characters AVAVAW"
);
builder
.
Pop
();
...
...
@@ -3641,7 +3641,7 @@ TEST_F(ParagraphTest, DISABLE_ON_WINDOWS(NewlineParagraph)) {
text_style
.
height
=
1
;
builder
.
PushStyle
(
text_style
);
builder
.
AddText
(
"line1
\n
line2 test1 test2 test3 test4 test5 test6 test7
\n
line3
\n\n
line4 "
u
"line1
\n
line2 test1 test2 test3 test4 test5 test6 test7
\n
line3
\n\n
line4 "
"test1 test2 test3 test4"
);
builder
.
Pop
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录