Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
sxychenjing
engine
提交
6a6986da
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,体验更适合开发者的 AI 搜索 >>
未验证
提交
6a6986da
编写于
9月 03, 2020
作者:
J
Jim Graham
提交者:
GitHub
9月 03, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
improve sensitivity of BackdropFilter web tests (#20915)
上级
c7b3d530
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
22 addition
and
20 deletion
+22
-20
lib/web_ui/dev/goldens_lock.yaml
lib/web_ui/dev/goldens_lock.yaml
+1
-1
lib/web_ui/test/golden_tests/engine/backdrop_filter_golden_test.dart
...test/golden_tests/engine/backdrop_filter_golden_test.dart
+21
-19
未找到文件。
lib/web_ui/dev/goldens_lock.yaml
浏览文件 @
6a6986da
repository
:
https://github.com/flutter/goldens.git
revision
:
86a069d478c3512e4a91baa07ecb421156e10fce
revision
:
57327a39aba333794a092d4e72777bb37102f8ba
lib/web_ui/test/golden_tests/engine/backdrop_filter_golden_test.dart
浏览文件 @
6a6986da
...
...
@@ -12,8 +12,6 @@ import 'package:ui/src/engine.dart';
import
'package:web_engine_tester/golden_tester.dart'
;
final
Rect
region
=
Rect
.
fromLTWH
(
0
,
0
,
500
,
500
);
void
main
(
)
{
internalBootstrapBrowserTest
(()
=>
testMain
);
}
...
...
@@ -35,22 +33,24 @@ void testMain() async {
// the clip boundary around backdrop filter. However there should be only
// one red dot since the other one should be blurred by filter.
test
(
'Background should only blur at ancestor clip boundary'
,
()
async
{
final
Rect
region
=
Rect
.
fromLTWH
(
0
,
0
,
190
,
130
);
final
SurfaceSceneBuilder
builder
=
SurfaceSceneBuilder
();
final
Picture
backgroundPicture
=
_drawBackground
();
final
Picture
backgroundPicture
=
_drawBackground
(
region
);
builder
.
addPicture
(
Offset
.
zero
,
backgroundPicture
);
builder
.
pushClipRect
(
const
Rect
.
fromLTRB
(
10
,
10
,
300
,
30
0
),
const
Rect
.
fromLTRB
(
10
,
10
,
180
,
12
0
),
);
final
Picture
circles1
=
_drawTestPictureWithCircles
(
30
,
30
);
final
Picture
circles1
=
_drawTestPictureWithCircles
(
region
,
30
,
30
);
builder
.
addPicture
(
Offset
.
zero
,
circles1
);
builder
.
pushClipRect
(
const
Rect
.
fromLTRB
(
60
,
10
,
300
,
30
0
),
const
Rect
.
fromLTRB
(
60
,
10
,
180
,
12
0
),
);
builder
.
pushBackdropFilter
(
ImageFilter
.
blur
(
sigmaX:
10.0
,
sigmaY:
10.0
),
oldLayer:
null
);
final
Picture
circles2
=
_drawTestPictureWithCircles
(
90
,
30
);
final
Picture
circles2
=
_drawTestPictureWithCircles
(
region
,
90
,
30
);
builder
.
addPicture
(
Offset
.
zero
,
circles2
);
builder
.
pop
();
builder
.
pop
();
...
...
@@ -64,21 +64,23 @@ void testMain() async {
});
test
(
'Background should only blur at ancestor clip boundary after move'
,
()
async
{
final
Rect
region
=
Rect
.
fromLTWH
(
0
,
0
,
190
,
130
);
final
SurfaceSceneBuilder
builder
=
SurfaceSceneBuilder
();
final
Picture
backgroundPicture
=
_drawBackground
();
final
Picture
backgroundPicture
=
_drawBackground
(
region
);
builder
.
addPicture
(
Offset
.
zero
,
backgroundPicture
);
ClipRectEngineLayer
clipEngineLayer
=
builder
.
pushClipRect
(
const
Rect
.
fromLTRB
(
10
,
10
,
300
,
30
0
),
const
Rect
.
fromLTRB
(
10
,
10
,
180
,
12
0
),
);
final
Picture
circles1
=
_drawTestPictureWithCircles
(
30
,
30
);
final
Picture
circles1
=
_drawTestPictureWithCircles
(
region
,
30
,
30
);
builder
.
addPicture
(
Offset
.
zero
,
circles1
);
ClipRectEngineLayer
clipEngineLayer2
=
builder
.
pushClipRect
(
const
Rect
.
fromLTRB
(
60
,
10
,
300
,
30
0
),
const
Rect
.
fromLTRB
(
60
,
10
,
180
,
12
0
),
);
BackdropFilterEngineLayer
oldBackdropFilterLayer
=
builder
.
pushBackdropFilter
(
ImageFilter
.
blur
(
sigmaX:
10.0
,
sigmaY:
10.0
),
oldLayer:
null
);
final
Picture
circles2
=
_drawTestPictureWithCircles
(
90
,
30
);
final
Picture
circles2
=
_drawTestPictureWithCircles
(
region
,
90
,
30
);
builder
.
addPicture
(
Offset
.
zero
,
circles2
);
builder
.
pop
();
builder
.
pop
();
...
...
@@ -89,12 +91,12 @@ void testMain() async {
final
SurfaceSceneBuilder
builder2
=
SurfaceSceneBuilder
();
builder2
.
addPicture
(
Offset
.
zero
,
backgroundPicture
);
builder2
.
pushClipRect
(
const
Rect
.
fromLTRB
(
10
,
10
,
300
,
30
0
),
const
Rect
.
fromLTRB
(
10
,
10
,
180
,
12
0
),
oldLayer:
clipEngineLayer
);
builder2
.
addPicture
(
Offset
.
zero
,
circles1
);
builder2
.
pushClipRect
(
const
Rect
.
fromLTRB
(
10
,
75
,
300
,
30
0
),
const
Rect
.
fromLTRB
(
10
,
75
,
180
,
12
0
),
oldLayer:
clipEngineLayer2
);
builder2
.
pushBackdropFilter
(
ImageFilter
.
blur
(
sigmaX:
10.0
,
sigmaY:
10.0
),
...
...
@@ -112,10 +114,10 @@ void testMain() async {
});
}
Picture
_drawTestPictureWithCircles
(
double
offsetX
,
double
offsetY
)
{
Picture
_drawTestPictureWithCircles
(
Rect
region
,
double
offsetX
,
double
offsetY
)
{
final
EnginePictureRecorder
recorder
=
PictureRecorder
();
final
RecordingCanvas
canvas
=
recorder
.
beginRecording
(
const
Rect
.
fromLTRB
(
0
,
0
,
400
,
400
)
);
recorder
.
beginRecording
(
region
);
canvas
.
drawCircle
(
Offset
(
offsetX
+
10
,
offsetY
+
10
),
10
,
Paint
()..
style
=
PaintingStyle
.
fill
);
canvas
.
drawCircle
(
...
...
@@ -139,12 +141,12 @@ Picture _drawTestPictureWithCircles(double offsetX, double offsetY) {
return
recorder
.
endRecording
();
}
Picture
_drawBackground
(
)
{
Picture
_drawBackground
(
Rect
region
)
{
final
EnginePictureRecorder
recorder
=
PictureRecorder
();
final
RecordingCanvas
canvas
=
recorder
.
beginRecording
(
const
Rect
.
fromLTRB
(
0
,
0
,
400
,
400
)
);
recorder
.
beginRecording
(
region
);
canvas
.
drawRect
(
Rect
.
fromLTWH
(
8
,
8
,
400.0
-
16
,
400.0
-
16
),
region
.
deflate
(
8.0
),
Paint
()
..
style
=
PaintingStyle
.
fill
..
color
=
Color
(
0xFFE0FFE0
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录