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
a607a60b
Unverified
Commit
a607a60b
authored
Dec 06, 2021
by
Ren You
Committed by
GitHub
Dec 06, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Ensure the engineLayer is disposed when an OpacityLayer is disabled (#94280)" (#94743)
This reverts commit
c567f843
.
parent
4533afa5
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
21 deletions
+1
-21
layer.dart
packages/flutter/lib/src/rendering/layer.dart
+1
-6
layers_test.dart
packages/flutter/test/rendering/layers_test.dart
+0
-15
No files found.
packages/flutter/lib/src/rendering/layer.dart
View file @
a607a60b
...
...
@@ -1764,16 +1764,11 @@ class OpacityLayer extends OffsetLayer {
@override
void
addToScene
(
ui
.
SceneBuilder
builder
)
{
assert
(
alpha
!=
null
);
// Don't add this layer if there's no child.
bool
enabled
=
firstChild
!=
null
;
bool
enabled
=
firstChild
!=
null
;
// don't add this layer if there's no child
if
(!
enabled
)
{
// Ensure the engineLayer is disposed.
engineLayer
=
null
;
// TODO(dnfield): Remove this if/when we can fix https://github.com/flutter/flutter/issues/90004
return
;
}
assert
(()
{
enabled
=
enabled
&&
!
debugDisableOpacityLayers
;
return
true
;
...
...
packages/flutter/test/rendering/layers_test.dart
View file @
a607a60b
...
...
@@ -637,21 +637,6 @@ void main() {
expect
(
builder
.
addedPicture
,
true
);
expect
(
layer
.
engineLayer
,
isA
<
FakeOpacityEngineLayer
>());
});
test
(
'OpacityLayer dispose its engineLayer if there are no children'
,
()
{
final
OpacityLayer
layer
=
OpacityLayer
(
alpha:
128
);
final
FakeSceneBuilder
builder
=
FakeSceneBuilder
();
layer
.
addToScene
(
builder
);
expect
(
layer
.
engineLayer
,
null
);
layer
.
append
(
PictureLayer
(
Rect
.
largest
)..
picture
=
FakePicture
());
layer
.
addToScene
(
builder
);
expect
(
layer
.
engineLayer
,
isA
<
FakeOpacityEngineLayer
>());
layer
.
removeAllChildren
();
layer
.
addToScene
(
builder
);
expect
(
layer
.
engineLayer
,
null
);
});
}
class
FakeEngineLayer
extends
Fake
implements
EngineLayer
{
...
...
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