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
9ecba20f
Unverified
Commit
9ecba20f
authored
Jun 08, 2021
by
Ren You
Committed by
GitHub
Jun 08, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Always push layer for RenderAnimatedOpacityMixin (#83145)" (#84187)
This reverts commit
048baa75
.
parent
5c54e70f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
5 deletions
+11
-5
proxy_box.dart
packages/flutter/lib/src/rendering/proxy_box.dart
+7
-1
proxy_box_test.dart
packages/flutter/test/rendering/proxy_box_test.dart
+2
-2
proxy_sliver_test.dart
packages/flutter/test/rendering/proxy_sliver_test.dart
+2
-2
No files found.
packages/flutter/lib/src/rendering/proxy_box.dart
View file @
9ecba20f
...
...
@@ -993,7 +993,7 @@ mixin RenderAnimatedOpacityMixin<T extends RenderObject> on RenderObjectWithChil
_alpha
=
ui
.
Color
.
getAlphaFromOpacity
(
opacity
.
value
);
if
(
oldAlpha
!=
_alpha
)
{
final
bool
?
didNeedCompositing
=
_currentlyNeedsCompositing
;
_currentlyNeedsCompositing
=
_alpha
!
>
0
;
_currentlyNeedsCompositing
=
_alpha
!
>
0
&&
_alpha
!
<
255
;
if
(
child
!=
null
&&
didNeedCompositing
!=
_currentlyNeedsCompositing
)
markNeedsCompositingBitsUpdate
();
markNeedsPaint
();
...
...
@@ -1010,6 +1010,12 @@ mixin RenderAnimatedOpacityMixin<T extends RenderObject> on RenderObjectWithChil
layer
=
null
;
return
;
}
if
(
_alpha
==
255
)
{
// No need to keep the layer. We'll create a new one if necessary.
layer
=
null
;
context
.
paintChild
(
child
!,
offset
);
return
;
}
assert
(
needsCompositing
);
layer
=
context
.
pushOpacity
(
offset
,
_alpha
!,
super
.
paint
,
oldLayer:
layer
as
OpacityLayer
?);
}
...
...
packages/flutter/test/rendering/proxy_box_test.dart
View file @
9ecba20f
...
...
@@ -306,7 +306,7 @@ void main() {
expect
(
renderAnimatedOpacity
.
needsCompositing
,
false
);
});
test
(
'RenderAnimatedOpacity does composite if it is opaque'
,
()
{
test
(
'RenderAnimatedOpacity does
not
composite if it is opaque'
,
()
{
final
Animation
<
double
>
opacityAnimation
=
AnimationController
(
vsync:
FakeTickerProvider
(),
)..
value
=
1.0
;
...
...
@@ -318,7 +318,7 @@ void main() {
);
layout
(
renderAnimatedOpacity
,
phase:
EnginePhase
.
composite
);
expect
(
renderAnimatedOpacity
.
needsCompositing
,
tru
e
);
expect
(
renderAnimatedOpacity
.
needsCompositing
,
fals
e
);
});
test
(
'RenderAnimatedOpacity reuses its layer'
,
()
{
...
...
packages/flutter/test/rendering/proxy_sliver_test.dart
View file @
9ecba20f
...
...
@@ -102,7 +102,7 @@ void main() {
expect
(
renderSliverAnimatedOpacity
.
needsCompositing
,
false
);
});
test
(
'RenderSliverAnimatedOpacity does composite if it is opaque'
,
()
{
test
(
'RenderSliverAnimatedOpacity does
not
composite if it is opaque'
,
()
{
final
Animation
<
double
>
opacityAnimation
=
AnimationController
(
vsync:
FakeTickerProvider
(),
)..
value
=
1.0
;
...
...
@@ -124,7 +124,7 @@ void main() {
);
layout
(
root
,
phase:
EnginePhase
.
composite
);
expect
(
renderSliverAnimatedOpacity
.
needsCompositing
,
tru
e
);
expect
(
renderSliverAnimatedOpacity
.
needsCompositing
,
fals
e
);
});
test
(
'RenderSliverAnimatedOpacity reuses its layer'
,
()
{
...
...
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