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