Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
sxychenjing
engine
提交
50de4692
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,发现更多精彩内容 >>
未验证
提交
50de4692
编写于
4月 26, 2019
作者:
L
liyuqian
提交者:
GitHub
4月 26, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Check the matrix in pushTransform (#8758)
Fixes flutter/flutter#31650
上级
7df8b7af
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
58 addition
and
6 deletion
+58
-6
flow/layers/transform_layer.cc
flow/layers/transform_layer.cc
+2
-2
lib/ui/compositing.dart
lib/ui/compositing.dart
+1
-4
lib/ui/painting.dart
lib/ui/painting.dart
+1
-0
testing/dart/compositing_test.dart
testing/dart/compositing_test.dart
+54
-0
未找到文件。
flow/layers/transform_layer.cc
浏览文件 @
50de4692
...
...
@@ -15,8 +15,8 @@ TransformLayer::~TransformLayer() = default;
void
TransformLayer
::
Preroll
(
PrerollContext
*
context
,
const
SkMatrix
&
matrix
)
{
// Checks (in some degree) that SkMatrix transform_ is valid and initialized.
//
// We need this even if
is_set_ is true since one can call set_transform with
// an uninitialized SkMatrix.
// We need this even if
transform_ is initialized to identity since one can
//
call set_transform with
an uninitialized SkMatrix.
//
// If transform_ is uninitialized, this assert may look flaky as it doesn't
// fail all the time, and some rerun may make it pass. But don't ignore it and
...
...
lib/ui/compositing.dart
浏览文件 @
50de4692
...
...
@@ -57,10 +57,7 @@ class SceneBuilder extends NativeFieldWrapperClass2 {
///
/// See [pop] for details about the operation stack.
EngineLayer
pushTransform
(
Float64List
matrix4
)
{
if
(
matrix4
==
null
)
throw
new
ArgumentError
(
'"matrix4" argument cannot be null'
);
if
(
matrix4
.
length
!=
16
)
throw
new
ArgumentError
(
'"matrix4" must have 16 entries.'
);
assert
(
_matrix4IsValid
(
matrix4
));
return
_pushTransform
(
matrix4
);
}
EngineLayer
_pushTransform
(
Float64List
matrix4
)
native
'SceneBuilder_pushTransform'
;
...
...
lib/ui/painting.dart
浏览文件 @
50de4692
...
...
@@ -42,6 +42,7 @@ bool _offsetIsValid(Offset offset) {
bool
_matrix4IsValid
(
Float64List
matrix4
)
{
assert
(
matrix4
!=
null
,
'Matrix4 argument was null.'
);
assert
(
matrix4
.
length
==
16
,
'Matrix4 must have 16 entries.'
);
assert
(
matrix4
.
every
((
double
value
)
=>
value
.
isFinite
),
'Matrix4 entries must be finite.'
);
return
true
;
}
...
...
testing/dart/compositing_test.dart
0 → 100644
浏览文件 @
50de4692
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'dart:typed_data'
show
Float64List
;
import
'dart:ui'
;
import
'package:test/test.dart'
;
void
main
(
)
{
test
(
'pushTransform validates the matrix'
,
()
{
final
SceneBuilder
builder
=
SceneBuilder
();
final
Float64List
matrix4
=
Float64List
.
fromList
(<
double
>[
1
,
0
,
0
,
0
,
0
,
1
,
0
,
0
,
0
,
0
,
1
,
0
,
0
,
0
,
0
,
1
,
]);
expect
(
builder
.
pushTransform
(
matrix4
),
isNotNull
);
final
Float64List
matrix4WrongLength
=
Float64List
.
fromList
(<
double
>[
1
,
0
,
0
,
0
,
0
,
1
,
0
,
0
,
0
,
1
,
0
,
0
,
0
,
0
,
]);
expect
(
()
=>
builder
.
pushTransform
(
matrix4WrongLength
),
throwsA
(
const
TypeMatcher
<
AssertionError
>()),
);
final
Float64List
matrix4NaN
=
Float64List
.
fromList
(<
double
>[
1
,
0
,
0
,
0
,
0
,
1
,
0
,
0
,
0
,
0
,
1
,
0
,
0
,
0
,
0
,
double
.
nan
,
]);
expect
(
()
=>
builder
.
pushTransform
(
matrix4NaN
),
throwsA
(
const
TypeMatcher
<
AssertionError
>()),
);
final
Float64List
matrix4Infinity
=
Float64List
.
fromList
(<
double
>[
1
,
0
,
0
,
0
,
0
,
1
,
0
,
0
,
0
,
0
,
1
,
0
,
0
,
0
,
0
,
double
.
infinity
,
]);
expect
(
()
=>
builder
.
pushTransform
(
matrix4NaN
),
throwsA
(
const
TypeMatcher
<
AssertionError
>()),
);
});
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录