Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
264082f3
Unverified
Commit
264082f3
authored
Nov 27, 2019
by
liyuqian
Committed by
GitHub
Nov 27, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Print clipBehavior while debugging ClipXXXLayer (#45716)
Fixes
https://github.com/flutter/flutter/issues/45587
parent
5ccd4f34
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
0 deletions
+40
-0
layer.dart
packages/flutter/lib/src/rendering/layer.dart
+8
-0
layers_test.dart
packages/flutter/test/rendering/layers_test.dart
+32
-0
No files found.
packages/flutter/lib/src/rendering/layer.dart
View file @
264082f3
...
...
@@ -1294,6 +1294,7 @@ class ClipRectLayer extends ContainerLayer {
void
debugFillProperties
(
DiagnosticPropertiesBuilder
properties
)
{
super
.
debugFillProperties
(
properties
);
properties
.
add
(
DiagnosticsProperty
<
Rect
>(
'clipRect'
,
clipRect
));
properties
.
add
(
DiagnosticsProperty
<
Clip
>(
'clipBehavior'
,
clipBehavior
));
}
}
...
...
@@ -1374,6 +1375,7 @@ class ClipRRectLayer extends ContainerLayer {
void
debugFillProperties
(
DiagnosticPropertiesBuilder
properties
)
{
super
.
debugFillProperties
(
properties
);
properties
.
add
(
DiagnosticsProperty
<
RRect
>(
'clipRRect'
,
clipRRect
));
properties
.
add
(
DiagnosticsProperty
<
Clip
>(
'clipBehavior'
,
clipBehavior
));
}
}
...
...
@@ -1449,6 +1451,12 @@ class ClipPathLayer extends ContainerLayer {
if
(
enabled
)
builder
.
pop
();
}
@override
void
debugFillProperties
(
DiagnosticPropertiesBuilder
properties
)
{
super
.
debugFillProperties
(
properties
);
properties
.
add
(
DiagnosticsProperty
<
Clip
>(
'clipBehavior'
,
clipBehavior
));
}
}
/// A composite layer that applies a [ColorFilter] to its children.
...
...
packages/flutter/test/rendering/layers_test.dart
View file @
264082f3
...
...
@@ -224,6 +224,38 @@ void main() {
expect
(
layer
.
debugSubtreeNeedsAddToScene
,
true
);
}
List
<
String
>
_getDebugInfo
(
Layer
layer
)
{
final
DiagnosticPropertiesBuilder
builder
=
DiagnosticPropertiesBuilder
();
layer
.
debugFillProperties
(
builder
);
return
builder
.
properties
.
where
((
DiagnosticsNode
node
)
=>
!
node
.
isFiltered
(
DiagnosticLevel
.
info
))
.
map
((
DiagnosticsNode
node
)
=>
node
.
toString
()).
toList
();
}
test
(
'ClipRectLayer prints clipBehavior in debug info'
,
()
{
expect
(
_getDebugInfo
(
ClipRectLayer
()),
contains
(
'clipBehavior: Clip.hardEdge'
));
expect
(
_getDebugInfo
(
ClipRectLayer
(
clipBehavior:
Clip
.
antiAliasWithSaveLayer
)),
contains
(
'clipBehavior: Clip.antiAliasWithSaveLayer'
),
);
});
test
(
'ClipRRectLayer prints clipBehavior in debug info'
,
()
{
expect
(
_getDebugInfo
(
ClipRRectLayer
()),
contains
(
'clipBehavior: Clip.antiAlias'
));
expect
(
_getDebugInfo
(
ClipRRectLayer
(
clipBehavior:
Clip
.
antiAliasWithSaveLayer
)),
contains
(
'clipBehavior: Clip.antiAliasWithSaveLayer'
),
);
});
test
(
'ClipPathLayer prints clipBehavior in debug info'
,
()
{
expect
(
_getDebugInfo
(
ClipPathLayer
()),
contains
(
'clipBehavior: Clip.antiAlias'
));
expect
(
_getDebugInfo
(
ClipPathLayer
(
clipBehavior:
Clip
.
antiAliasWithSaveLayer
)),
contains
(
'clipBehavior: Clip.antiAliasWithSaveLayer'
),
);
});
test
(
'mutating PictureLayer fields triggers needsAddToScene'
,
()
{
final
PictureLayer
pictureLayer
=
PictureLayer
(
Rect
.
zero
);
checkNeedsAddToScene
(
pictureLayer
,
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment