Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_43355755
engine
提交
c1231527
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,发现更多精彩内容 >>
未验证
提交
c1231527
编写于
4月 22, 2019
作者:
D
Dan Field
提交者:
GitHub
4月 22, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Make Rect and RRect use 64 bit doubles, and make them const-able (#8565)
* Make Rect and RRect 64bit and const-able
上级
934772dd
变更
6
展开全部
隐藏空白更改
内联
并排
Showing
6 changed file
with
668 addition
and
610 deletion
+668
-610
lib/stub_ui/lib/geometry.dart
lib/stub_ui/lib/geometry.dart
+324
-295
lib/stub_ui/lib/painting.dart
lib/stub_ui/lib/painting.dart
+2
-2
lib/ui/compositing.dart
lib/ui/compositing.dart
+1
-1
lib/ui/geometry.dart
lib/ui/geometry.dart
+324
-295
lib/ui/painting.dart
lib/ui/painting.dart
+8
-8
testing/dart/rect_test.dart
testing/dart/rect_test.dart
+9
-9
未找到文件。
lib/stub_ui/lib/geometry.dart
浏览文件 @
c1231527
此差异已折叠。
点击以展开。
lib/stub_ui/lib/painting.dart
浏览文件 @
c1231527
...
...
@@ -23,13 +23,13 @@ part of ui;
bool
_rectIsValid
(
Rect
rect
)
{
assert
(
rect
!=
null
,
'Rect argument was null.'
);
assert
(!
rect
.
_value
.
any
((
double
value
)
=>
value
.
isNaN
)
,
'Rect argument contained a NaN value.'
);
assert
(!
rect
.
hasNaN
,
'Rect argument contained a NaN value.'
);
return
true
;
}
bool
_rrectIsValid
(
RRect
rrect
)
{
assert
(
rrect
!=
null
,
'RRect argument was null.'
);
assert
(!
rrect
.
_value
.
any
((
double
value
)
=>
value
.
isNaN
)
,
'RRect argument contained a NaN value.'
);
assert
(!
rrect
.
hasNaN
,
'RRect argument contained a NaN value.'
);
return
true
;
}
...
...
lib/ui/compositing.dart
浏览文件 @
c1231527
...
...
@@ -98,7 +98,7 @@ class SceneBuilder extends NativeFieldWrapperClass2 {
EngineLayer
pushClipRRect
(
RRect
rrect
,
{
Clip
clipBehavior
=
Clip
.
antiAlias
})
{
assert
(
clipBehavior
!=
null
);
assert
(
clipBehavior
!=
Clip
.
none
);
return
_pushClipRRect
(
rrect
.
_value
,
clipBehavior
.
index
);
return
_pushClipRRect
(
rrect
.
_value
32
,
clipBehavior
.
index
);
}
EngineLayer
_pushClipRRect
(
Float32List
rrect
,
int
clipBehavior
)
native
'SceneBuilder_pushClipRRect'
;
...
...
lib/ui/geometry.dart
浏览文件 @
c1231527
此差异已折叠。
点击以展开。
lib/ui/painting.dart
浏览文件 @
c1231527
...
...
@@ -23,13 +23,13 @@ part of dart.ui;
bool
_rectIsValid
(
Rect
rect
)
{
assert
(
rect
!=
null
,
'Rect argument was null.'
);
assert
(!
rect
.
_value
.
any
((
double
value
)
=>
value
.
isNaN
)
,
'Rect argument contained a NaN value.'
);
assert
(!
rect
.
hasNaN
,
'Rect argument contained a NaN value.'
);
return
true
;
}
bool
_rrectIsValid
(
RRect
rrect
)
{
assert
(
rrect
!=
null
,
'RRect argument was null.'
);
assert
(!
rrect
.
_value
.
any
((
double
value
)
=>
value
.
isNaN
)
,
'RRect argument contained a NaN value.'
);
assert
(!
rrect
.
hasNaN
,
'RRect argument contained a NaN value.'
);
return
true
;
}
...
...
@@ -2028,7 +2028,7 @@ class Path extends NativeFieldWrapperClass2 {
/// argument.
void
addRRect
(
RRect
rrect
)
{
assert
(
_rrectIsValid
(
rrect
));
_addRRect
(
rrect
.
_value
);
_addRRect
(
rrect
.
_value
32
);
}
void
_addRRect
(
Float32List
rrect
)
native
'Path_addRRect'
;
...
...
@@ -3259,7 +3259,7 @@ class Canvas extends NativeFieldWrapperClass2 {
void
clipRRect
(
RRect
rrect
,
{
bool
doAntiAlias
=
true
})
{
assert
(
_rrectIsValid
(
rrect
));
assert
(
doAntiAlias
!=
null
);
_clipRRect
(
rrect
.
_value
,
doAntiAlias
);
_clipRRect
(
rrect
.
_value
32
,
doAntiAlias
);
}
void
_clipRRect
(
Float32List
rrect
,
bool
doAntiAlias
)
native
'Canvas_clipRRect'
;
...
...
@@ -3336,7 +3336,7 @@ class Canvas extends NativeFieldWrapperClass2 {
void
drawRRect
(
RRect
rrect
,
Paint
paint
)
{
assert
(
_rrectIsValid
(
rrect
));
assert
(
paint
!=
null
);
_drawRRect
(
rrect
.
_value
,
paint
.
_objects
,
paint
.
_data
);
_drawRRect
(
rrect
.
_value
32
,
paint
.
_objects
,
paint
.
_data
);
}
void
_drawRRect
(
Float32List
rrect
,
List
<
dynamic
>
paintObjects
,
...
...
@@ -3351,7 +3351,7 @@ class Canvas extends NativeFieldWrapperClass2 {
assert
(
_rrectIsValid
(
outer
));
assert
(
_rrectIsValid
(
inner
));
assert
(
paint
!=
null
);
_drawDRRect
(
outer
.
_value
,
inner
.
_value
,
paint
.
_objects
,
paint
.
_data
);
_drawDRRect
(
outer
.
_value
32
,
inner
.
_value32
,
paint
.
_objects
,
paint
.
_data
);
}
void
_drawDRRect
(
Float32List
outer
,
Float32List
inner
,
...
...
@@ -3651,7 +3651,7 @@ class Canvas extends NativeFieldWrapperClass2 {
}
final
Int32List
colorBuffer
=
colors
.
isEmpty
?
null
:
_encodeColorList
(
colors
);
final
Float32List
cullRectBuffer
=
cullRect
?.
_value
;
final
Float32List
cullRectBuffer
=
cullRect
?.
_value
32
;
_drawAtlas
(
paint
.
_objects
,
paint
.
_data
,
atlas
,
rstTransformBuffer
,
rectBuffer
,
...
...
@@ -3698,7 +3698,7 @@ class Canvas extends NativeFieldWrapperClass2 {
_drawAtlas
(
paint
.
_objects
,
paint
.
_data
,
atlas
,
rstTransforms
,
rects
,
colors
,
blendMode
.
index
,
cullRect
?.
_value
colors
,
blendMode
.
index
,
cullRect
?.
_value
32
);
}
...
...
testing/dart/rect_test.dart
浏览文件 @
c1231527
...
...
@@ -8,7 +8,7 @@ import 'package:test/test.dart';
void
main
(
)
{
test
(
'rect accessors'
,
()
{
final
Rect
r
=
Rect
.
fromLTRB
(
1.0
,
3.0
,
5.0
,
7.0
);
const
Rect
r
=
Rect
.
fromLTRB
(
1.0
,
3.0
,
5.0
,
7.0
);
expect
(
r
.
left
,
equals
(
1.0
));
expect
(
r
.
top
,
equals
(
3.0
));
expect
(
r
.
right
,
equals
(
5.0
));
...
...
@@ -16,7 +16,7 @@ void main() {
});
test
(
'rect created by width and height'
,
()
{
final
Rect
r
=
Rect
.
fromLTWH
(
1.0
,
3.0
,
5.0
,
7.0
);
const
Rect
r
=
Rect
.
fromLTWH
(
1.0
,
3.0
,
5.0
,
7.0
);
expect
(
r
.
left
,
equals
(
1.0
));
expect
(
r
.
top
,
equals
(
3.0
));
expect
(
r
.
right
,
equals
(
6.0
));
...
...
@@ -26,8 +26,8 @@ void main() {
});
test
(
'rect intersection'
,
()
{
final
Rect
r1
=
Rect
.
fromLTRB
(
0.0
,
0.0
,
100.0
,
100.0
);
final
Rect
r2
=
Rect
.
fromLTRB
(
50.0
,
50.0
,
200.0
,
200.0
);
const
Rect
r1
=
Rect
.
fromLTRB
(
0.0
,
0.0
,
100.0
,
100.0
);
const
Rect
r2
=
Rect
.
fromLTRB
(
50.0
,
50.0
,
200.0
,
200.0
);
final
Rect
r3
=
r1
.
intersect
(
r2
);
expect
(
r3
.
left
,
equals
(
50.0
));
expect
(
r3
.
top
,
equals
(
50.0
));
...
...
@@ -38,8 +38,8 @@ void main() {
});
test
(
'rect expandToInclude overlapping rects'
,
()
{
final
Rect
r1
=
Rect
.
fromLTRB
(
0.0
,
0.0
,
100.0
,
100.0
);
final
Rect
r2
=
Rect
.
fromLTRB
(
50.0
,
50.0
,
200.0
,
200.0
);
const
Rect
r1
=
Rect
.
fromLTRB
(
0.0
,
0.0
,
100.0
,
100.0
);
const
Rect
r2
=
Rect
.
fromLTRB
(
50.0
,
50.0
,
200.0
,
200.0
);
final
Rect
r3
=
r1
.
expandToInclude
(
r2
);
expect
(
r3
.
left
,
equals
(
0.0
));
expect
(
r3
.
top
,
equals
(
0.0
));
...
...
@@ -50,8 +50,8 @@ void main() {
});
test
(
'rect expandToInclude crossing rects'
,
()
{
final
Rect
r1
=
Rect
.
fromLTRB
(
50.0
,
0.0
,
50.0
,
200.0
);
final
Rect
r2
=
Rect
.
fromLTRB
(
0.0
,
50.0
,
200.0
,
50.0
);
const
Rect
r1
=
Rect
.
fromLTRB
(
50.0
,
0.0
,
50.0
,
200.0
);
const
Rect
r2
=
Rect
.
fromLTRB
(
0.0
,
50.0
,
200.0
,
50.0
);
final
Rect
r3
=
r1
.
expandToInclude
(
r2
);
expect
(
r3
.
left
,
equals
(
0.0
));
expect
(
r3
.
top
,
equals
(
0.0
));
...
...
@@ -70,7 +70,7 @@ void main() {
});
test
(
'rounded rect created from rect and radii'
,
()
{
final
Rect
baseRect
=
Rect
.
fromLTWH
(
1.0
,
3.0
,
5.0
,
7.0
);
const
Rect
baseRect
=
Rect
.
fromLTWH
(
1.0
,
3.0
,
5.0
,
7.0
);
final
RRect
r
=
RRect
.
fromRectXY
(
baseRect
,
1.0
,
1.0
);
expect
(
r
.
left
,
equals
(
1.0
));
expect
(
r
.
top
,
equals
(
3.0
));
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录