Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
sxychenjing
engine
提交
d1dcd184
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,发现更多精彩内容 >>
未验证
提交
d1dcd184
编写于
7月 11, 2019
作者:
D
Dan Field
提交者:
GitHub
7月 11, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove breaking asserts (#9797)
上级
55a2b81e
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
23 addition
and
9 deletion
+23
-9
lib/ui/compositing.dart
lib/ui/compositing.dart
+3
-1
lib/ui/painting.dart
lib/ui/painting.dart
+12
-8
testing/dart/color_filter_test.dart
testing/dart/color_filter_test.dart
+8
-0
未找到文件。
lib/ui/compositing.dart
浏览文件 @
d1dcd184
...
...
@@ -390,7 +390,9 @@ class SceneBuilder extends NativeFieldWrapperClass2 {
ColorFilterEngineLayer
pushColorFilter
(
ColorFilter
filter
,
{
ColorFilterEngineLayer
oldLayer
})
{
assert
(
filter
!=
null
);
assert
(
_debugCheckCanBeUsedAsOldLayer
(
oldLayer
,
'pushColorFilter'
));
final
ColorFilterEngineLayer
layer
=
ColorFilterEngineLayer
.
_
(
_pushColorFilter
(
filter
.
_toNativeColorFilter
()));
final
_ColorFilter
nativeFilter
=
filter
.
_toNativeColorFilter
();
assert
(
nativeFilter
!=
null
);
final
ColorFilterEngineLayer
layer
=
ColorFilterEngineLayer
.
_
(
_pushColorFilter
(
nativeFilter
));
assert
(
_debugPushLayer
(
layer
));
return
layer
;
}
...
...
lib/ui/painting.dart
浏览文件 @
d1dcd184
...
...
@@ -1343,16 +1343,17 @@ class Paint {
}
set
colorFilter
(
ColorFilter
value
)
{
if
(
value
==
null
)
{
final
_ColorFilter
nativeFilter
=
value
?.
_toNativeColorFilter
();
if
(
nativeFilter
==
null
)
{
if
(
_objects
!=
null
)
{
_objects
[
_kColorFilterIndex
]
=
null
;
}
}
else
{
if
(
_objects
==
null
)
{
_objects
=
List
<
dynamic
>(
_kObjectCount
);
_objects
[
_kColorFilterIndex
]
=
value
.
_toNativeColorFilter
()
;
_objects
[
_kColorFilterIndex
]
=
nativeFilter
;
}
else
if
(
_objects
[
_kColorFilterIndex
]?.
creator
!=
value
)
{
_objects
[
_kColorFilterIndex
]
=
value
.
_toNativeColorFilter
()
;
_objects
[
_kColorFilterIndex
]
=
nativeFilter
;
}
}
}
...
...
@@ -2489,9 +2490,7 @@ class ColorFilter {
/// to the [Paint.blendMode], using the output of this filter as the source
/// and the background as the destination.
const
ColorFilter
.
mode
(
Color
color
,
BlendMode
blendMode
)
:
assert
(
color
!=
null
),
assert
(
blendMode
!=
null
),
_color
=
color
,
:
_color
=
color
,
_blendMode
=
blendMode
,
_matrix
=
null
,
_type
=
_TypeMode
;
...
...
@@ -2500,8 +2499,7 @@ class ColorFilter {
/// matrix is in row-major order and the translation column is specified in
/// unnormalized, 0...255, space.
const
ColorFilter
.
matrix
(
List
<
double
>
matrix
)
:
assert
(
matrix
!=
null
,
'Color Matrix argument was null.'
),
_color
=
null
,
:
_color
=
null
,
_blendMode
=
null
,
_matrix
=
matrix
,
_type
=
_TypeMatrix
;
...
...
@@ -2555,8 +2553,14 @@ class ColorFilter {
_ColorFilter
_toNativeColorFilter
()
{
switch
(
_type
)
{
case
_TypeMode:
if
(
_color
==
null
||
_blendMode
==
null
)
{
return
null
;
}
return
_ColorFilter
.
mode
(
this
);
case
_TypeMatrix:
if
(
_matrix
==
null
)
{
return
null
;
}
assert
(
_matrix
.
length
==
20
,
'Color Matrix must have 20 entries.'
);
return
_ColorFilter
.
matrix
(
this
);
case
_TypeLinearToSrgbGamma:
...
...
testing/dart/color_filter_test.dart
浏览文件 @
d1dcd184
...
...
@@ -41,6 +41,14 @@ void main() {
return
bytes
.
buffer
.
asUint32List
();
}
test
(
'ColorFilter - nulls'
,
()
async
{
final
Paint
paint
=
Paint
()..
colorFilter
=
ColorFilter
.
mode
(
null
,
null
);
expect
(
paint
.
colorFilter
,
null
);
paint
.
colorFilter
=
ColorFilter
.
matrix
(
null
);
expect
(
paint
.
colorFilter
,
null
);
});
test
(
'ColorFilter - mode'
,
()
async
{
final
Paint
paint
=
Paint
()
..
color
=
green
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录